From patchwork Wed May 22 12:18:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 245598 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 AA1A52C00A3 for ; Wed, 22 May 2013 22:18:17 +1000 (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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; q=dns; s=default; b=kbYsh+OuwQ/evhFek5 Zg20lW0nOqMGZruZ8j5lT79Bzs8qTQ+zSN9Ox9AkDNhyEdxLQvB52cU/2WmT0kvk C9O8UfNerAnvIwLiAzryVPkKO72uJlBenTpRPZRmrkBN+z+j+1Pvkm4HPvR07sb/ Pd7Xl8JPbmMLRZbXsAvaioUAs= 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:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; s=default; bh=o0gOpoptAlGS5Ta4ztCQBkpr T0s=; b=oROLwdp5hmoDDFlD0buL5AI9JQFdaJLJIDI0D7s3TPVtoiNjT+k0fBHv cvKnmSYPi9slrcXaNF2e08YQLWWqbOQiRQTGmeQJkczU3pFJXcWj9LM7u2i6XAWN nswwzPp1lRn4rtioh9BAldJA0Q3joJpJOruH2Mpy/DGoynETuxY= Received: (qmail 15295 invoked by alias); 22 May 2013 12:18:10 -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 15284 invoked by uid 89); 22 May 2013 12:18:10 -0000 X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KHOP_THREADED, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, SPF_PASS, TW_ZJ autolearn=ham version=3.3.1 Received: from mail-da0-f41.google.com (HELO mail-da0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 22 May 2013 12:18:09 +0000 Received: by mail-da0-f41.google.com with SMTP id y19so1124077dan.14 for ; Wed, 22 May 2013 05:18:08 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.66.163.232 with SMTP id yl8mr8009547pab.104.1369225087882; Wed, 22 May 2013 05:18:07 -0700 (PDT) Received: by 10.70.2.164 with HTTP; Wed, 22 May 2013 05:18:07 -0700 (PDT) In-Reply-To: References: <20130522075519.GD1377@tucnak.redhat.com> Date: Wed, 22 May 2013 14:18:07 +0200 Message-ID: Subject: Re: [4.8 PATCH, i386]: Fix PR 57356, SSE2 instructions generated with '-mno-sse2' From: Uros Bizjak To: Jakub Jelinek Cc: "gcc-patches@gcc.gnu.org" X-Virus-Found: No On Wed, May 22, 2013 at 10:01 AM, Uros Bizjak wrote: >>> This patch avoids movdqu/movdqa when SSE2 is disabled. Although >>> -mno-sse2 is bordering on ABI violation for 64bit targets, the patch >>> is simple enough to fix movti_internal_rex64 pattern. >> >> If the TImode attr variant isn't valid for !SSE2, I'd find it clearer >> to do >> (match_test "!TARGET_SSE2") (const_string "V4SF") >> much earlier in the cond, before TARGET_AVX case that returns TImode >> (sure, when TARGET_AVX is true, then !TARGET_SSE2 is false), and >> not added using ior to an unrelated condition. > > Yes, this is a good suggestion, I was trying to be consistent with the > movti_internal pattern. > > I will change both in the way you suggested ASAP. I have committed attached patch to 4.8 branch. Uros. Index: config/i386/i386.md =================================================================== --- config/i386/i386.md (revision 199189) +++ config/i386/i386.md (working copy) @@ -1798,6 +1798,8 @@ (set (attr "mode") (cond [(eq_attr "alternative" "0,1") (const_string "DI") + (not (match_test "TARGET_SSE2")) + (const_string "V4SF") (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL") (const_string "V4SF") (and (eq_attr "alternative" "4") @@ -1854,15 +1856,16 @@ [(set_attr "type" "sselog1,ssemov,ssemov") (set_attr "prefix" "maybe_vex") (set (attr "mode") - (cond [(match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL") + (cond [(not (match_test "TARGET_SSE2")) + (const_string "V4SF") + (match_test "TARGET_SSE_PACKED_SINGLE_INSN_OPTIMAL") (const_string "V4SF") (and (eq_attr "alternative" "2") (match_test "TARGET_SSE_TYPELESS_STORES")) (const_string "V4SF") (match_test "TARGET_AVX") (const_string "TI") - (ior (not (match_test "TARGET_SSE2")) - (match_test "optimize_function_for_size_p (cfun)")) + (match_test "optimize_function_for_size_p (cfun)") (const_string "V4SF") ] (const_string "TI")))])