From 8fd17b982de905b1d564b9be985ecaacbc6c635f Mon Sep 17 00:00:00 2001 From: Jiong Wang Date: Mon, 29 Jun 2015 14:20:50 +0000 Subject: [PATCH] [AArch64] Generalize TLSLE macro and pattern names 2015-06-29 Jiong Wang * config/arch64/aarch64.md (UNSPEC_TLSLE): New enumeration. * config/arch64/aarch64.md (tlsle_small): Rename to tlsle and use new unspec name. (tlsle_small_): Rename to tlsle_ 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 | 15 +++++++++++++++ gcc/config/aarch64/aarch64-protos.h | 4 ++-- gcc/config/aarch64/aarch64.c | 14 +++++++------- gcc/config/aarch64/aarch64.md | 15 +++++++-------- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ce7acb0085..40fd3257d13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2015-06-29 Jiong Wang + + * config/arch64/aarch64.md (UNSPEC_TLSLE): New enumeration. + * config/arch64/aarch64.md (tlsle_small): Rename to tlsle and use new + unspec name. + (tlsle_small_): Rename to tlsle_ 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 Marc Glisse diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 2c623cc145c..4062c2736ae 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -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 }; diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index f130f8dea1d..0079c82b0f8 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -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: diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index a1722684bc5..2d56a75b43f 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -117,6 +117,7 @@ UNSPEC_ST4_LANE UNSPEC_TLS UNSPEC_TLSDESC + UNSPEC_TLSLE UNSPEC_USHL_2S UNSPEC_VSTRUCTDUMMY UNSPEC_SP_SET @@ -4446,27 +4447,25 @@ (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_" +(define_insn "tlsle_" [(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%0, %1, #%G2, lsl #12\;add\\t%0, %0, #%L2" [(set_attr "type" "alu_sreg") -- 2.30.2