From patchwork Sun May 15 23:00:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 95669 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id D6222B6EF3 for ; Mon, 16 May 2011 09:00:18 +1000 (EST) Received: (qmail 12066 invoked by alias); 15 May 2011 23:00:15 -0000 Received: (qmail 12053 invoked by uid 22791); 15 May 2011 23:00:14 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 May 2011 23:00:00 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 15 May 2011 16:00:00 -0700 X-ExtLoop1: 1 Received: from gnu-4.sc.intel.com ([10.3.194.56]) by fmsmga002.fm.intel.com with ESMTP; 15 May 2011 16:00:00 -0700 Received: by gnu-4.sc.intel.com (Postfix, from userid 500) id 5D60A201CE; Sun, 15 May 2011 16:00:00 -0700 (PDT) Date: Sun, 15 May 2011 16:00:00 -0700 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATCH: Put back mode on operand 1 in tls_global_dynamic_64 patterns. Message-ID: <20110515230000.GA6225@lucon.org> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hi, I checked in this patch to put back mode on operand 1 in tls_global_dynamic_64 patterns. H.J. --- commit 6eddaa2187ccb80fe8515705778b5818033cfb2d Author: H.J. Lu Date: Fri May 13 10:35:16 2011 -0700 Rename tls_global_dynamic_64 to tls_global_dynamic_64_. diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index 9426489..15da5cc 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,3 +1,13 @@ +2011-05-13 H.J. Lu + + PR target/47715 + * config/i386/i386.md (PTR64): New. + (*tls_global_dynamic_64): Rename to ... + (*tls_global_dynamic_64_): This. Put PTR64 on operand 1. + (tls_global_dynamic_64): Rename to ... + (tls_global_dynamic_64_): This. Put PTR64 on operand 1. + * config/i386/i386.c (legitimize_tls_address): Updated. + 2011-05-06 H.J. Lu * config/i386/i386.c (ix86_promote_function_mode): Handle NULL diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b89f558..2edde71 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12909,9 +12909,22 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov) if (TARGET_64BIT) { rtx rax = gen_rtx_REG (Pmode, AX_REG), insns; + rtx (*tls_global_dynamic) (rtx, rtx, rtx); + + switch (GET_MODE (x)) + { + case SImode: + tls_global_dynamic = gen_tls_global_dynamic_64_si; + break; + case DImode: + tls_global_dynamic = gen_tls_global_dynamic_64_di; + break; + default: + gcc_unreachable (); + } start_sequence (); - emit_call_insn (gen_tls_global_dynamic_64 (rax, x, caddr)); + emit_call_insn (tls_global_dynamic (rax, x, caddr)); insns = get_insns (); end_sequence (); diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 41bfe4e..ead5763 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -967,7 +967,9 @@ ;; ptr_mode sized quantities. (define_mode_iterator PTR [(SI "ptr_mode == SImode") (DI "ptr_mode == DImode")]) - + +;; Pointer modes in 64bit. +(define_mode_iterator PTR64 [(SI "TARGET_X32") DI]) ;; Scheduling descriptions @@ -12603,11 +12605,11 @@ (clobber (match_scratch:SI 5 "")) (clobber (reg:CC FLAGS_REG))])]) -(define_insn "*tls_global_dynamic_64" +(define_insn "*tls_global_dynamic_64_" [(set (match_operand:DI 0 "register_operand" "=a") (call:DI (mem:QI (match_operand:DI 2 "call_insn_operand" "")) (match_operand:DI 3 "" ""))) - (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + (unspec:DI [(match_operand:PTR64 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)] "TARGET_64BIT" { @@ -12620,12 +12622,12 @@ (set (attr "length") (symbol_ref "TARGET_X32 ? 15 : 16"))]) -(define_expand "tls_global_dynamic_64" +(define_expand "tls_global_dynamic_64_" [(parallel [(set (match_operand:DI 0 "register_operand" "") (call:DI (mem:QI (match_operand:DI 2 "call_insn_operand" "")) (const_int 0))) - (unspec:DI [(match_operand 1 "tls_symbolic_operand" "")] + (unspec:DI [(match_operand:PTR64 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)])]) (define_insn "*tls_local_dynamic_base_32_gnu"