From patchwork Tue Mar 18 20:25:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 331532 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AE4ED2C00AC for ; Wed, 19 Mar 2014 07:25:38 +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 :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=pGyWl9pVRsK7f1IcXJ7hl9nrNo08gIBSq/vvZfZiz/U3CV wzIsrbWf0v+8ySxrSM2ZehQAE/M3vvMwFn9hE7bA42vNv7z/8NwZ0bjXexNXSYS5 kVYH+4phe43qFFtNi1DGb8wBsCxPON8E76xM5pDZ4A4G19Gxkf+W0yWkri24g= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=x1vlihwwCQJ/iK5ry446I65gzjU=; b=MSBFmPJnbpTBew2dKo/y Q95m+Jf9NqSI7D8Is47qmerlbThqTlfX87tyAdani+HYMobN2DqgOGuONR4l8Lt7 OygmcVElSZm+iGPaLEuELv0ATbIe1dhgzvjHCORnM9Jkc4XozLsrWXX4eZdKv7fD 4wPER/3ozXh3N/tkAIV28Uc= Received: (qmail 24359 invoked by alias); 18 Mar 2014 20:25:31 -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 24349 invoked by uid 89); 18 Mar 2014 20:25:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Mar 2014 20:25:29 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2IKPQPd028977 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 18 Mar 2014 16:25:27 -0400 Received: from anchor.twiddle.net (vpn-224-145.phx2.redhat.com [10.3.224.145]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s2IKPQ3M004949 for ; Tue, 18 Mar 2014 16:25:26 -0400 Message-ID: <5328ABB5.7040507@redhat.com> Date: Tue, 18 Mar 2014 13:25:25 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Fix target/60562 -- more i387 int->float fallout X-IsSubscribed: yes Brown bag time on this one. While I did build and test both x86_64 and i686 separately, I apparently only missed the regression in test results. Anyway, a simple fix for the problem: don't enable the pattern when it's not supposed to be enabled due to excess precision. Moving the _387 pattern down means that we don't have to repeat the condition on the _sse pattern just above. Two separate patches, because I forgot about the mixed-sse-387 case until after I'd already committed the first patch. Ho hum. r~ PR target/60562 * config/i386/i386.md (*float2_i387): Move down to be shadowed by *float2_sse. Test X87_ENABLE_FLOAT. PR target/60562 * config/i386/i386.md (*float2_sse): Check X87_ENABLE_FLOAT for alternative 0. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index abc22f2..d96f997 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4726,7 +4726,9 @@ (set_attr "fp_int_src" "true") (set (attr "enabled") (cond [(eq_attr "alternative" "0") - (symbol_ref "TARGET_MIX_SSE_I387") + (symbol_ref "TARGET_MIX_SSE_I387 + && X87_ENABLE_FLOAT (mode, + mode)" (eq_attr "alternative" "1") (symbol_ref "TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun)") diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index a824e78..abc22f2 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -4701,15 +4701,6 @@ } }) -(define_insn "*float2_i387" - [(set (match_operand:MODEF 0 "register_operand" "=f") - (float:MODEF (match_operand:SWI48x 1 "nonimmediate_operand" "m")))] - "TARGET_80387 && !(SSE_FLOAT_MODE_P (mode) && TARGET_SSE_MATH)" - "fild%Z1\t%1" - [(set_attr "type" "fmov") - (set_attr "mode" "") - (set_attr "fp_int_src" "true")]) - (define_insn "*float2_sse" [(set (match_operand:MODEF 0 "register_operand" "=f,x,x") (float:MODEF @@ -4743,6 +4734,15 @@ (symbol_ref "true"))) ]) +(define_insn "*float2_i387" + [(set (match_operand:MODEF 0 "register_operand" "=f") + (float:MODEF (match_operand:SWI48x 1 "nonimmediate_operand" "m")))] + "TARGET_80387 && X87_ENABLE_FLOAT (mode, mode)" + "fild%Z1\t%1" + [(set_attr "type" "fmov") + (set_attr "mode" "") + (set_attr "fp_int_src" "true")]) + ;; Try TARGET_USE_VECTOR_CONVERTS, but not so hard as to require extra memory ;; slots when !TARGET_INTER_UNIT_MOVES_TO_VEC disables the general_regs ;; alternative in sse2_loadld.