From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22886 invoked by alias); 19 May 2011 18:13:10 -0000 Received: (qmail 22878 invoked by uid 22791); 19 May 2011 18:13:09 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 18:12:55 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p4JICteK012513 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 19 May 2011 14:12:55 -0400 Received: from pebble.twiddle.home (vpn-235-171.phx2.redhat.com [10.3.235.171]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p4JICsfU030595; Thu, 19 May 2011 14:12:54 -0400 Message-ID: <4DD55DA6.2030000@redhat.com> Date: Thu, 19 May 2011 20:07:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: Nick Clifton CC: law@redhat.com, aoliva@redhat.com, gcc-patches@gcc.gnu.org Subject: Re: RFA: MN10300: Add TLS support References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2011-05/txt/msg01409.txt.bz2 > + fmt = GET_RTX_FORMAT (GET_CODE (x)); > + for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) > + { > + if (fmt[i] == 'E') > + { > + int j; > + > + for (j = XVECLEN (x, i) - 1; j >= 0; j--) > + if (! is_legitimate_tls_operand (XVECEXP (x, i, j))) > + return false; > + } > + else if (fmt[i] == 'e' && ! is_legitimate_tls_operand (XEXP (x, i))) > + return false; Do you really want to find such an unspec buried in arbitrary rtl? That seems in conflict with the term "legitimate". But supposing that you really do, this code should use for_each_rtx. > @@ -1908,6 +2007,9 @@ > const char *fmt; > int i; > > + if (is_legitimate_tls_operand (x)) Please remember to use -p in generating the diff, for function context. > +(define_predicate "tls_symbolic_operand" > + (match_code "symbol_ref") > +{ > + return SYMBOL_REF_TLS_MODEL (op); > +}) I'm pretty sure you also want to test for (const (plus (symbol) (int)). > +(define_predicate "nontls_general_operand" > + (match_code "const_int,const_double,const,symbol_ref,label_ref,subreg,reg,mem") > +{ > + if (tls_symbolic_operand (op, mode)) > + return false; > + return general_operand (op, mode); > +}) Simpler as (define_predicate "nontls_general_operand" (and (match_operand "general_operand" 0) (not (match_operand "tls_symbolic_operand" 0))) > +#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '&') This is now a target hook. > +mn10300_tls_get_addr (void) > +{ > + return gen_rtx_REG (Pmode, TLS_REG); > +} Most seriously, I don't see TLS_REG become fixed. And some note that this is an ABI change. r~