[AArch64] Generalize TLSLE macro and pattern names
authorJiong Wang <jiong.wang@arm.com>
Mon, 29 Jun 2015 14:20:50 +0000 (14:20 +0000)
committerJiong Wang <jiwang@gcc.gnu.org>
Mon, 29 Jun 2015 14:20:50 +0000 (14:20 +0000)
2015-06-29  Jiong Wang  <jiong.wang@arm.com>

* config/arch64/aarch64.md (UNSPEC_TLSLE): New enumeration.
* config/arch64/aarch64.md (tlsle_small): Rename to tlsle and use new
unspec name.
(tlsle_small_<mode>): Rename to tlsle_<mode> and use new unspec name.
* config/arch64/aarch64-protos.h (arch64_symbol_type): Rename
SYMBOL_SMALL_TPREL to SYMBOL_TLSLE.
(aarch64_symbol_context): Ditto.
* config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Ditto
and use new pattern name.
(aarch64_expand_mov_immediate): Ditto.
(aarch64_print_operand): Ditto.
(aarch64_classify_tls_symbol): Ditto.

From-SVN: r225121

gcc/ChangeLog
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/aarch64.md

index 3ce7acb..40fd325 100644 (file)
@@ -1,3 +1,18 @@
+2015-06-29  Jiong Wang  <jiong.wang@arm.com>
+
+       * config/arch64/aarch64.md (UNSPEC_TLSLE): New enumeration.
+       * config/arch64/aarch64.md (tlsle_small): Rename to tlsle and use new
+       unspec name.
+       (tlsle_small_<mode>): Rename to tlsle_<mode> and use new unspec name.
+       * config/arch64/aarch64-protos.h (arch64_symbol_type): Rename
+       SYMBOL_SMALL_TPREL to SYMBOL_TLSLE.
+       (aarch64_symbol_context): Ditto.
+       * config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Ditto
+       and use new pattern name.
+       (aarch64_expand_mov_immediate): Ditto.
+       (aarch64_print_operand): Ditto.
+       (aarch64_classify_tls_symbol): Ditto.
+
 2015-06-29  Marek Polacek  <polacek@redhat.com>
            Marc Glisse  <marc.glisse@inria.fr>
 
index 2c623cc..4062c27 100644 (file)
@@ -72,7 +72,7 @@ enum aarch64_symbol_context
    SYMBOL_SMALL_TLSGD
    SYMBOL_SMALL_TLSDESC
    SYMBOL_SMALL_GOTTPREL
-   SYMBOL_SMALL_TPREL
+   SYMBOL_TLSLE
    Each of of these represents a thread-local symbol, and corresponds to the
    thread local storage relocation operator for the symbol being referred to.
 
@@ -107,9 +107,9 @@ enum aarch64_symbol_type
   SYMBOL_SMALL_TLSGD,
   SYMBOL_SMALL_TLSDESC,
   SYMBOL_SMALL_GOTTPREL,
-  SYMBOL_SMALL_TPREL,
   SYMBOL_TINY_ABSOLUTE,
   SYMBOL_TINY_GOT,
+  SYMBOL_TLSLE,
   SYMBOL_FORCE_TO_MEM
 };
 
index f130f8d..0079c82 100644 (file)
@@ -1059,14 +1059,14 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
        return;
       }
 
-    case SYMBOL_SMALL_TPREL:
+    case SYMBOL_TLSLE:
       {
        rtx tp = aarch64_load_tp (NULL);
 
        if (GET_MODE (dest) != Pmode)
          tp = gen_lowpart (GET_MODE (dest), tp);
 
-       emit_insn (gen_tlsle_small (dest, tp, imm));
+       emit_insn (gen_tlsle (dest, tp, imm));
        set_unique_reg_note (get_last_insn (), REG_EQUIV, imm);
        return;
       }
@@ -1619,9 +1619,9 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
            }
          /* FALLTHRU */
 
-        case SYMBOL_SMALL_TPREL:
        case SYMBOL_SMALL_ABSOLUTE:
        case SYMBOL_TINY_ABSOLUTE:
+       case SYMBOL_TLSLE:
          aarch64_load_symref_appropriately (dest, imm, sty);
          return;
 
@@ -4504,7 +4504,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
          asm_fprintf (asm_out_file, ":gottprel:");
          break;
 
-       case SYMBOL_SMALL_TPREL:
+       case SYMBOL_TLSLE:
          asm_fprintf (asm_out_file, ":tprel:");
          break;
 
@@ -4537,7 +4537,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
          asm_fprintf (asm_out_file, ":gottprel_lo12:");
          break;
 
-       case SYMBOL_SMALL_TPREL:
+       case SYMBOL_TLSLE:
          asm_fprintf (asm_out_file, ":tprel_lo12_nc:");
          break;
 
@@ -4555,7 +4555,7 @@ aarch64_print_operand (FILE *f, rtx x, char code)
 
       switch (aarch64_classify_symbolic_expression (x, SYMBOL_CONTEXT_ADR))
        {
-       case SYMBOL_SMALL_TPREL:
+       case SYMBOL_TLSLE:
          asm_fprintf (asm_out_file, ":tprel_hi12:");
          break;
        default:
@@ -7635,7 +7635,7 @@ aarch64_classify_tls_symbol (rtx x)
       return SYMBOL_SMALL_GOTTPREL;
 
     case TLS_MODEL_LOCAL_EXEC:
-      return SYMBOL_SMALL_TPREL;
+      return SYMBOL_TLSLE;
 
     case TLS_MODEL_EMULATED:
     case TLS_MODEL_NONE:
index a172268..2d56a75 100644 (file)
     UNSPEC_ST4_LANE
     UNSPEC_TLS
     UNSPEC_TLSDESC
+    UNSPEC_TLSLE
     UNSPEC_USHL_2S
     UNSPEC_VSTRUCTDUMMY
     UNSPEC_SP_SET
    (set_attr "length" "8")]
 )
 
-(define_expand "tlsle_small"
+(define_expand "tlsle"
   [(set (match_operand 0 "register_operand" "=r")
         (unspec [(match_operand 1 "register_operand" "r")
                    (match_operand 2 "aarch64_tls_le_symref" "S")]
-                   UNSPEC_GOTSMALLTLS))]
+                   UNSPEC_TLSLE))]
   ""
 {
   machine_mode mode = GET_MODE (operands[0]);
   emit_insn ((mode == DImode
-             ? gen_tlsle_small_di
-             : gen_tlsle_small_si) (operands[0],
-                                    operands[1],
-                                    operands[2]));
+             ? gen_tlsle_di
+             : gen_tlsle_si) (operands[0], operands[1], operands[2]));
   DONE;
 })
 
-(define_insn "tlsle_small_<mode>"
+(define_insn "tlsle_<mode>"
   [(set (match_operand:P 0 "register_operand" "=r")
         (unspec:P [(match_operand:P 1 "register_operand" "r")
                    (match_operand 2 "aarch64_tls_le_symref" "S")]
-                  UNSPEC_GOTSMALLTLS))]
+                  UNSPEC_TLSLE))]
   ""
   "add\\t%<w>0, %<w>1, #%G2, lsl #12\;add\\t%<w>0, %<w>0, #%L2"
   [(set_attr "type" "alu_sreg")