From patchwork Wed Jan 19 18:33:27 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: 79500 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 BA35EB70E0 for ; Thu, 20 Jan 2011 05:33:39 +1100 (EST) Received: (qmail 15239 invoked by alias); 19 Jan 2011 18:33:36 -0000 Received: (qmail 15211 invoked by uid 22791); 19 Jan 2011 18:33:34 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Jan 2011 18:33:30 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 19 Jan 2011 10:33:28 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 19 Jan 2011 10:33:28 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id A891D180D92; Wed, 19 Jan 2011 10:33:27 -0800 (PST) Date: Wed, 19 Jan 2011 10:33:27 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [x32] PATH: Add x32_lea_immediate_operand/x32_lea_nonmemory_operand Message-ID: <20110119183327.GA6048@intel.com> 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 LEA is another special pattern for x32. I am checking in this patch to add x32_lea_immediate_operand/x32_lea_nonmemory_operand. H.J. diff --git a/gcc/ChangeLog.x32 b/gcc/ChangeLog.x32 index fb31436..ca27084 100644 --- a/gcc/ChangeLog.x32 +++ b/gcc/ChangeLog.x32 @@ -1,5 +1,10 @@ 2011-01-19 H.J. Lu + * config/i386/predicates.md (x32_lea_immediate_operand): New. + (x32_lea_nonmemory_operand): Likewise. + +2011-01-19 H.J. Lu + * config/i386/constraints.md (Ys): New. (Ye): Likewise. diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index 3d06bd3..55a04e3 100644 --- a/gcc/config/i386/predicates.md +++ b/gcc/config/i386/predicates.md @@ -1243,3 +1243,17 @@ (match_test "flag_pic")) (match_operand 0 "x86_64_general_operand") (match_operand 0 "general_operand"))) + +;; Return true when a constant operand can be used in lea on x32. +(define_predicate "x32_lea_immediate_operand" + (match_operand 0 "immediate_operand") +{ + return !TARGET_X32 || !SYMBOLIC_CONST (op); +}) + +;; Return nonzero if OP is nonmemory operand representable in lea on x32. +(define_predicate "x32_lea_nonmemory_operand" + (match_operand 0 "nonmemory_operand") +{ + return !TARGET_X32 || !SYMBOLIC_CONST (op); +})