From patchwork Tue Feb 19 13:49:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1044688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-496638-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="YHmHmDe6"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qE9ZLNfg"; dkim-atps=neutral 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 443htq1Xk2z9s21 for ; Wed, 20 Feb 2019 00:49:54 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=csDCbxbNTTH8fwDj EfE93lx90jdxieoYn7jJDh20D48KIc8Fef/OlsWbZpUGU05zOiAqlFTC+qjdJWSs NatBGI/lLvk2ItAmbZj23tpt3XmilhJ8Y3U+9P1r1rN7JRXEWajtyyJ39hSkEVWv rD6FrdPO0lJvEoBL2LrPcDF9TTY= 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:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=xwm9MENtz6tzNP0iD2IqhM su/GU=; b=YHmHmDe6KTaxvNBSB/r6J2+CFrzvx2cNA0iE9utsowBvt8U8tesgA6 ONCknoJmy2n7hgDpPNpfeXwMQa4hUqgnSUl1RrlATG+R8HUWTcOXkm0hkIajtXJY wVCSe3J7+ezez24v0RqTLhYwW3NAa3H2hyd5d8L2bmMn17vaI4Q+E= Received: (qmail 47188 invoked by alias); 19 Feb 2019 13:49:46 -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 47019 invoked by uid 89); 19 Feb 2019 13:49:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-pl1-f178.google.com Received: from mail-pl1-f178.google.com (HELO mail-pl1-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Feb 2019 13:49:31 +0000 Received: by mail-pl1-f178.google.com with SMTP id d15so3333916plr.1 for ; Tue, 19 Feb 2019 05:49:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=S8yY4u68l6xckohCVqBiNuFgsyyGdwvIcZmrSJDJBn8=; b=qE9ZLNfg9V76JgVSbq/wuxphrZ5STBKqUR3NbsFDfXwFXukHlmUWLqTs0k9B+p6y/+ KGMqzLvvQjMTfssisJZPJfe2t9rB7G+nKFdRrGB04IDQO93GacpZkUNxvWDPnEfWgymF dQBxDE1FgyQA74CDwY6mF9n0T2h7xxupTNhYYBCVuk5ZLyHMbJQVxnMMZcjMWAA7TPhH NfuoCM7oJJweEo26+UAT2fMSoSBauUvPiXC3dMtDKOk8EejeFqsbu5nxVQ1r+WHL29DL BLLRBuqZgy4OIAG3+xIdhf2i4f1ST+hTilG7kK5ljBOTAyz07STZC9/hLPn3EUNyQ5Vg GlJw== Received: from gnu-cfl-2.localdomain (c-73-93-86-59.hsd1.ca.comcast.net. [73.93.86.59]) by smtp.gmail.com with ESMTPSA id 4sm31488529pft.96.2019.02.19.05.49.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Feb 2019 05:49:28 -0800 (PST) Received: from gnu-cfl-2.hsd1.ca.comcast.net (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id DEAEAC0157; Tue, 19 Feb 2019 05:49:27 -0800 (PST) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak Subject: [PATCH] 386: Set ix86_fpmath to FPMATH_387 without SSE Date: Tue, 19 Feb 2019 05:49:27 -0800 Message-Id: <20190219134927.28814-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes ix86_fpmath should be set to combination of FPMATH_387 and FPMATH_SSE. When SSE is disabled, it should be set to FPMATH_387 and 387 codegen is also controlled by -msoft-float. gcc/ PR target/89397 * config/i386/i386.c (ix86_option_override_internal): Set opts->x_ix86_fpmath to FPMATH_387 when SSE is disabled. gcc/testsuite/ PR target/89397 * gcc.target/i386/pr89397.c: New test. --- gcc/config/i386/i386.c | 7 +++---- gcc/testsuite/gcc.target/i386/pr89397.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr89397.c diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 591a7cdccdc..bed17330fa8 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4310,10 +4310,9 @@ ix86_option_override_internal (bool main_args_p, if (!TARGET_SSE_P (opts->x_ix86_isa_flags)) { if (TARGET_80387_P (opts->x_target_flags)) - { - warning (0, "SSE instruction set disabled, using 387 arithmetics"); - opts->x_ix86_fpmath = FPMATH_387; - } + warning (0, "SSE instruction set disabled, using 387 arithmetics"); + /* NB: 387 codegen is guarded by TARGET_80387. */ + opts->x_ix86_fpmath = FPMATH_387; } else if ((opts->x_ix86_fpmath & FPMATH_387) && !TARGET_80387_P (opts->x_target_flags)) diff --git a/gcc/testsuite/gcc.target/i386/pr89397.c b/gcc/testsuite/gcc.target/i386/pr89397.c new file mode 100644 index 00000000000..42afa6c5247 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr89397.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mfpmath=sse,387 -msoft-float -mno-sse" } */ + +_Atomic double a; +int b; + +void +foo (void) +{ + a += b; /* { dg-error "SSE register return with SSE disabled" "" { target { ! ia32 } } } */ +}