From patchwork Tue Mar 13 18:42:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 146470 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 4FBACB6EF3 for ; Wed, 14 Mar 2012 05:42:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332268960; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=bYUlGMI VDwtMrtrZpRGlt0wyuEM=; b=lGQ6zXeHRT8Ae0ZKEeVF3Vl1ZTCmwUYJV2wJVP5 gEissRKrfOwsd+9e+duOll8n3fFtXer/3shh0jaN2uFZP0pZ1xjj1htsQOdeZpGS vlOlQRH6kOcsdmTeO0Syk6qiCYFZO/p/FcjblU1BlJRVndXCcnUUnuMmwUWjNsca y+h0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=SZNVmOjoZM1FJPPr4/jd45ZGqzvSJJ8uPm0/9yvdmOTy5WBfZ9jPEHLSjTXFaB 1kgPXKHTgf9UvBMu/nZ6FyAqaKwjwGADheG1EPFJrvhYyJsKMaJkzwdxKKBNtmiz OjjwUILWEJsWGaG5DAkv2KGZJUsX6dCKayMY+jsiueoK8=; Received: (qmail 7000 invoked by alias); 13 Mar 2012 18:42:28 -0000 Received: (qmail 6722 invoked by uid 22791); 13 Mar 2012 18:42:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_ZJ X-Spam-Check-By: sourceware.org Received: from mail-yw0-f47.google.com (HELO mail-yw0-f47.google.com) (209.85.213.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Mar 2012 18:42:12 +0000 Received: by yhjj56 with SMTP id j56so943798yhj.20 for ; Tue, 13 Mar 2012 11:42:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.101.128.23 with SMTP id f23mr5878587ann.9.1331664131496; Tue, 13 Mar 2012 11:42:11 -0700 (PDT) Received: by 10.146.241.18 with HTTP; Tue, 13 Mar 2012 11:42:11 -0700 (PDT) Date: Tue, 13 Mar 2012 19:42:11 +0100 Message-ID: Subject: [PATCH, i386]: Declare constant_call_address_operand as special predicate From: Uros Bizjak To: gcc-patches@gcc.gnu.org Cc: "H.J. Lu" 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 Hello! Similar to tls_symbolic_operand and tls_modbase_operand, we are not interested in the mode of the operand in the predicate. 2012-03-13 Uros Bizjak * config/i386/predicates.md (constant_call_address_operand): Declare as special predicate. Update all uses. * config/i386/i386.md: Remove mode from constant_call_address_operand predicates. * config/i386/i386.c (ix86_output_call_insn): Call constant_call_address_operand with VOIDmode. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 185341) +++ i386.md (working copy) @@ -12592,7 +12592,7 @@ (unspec:SI [(match_operand:SI 1 "register_operand" "b") (match_operand 2 "tls_symbolic_operand" "") - (match_operand:SI 3 "constant_call_address_operand" "z")] + (match_operand 3 "constant_call_address_operand" "z")] UNSPEC_TLS_GD)) (clobber (match_scratch:SI 4 "=d")) (clobber (match_scratch:SI 5 "=c")) @@ -12617,7 +12617,7 @@ [(set (match_operand:SI 0 "register_operand" "") (unspec:SI [(match_operand:SI 2 "register_operand" "") (match_operand 1 "tls_symbolic_operand" "") - (match_operand:SI 3 "constant_call_address_operand" "")] + (match_operand 3 "constant_call_address_operand" "")] UNSPEC_TLS_GD)) (clobber (match_scratch:SI 4 "")) (clobber (match_scratch:SI 5 "")) @@ -12626,8 +12626,8 @@ (define_insn "*tls_global_dynamic_64_" [(set (match_operand:P 0 "register_operand" "=a") (call:P - (mem:QI (match_operand:P 2 "constant_call_address_operand" "z")) - (match_operand:P 3 "" ""))) + (mem:QI (match_operand 2 "constant_call_address_operand" "z")) + (match_operand 3 "" ""))) (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)] "TARGET_64BIT" @@ -12650,7 +12650,7 @@ [(parallel [(set (match_operand:P 0 "register_operand" "") (call:P - (mem:QI (match_operand:P 2 "constant_call_address_operand" "")) + (mem:QI (match_operand 2 "constant_call_address_operand" "")) (const_int 0))) (unspec:P [(match_operand 1 "tls_symbolic_operand" "")] UNSPEC_TLS_GD)])] @@ -12660,7 +12660,7 @@ [(set (match_operand:SI 0 "register_operand" "=a") (unspec:SI [(match_operand:SI 1 "register_operand" "b") - (match_operand:SI 2 "constant_call_address_operand" "z")] + (match_operand 2 "constant_call_address_operand" "z")] UNSPEC_TLS_LD_BASE)) (clobber (match_scratch:SI 3 "=d")) (clobber (match_scratch:SI 4 "=c")) @@ -12685,7 +12685,7 @@ [(set (match_operand:SI 0 "register_operand" "") (unspec:SI [(match_operand:SI 1 "register_operand" "") - (match_operand:SI 2 "constant_call_address_operand" "")] + (match_operand 2 "constant_call_address_operand" "")] UNSPEC_TLS_LD_BASE)) (clobber (match_scratch:SI 3 "")) (clobber (match_scratch:SI 4 "")) @@ -12694,8 +12694,8 @@ (define_insn "*tls_local_dynamic_base_64_" [(set (match_operand:P 0 "register_operand" "=a") (call:P - (mem:QI (match_operand:P 1 "constant_call_address_operand" "z")) - (match_operand:P 2 "" ""))) + (mem:QI (match_operand 1 "constant_call_address_operand" "z")) + (match_operand 2 "" ""))) (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)] "TARGET_64BIT" { @@ -12712,7 +12712,7 @@ [(parallel [(set (match_operand:P 0 "register_operand" "") (call:P - (mem:QI (match_operand:P 1 "constant_call_address_operand" "")) + (mem:QI (match_operand 1 "constant_call_address_operand" "")) (const_int 0))) (unspec:P [(const_int 0)] UNSPEC_TLS_LD_BASE)])] "TARGET_64BIT") @@ -12724,7 +12724,7 @@ [(set (match_operand:SI 0 "register_operand" "=a") (plus:SI (unspec:SI [(match_operand:SI 1 "register_operand" "b") - (match_operand:SI 2 "constant_call_address_operand" "z")] + (match_operand 2 "constant_call_address_operand" "z")] UNSPEC_TLS_LD_BASE) (const:SI (unspec:SI [(match_operand 3 "tls_symbolic_operand" "")] Index: i386.c =================================================================== --- i386.c (revision 185343) +++ i386.c (working copy) @@ -23121,7 +23121,7 @@ const char * ix86_output_call_insn (rtx insn, rtx call_op) { - bool direct_p = constant_call_address_operand (call_op, Pmode); + bool direct_p = constant_call_address_operand (call_op, VOIDmode); bool seh_nop_p = false; const char *xasm; Index: predicates.md =================================================================== --- predicates.md (revision 185341) +++ predicates.md (working copy) @@ -500,7 +500,7 @@ (match_test "op == ix86_tls_module_base ()"))) ;; Test for a pc-relative call operand -(define_predicate "constant_call_address_operand" +(define_special_predicate "constant_call_address_operand" (match_code "symbol_ref") { if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC) @@ -573,16 +573,14 @@ ;; Test for a valid operand for a call instruction. ;; Allow constant call address operands in Pmode only. (define_special_predicate "call_insn_operand" - (ior (match_test "constant_call_address_operand - (op, mode == VOIDmode ? mode : Pmode)") + (ior (match_operand 0 "constant_call_address_operand") (match_operand 0 "call_register_no_elim_operand") (and (not (match_test "TARGET_X32")) (match_operand 0 "memory_operand")))) ;; Similarly, but for tail calls, in which we cannot allow memory references. (define_special_predicate "sibcall_insn_operand" - (ior (match_test "constant_call_address_operand - (op, mode == VOIDmode ? mode : Pmode)") + (ior (match_operand 0 "constant_call_address_operand") (match_operand 0 "register_no_elim_operand"))) ;; Match exactly zero.