From patchwork Mon Mar 25 18:12:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 230946 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 05A9F2C007B for ; Tue, 26 Mar 2013 05:12:47 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=CWNmjuGFh/P/y4uhr9cZ++eIUbhK2/JBLPW3MnUUz5fNH3 hvb/Byf69mYBnYHnD5ksHmUaqWGf59MSFMQ9nBeg5gA7ujJND7vi7olFzf04i4lL yLxRvxRZSxafcuVJNqa37Q/R5F+Q8SPPkZKjo4KKetgGRL8/rzhkHsff8eC0E= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=yEtedJj6EKB9gLGRteCi69B7g4g=; b=LzLt3ra01m1IzHTZg3bc Hg877m4Zr0JnWTsiWH2YQJVkDKayi5dffKMcjVPQ2NbwWeejs+m/c475aFOjOvNa DMeRT/Q6cJXrmYt+JJPM2V2/y1ztCI2L8kMxPjKJRyb0sHxULGcGJzGUtw945pcM InjZRb5Vjf+Xn4/lE8TPwIA= Received: (qmail 25927 invoked by alias); 25 Mar 2013 18:12:34 -0000 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 Received: (qmail 25869 invoked by uid 89); 25 Mar 2013 18:12:26 -0000 Received: from mail-oa0-f50.google.com (HELO mail-oa0-f50.google.com) (209.85.219.50) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 25 Mar 2013 18:12:26 +0000 Received: by mail-oa0-f50.google.com with SMTP id n1so3877413oag.23 for ; Mon, 25 Mar 2013 11:12:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.19.135 with SMTP id f7mr20361obe.95.1364235145121; Mon, 25 Mar 2013 11:12:25 -0700 (PDT) Received: by 10.182.49.68 with HTTP; Mon, 25 Mar 2013 11:12:25 -0700 (PDT) Date: Mon, 25 Mar 2013 19:12:25 +0100 Message-ID: Subject: [PATCH 6/n, i386]: Merge *zero_extendsidi2_rex64 with base pattern using x64 and nox64 isa attribute From: Uros Bizjak To: gcc-patches@gcc.gnu.org X-Virus-Found: No Hello! 2013-03-25 Uros Bizjak * config/i386/i386.md (*zero_extendsidi2): Merge with *zero_extendsidi2_rex64. Use x64 and nox64 isa attributes. * config/i386/predicates.md (x86_64_zext_operand): Rename from x86_64_zext_general_operand. Use nonimmediate_operand on 32bit targets. Clarify comment. Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN. Uros. Index: i386.md =================================================================== --- i386.md (revision 197053) +++ i386.md (working copy) @@ -3135,13 +3135,13 @@ [(set (match_operand:DI 0 "nonimmediate_operand") (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand")))]) -(define_insn "*zero_extendsidi2_rex64" +(define_insn "*zero_extendsidi2" [(set (match_operand:DI 0 "nonimmediate_operand" - "=r ,o,?*Ym,?*y,?*Yi,?*x") + "=r,?r,?o,r ,o,?*Ym,?*y,?*Yi,?*x") (zero_extend:DI - (match_operand:SI 1 "x86_64_zext_general_operand" - "rmWz,0,r ,m ,r ,m")))] - "TARGET_64BIT" + (match_operand:SI 1 "x86_64_zext_operand" + "0 ,rm,r ,rmWz,0,r ,m ,r ,m")))] + "" { switch (get_attr_type (insn)) { @@ -3164,30 +3164,40 @@ gcc_unreachable (); } } - [(set_attr "type" "imovx,multi,mmxmov,mmxmov,ssemov,ssemov") - (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex") - (set_attr "prefix_0f" "0,*,*,*,*,*") - (set_attr "mode" "SI,SI,DI,DI,TI,TI")]) + [(set (attr "isa") + (cond [(eq_attr "alternative" "0,1,2") + (const_string "nox64") + (eq_attr "alternative" "3") + (const_string "x64") + (eq_attr "alternative" "8") + (const_string "sse2") + ] + (const_string "*"))) + (set (attr "type") + (cond [(eq_attr "alternative" "0,1,2,4") + (const_string "multi") + (eq_attr "alternative" "5,6") + (const_string "mmxmov") + (eq_attr "alternative" "7,8") + (const_string "ssemov") + ] + (const_string "imovx"))) + (set (attr "prefix") + (if_then_else (eq_attr "type" "ssemov") + (const_string "maybe_vex") + (const_string "orig"))) + (set (attr "prefix_0f") + (if_then_else (eq_attr "type" "imovx") + (const_string "0") + (const_string "*"))) + (set (attr "mode") + (cond [(eq_attr "alternative" "5,6") + (const_string "DI") + (eq_attr "alternative" "7,8") + (const_string "TI") + ] + (const_string "SI")))]) -(define_insn "*zero_extendsidi2" - [(set (match_operand:DI 0 "nonimmediate_operand" - "=ro,?r,?o,?*Ym,?*y,?*Yi,?*x") - (zero_extend:DI (match_operand:SI 1 "nonimmediate_operand" - "0 ,rm,r ,r ,m ,r ,m")))] - "!TARGET_64BIT" - "@ - # - # - # - movd\t{%1, %0|%0, %1} - movd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1}" - [(set_attr "isa" "*,*,*,*,*,*,sse2") - (set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov") - (set_attr "prefix" "*,*,*,orig,orig,maybe_vex,maybe_vex") - (set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")]) - (define_split [(set (match_operand:DI 0 "memory_operand") (zero_extend:DI (match_operand:SI 1 "memory_operand")))] Index: predicates.md =================================================================== --- predicates.md (revision 197053) +++ predicates.md (working copy) @@ -311,15 +311,15 @@ (match_operand 0 "x86_64_immediate_operand")) (match_operand 0 "general_operand"))) -;; Return true if OP is general operand representable on x86_64 -;; as zero extended constant. This predicate is used in zero-extending -;; conversion operations that require non-VOIDmode immediate operands. -(define_predicate "x86_64_zext_general_operand" +;; Return true if OP is representable on x86_64 as zero-extended operand. +;; This predicate is used in zero-extending conversion operations that +;; require non-VOIDmode immediate operands. +(define_predicate "x86_64_zext_operand" (if_then_else (match_test "TARGET_64BIT") (ior (match_operand 0 "nonimmediate_operand") (and (match_operand 0 "x86_64_zext_immediate_operand") (match_test "GET_MODE (op) != VOIDmode"))) - (match_operand 0 "general_operand"))) + (match_operand 0 "nonimmediate_operand"))) ;; Return true if OP is general operand representable on x86_64 ;; as either sign extended or zero extended constant.