From patchwork Sun Mar 24 18:25:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 230483 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 CA5B52C00AE for ; Mon, 25 Mar 2013 05:25:40 +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=lwkjfZFfCZprp0RICJyATlx3AyAgg4QpC9JOytseQ9s7Lm NjPUi1tX/plEuv5HPKIA1SDzskziIAvYX6DDhymOMBr0w5rspsJzCcwVPzJB8zzN e0xVhftjf6Hlx3u5E6XZsIqZMI1+wO3U4G4mFOybBfwPTF+EEtvWS+qSRQXs8= 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=imCtnYkpmmemo28LSIuU5SNBiUo=; b=NigyyKMMzmenyPJJBZ+e 5CfREHVi0wcBjIzDqXw02P2urtbEiTbNade6JDW5vAXklX+v/0hL8JCiyZsjS48s bo2Em6QxenWTcej+/pFGtSoWiIPumwHovQTFTr5hgJEzBBqpJCjL7TMd3RxyIgo1 bEnitdiM5pp/CtmYJKlGUHA= Received: (qmail 29456 invoked by alias); 24 Mar 2013 18:25:30 -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 29421 invoked by uid 89); 24 Mar 2013 18:25:15 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_OV, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-oa0-f51.google.com (HELO mail-oa0-f51.google.com) (209.85.219.51) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 24 Mar 2013 18:25:12 +0000 Received: by mail-oa0-f51.google.com with SMTP id g12so2380362oah.38 for ; Sun, 24 Mar 2013 11:25:10 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.11.8 with SMTP id m8mr8821170oeb.22.1364149510546; Sun, 24 Mar 2013 11:25:10 -0700 (PDT) Received: by 10.182.49.68 with HTTP; Sun, 24 Mar 2013 11:25:10 -0700 (PDT) Date: Sun, 24 Mar 2013 19:25:10 +0100 Message-ID: Subject: [PATCH 5/n, i386]: Merge *movv2sf_internal and *movv2sf_internal_rex64 with base MMX move pattern From: Uros Bizjak To: gcc-patches@gcc.gnu.org X-Virus-Found: No Hello! 2013-03-24 Uros Bizjak * config/i386/sse.md (mov): Merge with movv2sf expander using MMXMODE mode iterator. (*move_internal): Merge with *movv2sf_internal and *movv2sf_internal_rex64 using MMXMODE mode iterator. Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN. Uros. Index: config/i386/mmx.md =================================================================== --- config/i386/mmx.md (revision 196981) +++ config/i386/mmx.md (working copy) @@ -68,8 +68,8 @@ ;; This is essential for maintaining stable calling conventions. (define_expand "mov" - [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand") - (match_operand:MMXMODEI8 1 "nonimmediate_operand"))] + [(set (match_operand:MMXMODE 0 "nonimmediate_operand") + (match_operand:MMXMODE 1 "nonimmediate_operand"))] "TARGET_MMX" { ix86_expand_vector_move (mode, operands); @@ -77,9 +77,9 @@ }) (define_insn "*mov_internal" - [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" + [(set (match_operand:MMXMODE 0 "nonimmediate_operand" "=r ,o ,r,r ,m ,!?y,!y,!?y,m ,x,x,x,m,*x,*x,*x,m ,r ,Yi,!Ym,*Yi") - (match_operand:MMXMODEI8 1 "vector_move_operand" + (match_operand:MMXMODE 1 "vector_move_operand" "rCo,rC,C,rm,rC,C ,!y,m ,!?y,C,x,m,x,C ,*x,m ,*x,Yi,r ,*Yi,!Ym"))] "TARGET_MMX && !(MEM_P (operands[0]) && MEM_P (operands[1]))" @@ -129,8 +129,9 @@ return "%vmovdqa\t{%1, %0|%0, %1}"; case MODE_V2SF: - gcc_assert (!TARGET_AVX); - return "movlps\t{%1, %0|%0, %1}"; + if (TARGET_AVX && REG_P (operands[0])) + return "vmovlps\t{%1, %0, %0|%0, %0, %1}"; + return "%vmovlps\t{%1, %0|%0, %1}"; case MODE_V4SF: return "%vmovaps\t{%1, %0|%0, %1}"; @@ -181,7 +182,9 @@ (cond [(eq_attr "alternative" "2") (const_string "SI") (eq_attr "alternative" "9,10,13,14") - (cond [(ior (not (match_test "TARGET_SSE2")) + (cond [(match_test "mode == V2SFmode") + (const_string "V4SF") + (ior (not (match_test "TARGET_SSE2")) (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL")) (const_string "V4SF") (match_test "TARGET_AVX") @@ -192,134 +195,18 @@ (const_string "TI")) (and (eq_attr "alternative" "11,12,15,16") - (not (match_test "TARGET_SSE2"))) + (ior (match_test "mode == V2SFmode") + (not (match_test "TARGET_SSE2")))) (const_string "V2SF") ] (const_string "DI")))]) -(define_expand "movv2sf" - [(set (match_operand:V2SF 0 "nonimmediate_operand") - (match_operand:V2SF 1 "nonimmediate_operand"))] - "TARGET_MMX" -{ - ix86_expand_vector_move (V2SFmode, operands); - DONE; -}) - -;; movd instead of movq is required to handle broken assemblers. -(define_insn "*movv2sf_internal_rex64" - [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=rm,r,!?y,!y,!?y,m ,!y,*x,x,x,x,m,r ,Yi") - (match_operand:V2SF 1 "vector_move_operand" - "Cr ,m,C ,!y,m ,!?y,*x,!y,C,x,m,x,Yi,r"))] - "TARGET_64BIT && TARGET_MMX - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - mov{q}\t{%1, %0|%0, %1} - mov{q}\t{%1, %0|%0, %1} - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - %vxorps\t%0, %d0 - %vmovaps\t{%1, %0|%0, %1} - %vmovlps\t{%1, %d0|%d0, %1} - %vmovlps\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1} - %vmovd\t{%1, %0|%0, %1}" - [(set (attr "type") - (cond [(eq_attr "alternative" "0,1") - (const_string "imov") - (eq_attr "alternative" "2") - (const_string "mmx") - (eq_attr "alternative" "3,4,5") - (const_string "mmxmov") - (eq_attr "alternative" "6,7") - (const_string "ssecvt") - (eq_attr "alternative" "9") - (const_string "sselog1") - ] - (const_string "ssemov"))) - (set (attr "unit") - (if_then_else (eq_attr "alternative" "6,7") - (const_string "mmx") - (const_string "*"))) - (set (attr "prefix_rep") - (if_then_else (eq_attr "alternative" "6,7") - (const_string "1") - (const_string "*"))) - (set (attr "length_vex") - (if_then_else - (and (eq_attr "alternative" "12,13") - (match_test "TARGET_AVX")) - (const_string "4") - (const_string "*"))) - (set (attr "prefix") - (if_then_else (eq_attr "alternative" "8,9,10,11,12,13") - (const_string "maybe_vex") - (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) - -(define_insn "*movv2sf_internal" - [(set (match_operand:V2SF 0 "nonimmediate_operand" - "=!?y,!y,!?y,m ,!y,*x,*x,*x,*x,m ,r ,m") - (match_operand:V2SF 1 "vector_move_operand" - "C ,!y,m ,!?y,*x,!y,C ,*x,m ,*x,irm,r"))] - "!TARGET_64BIT && TARGET_MMX - && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - pxor\t%0, %0 - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movq\t{%1, %0|%0, %1} - movdq2q\t{%1, %0|%0, %1} - movq2dq\t{%1, %0|%0, %1} - %vxorps\t%0, %d0 - %vmovaps\t{%1, %0|%0, %1} - %vmovlps\t{%1, %d0|%d0, %1} - %vmovlps\t{%1, %0|%0, %1} - # - #" - [(set (attr "isa") - (if_then_else (eq_attr "alternative" "4,5") - (const_string "sse2") - (const_string "*"))) - (set (attr "type") - (cond [(eq_attr "alternative" "0") - (const_string "mmx") - (eq_attr "alternative" "1,2,3") - (const_string "mmxmov") - (eq_attr "alternative" "4,5") - (const_string "ssecvt") - (eq_attr "alternative" "6") - (const_string "sselog1") - (eq_attr "alternative" "10,11") - (const_string "multi") - ] - (const_string "ssemov"))) - (set (attr "unit") - (if_then_else (eq_attr "alternative" "4,5") - (const_string "mmx") - (const_string "*"))) - (set (attr "prefix_rep") - (if_then_else (eq_attr "alternative" "4,5") - (const_string "1") - (const_string "*"))) - (set (attr "prefix") - (if_then_else (eq_attr "alternative" "6,7,8,9") - (const_string "maybe_vex") - (const_string "orig"))) - (set_attr "mode" "DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")]) - -;; %%% This multiword shite has got to go. (define_split [(set (match_operand:MMXMODE 0 "nonimmediate_operand") (match_operand:MMXMODE 1 "general_operand"))] "!TARGET_64BIT && reload_completed - && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0]) - || MMX_REG_P (operands[1]) || SSE_REG_P (operands[1]))" + && !(MMX_REG_P (operands[0]) || SSE_REG_P (operands[0])) + && !(MMX_REG_P (operands[1]) || SSE_REG_P (operands[1]))" [(const_int 0)] "ix86_split_long_move (operands); DONE;")