From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78214 invoked by alias); 18 Dec 2015 09:45:07 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78199 invoked by uid 89); 18 Dec 2015 09:45:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_STOCKGEN,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=sk:SYMBOL_, classified, classification X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 Dec 2015 09:45:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ED5EF491; Fri, 18 Dec 2015 01:44:38 -0800 (PST) Received: from [10.2.206.22] (e104437-lin.cambridge.arm.com [10.2.206.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 906A63F24D; Fri, 18 Dec 2015 01:45:03 -0800 (PST) Subject: Re: [AArch64] Simplify TLS pattern by hardcoding relocation modifiers into pattern To: Marcus Shawcroft References: Cc: gcc-patches List From: Jiong Wang Message-ID: <5673D59E.8080205@foss.arm.com> Date: Fri, 18 Dec 2015 09:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01857.txt.bz2 On 17/12/15 11:44, Marcus Shawcroft wrote: > On 10 September 2015 at 12:28, Jiong Wang 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 >> >> gcc/ >> * config/aarch64/aarch64.md (ldr_got_tiny): Hardcode relocation >> modifers. >> (tlsgd_small): Likewise. >> (tlsgd_tiny): Likewise. >> (tlsie_small_): Likewise. >> (tlsie_small_sidi): Likewise. >> (tlsie_tiny_): Likewise. >> (tlsie_tiny_sidi): Likewise. >> (tlsle12_): Likewise. >> (tlsle24_): Likewise. >> (tlsdesc_small_): Likewise. >> (tlsdesc_small_pseudo_): Likewise. >> (tlsdesc_tiny_): Likewise. >> (tlsdesc_tiny_pseudo_): 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: ... }