This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [AArch64] Simplify TLS pattern by hardcoding relocation modifiers into pattern




On 17/12/15 11:44, Marcus Shawcroft wrote:
On 10 September 2015 at 12:28, Jiong Wang <jiong.wang@arm.com> wrote:
TLS instruction sequences are always with fixed format, there is no need
to use operand modifier, we can hardcode the relocation modifiers into
instruction pattern, all those redundant checks in aarch64_print_operand
can be removed.

OK for trunk?

2015-09-10  Jiong Wang  <jiong.wang@arm.com>

gcc/
   * config/aarch64/aarch64.md (ldr_got_tiny): Hardcode relocation
   modifers.
   (tlsgd_small): Likewise.
   (tlsgd_tiny): Likewise.
   (tlsie_small_<mode>): Likewise.
   (tlsie_small_sidi): Likewise.
   (tlsie_tiny_<mode>): Likewise.
   (tlsie_tiny_sidi): Likewise.
   (tlsle12_<mode>): Likewise.
   (tlsle24_<mode>): Likewise.
   (tlsdesc_small_<mode>): Likewise.
   (tlsdesc_small_pseudo_<mode>): Likewise.
   (tlsdesc_tiny_<mode>): Likewise.
   (tlsdesc_tiny_pseudo_<mode>): Likewise.
   * config/aarch64/aarch64.c (aarch64_print_operand): Delete useless
   check on 'A', 'L', 'G'.
Hi, Is there a particular reason for wanting to change this?

It's because operand modifier is only need if

  "different variants of the assembler require different syntax."

These TLS RTL patterns have fixed assembler string, we just need to
output them literally.

If we don't do this cleanup, we will end up doing redundant checking in
aarch64_print_operand.

For example, the 'L' operand modifier is used by various TLS patterns,
if it's for "tlsie_tiny_sidi"  then we should output ":gottprel:", if
it's for tlsie_small_sidi, we should output ":gottprel_lo12:", and
similar for quite a few others.

We have classified those symbols into different types, so different TLS
unspec patterns generated for each one. The use of operand modifer 'L'
is purely revert the classification we have done, and re-do the
classification in aarch64_print_operand uncessarily.

   case 'L':
      switch (aarch64_classify_symbolic_expression (x))
        {
        case SYMBOL_SMALL_GOT_4G:
          ...
        case SYMBOL_SMALL_TLSGD:
          ...
        case SYMBOL_SMALL_TLSDESC:
          ...
        case SYMBOL_SMALL_TLSIE:
          ...
    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]