public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jiong Wang <jiong.wang@foss.arm.com>
To: Marcus Shawcroft <marcus.shawcroft@gmail.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [AArch64] Simplify TLS pattern by hardcoding relocation modifiers into pattern
Date: Fri, 18 Dec 2015 09:45:00 -0000	[thread overview]
Message-ID: <5673D59E.8080205@foss.arm.com> (raw)
In-Reply-To: <CAFqB+Pxm6tG173bSwa=xDV27om4kN=_x3Cw=bvgC_2TaOrYbDw@mail.gmail.com>



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:
           ...
     }

      reply	other threads:[~2015-12-18  9:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10 11:46 Jiong Wang
2015-12-16 15:26 ` [Ping]Re: " Jiong Wang
2015-12-17 11:44 ` Marcus Shawcroft
2015-12-18  9:45   ` Jiong Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5673D59E.8080205@foss.arm.com \
    --to=jiong.wang@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcus.shawcroft@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).