On 21 May 2015 at 17:49, Jiong Wang <jiong.w...@arm.com> wrote:

> 2015-05-14  Jiong Wang  <jiong.w...@arm.com>
> gcc/
>   * config/aarch64/aarch64.c (aarch64_print_operand): Support tls_size.
>   * config/aarch64/aarch64.md (tlsle): Choose proper instruction
>   sequences.
>   (tlsle_<mode>): New define_insn.
>   (tlsle_movsym_<mode>): Ditto.
>   * config/aarch64/constraints.md (Uta): New constraint.
>   (Utb): Ditto.
>   (Utc): Ditto.
>   (Utd): Ditto.
>
> gcc/testsuite/
>   * gcc.target/aarch64/tlsle.c: New test source.
>   * gcc.target/aarch64/tlsle12.c: New testcase.
>   * gcc.target/aarch64/tlsle24.c: New testcase.
>   * gcc.target/aarch64/tlsle32.c: New testcase.
>


  case SYMBOL_TLSLE:
-  asm_fprintf (asm_out_file, ":tprel_lo12_nc:");
+  if (aarch64_tls_size <= 12)
+    /* Make sure TLS offset fit into 12bit.  */
+    asm_fprintf (asm_out_file, ":tprel_lo12:");
+  else
+    asm_fprintf (asm_out_file, ":tprel_lo12_nc:");
   break;

Use the existing classify_symbol mechanism we use throughout the
aarch64 backend.  Specifically rename SYMBOL_TLSLE as SYMBOL_TLSLE24
and introduce the 3 missing flavours then use the symbol
classification to control behaviour such as this modifier selection.

Cheers
/Marcus

Reply via email to