From patchwork Mon Mar 14 14:31:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 1605110 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=L01R80tj; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KHJry0LcNz9sGP for ; Tue, 15 Mar 2022 01:32:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6B957385E036 for ; Mon, 14 Mar 2022 14:31:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B957385E036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1647268317; bh=LleOzqjfi2j6QsRvEFg1VAdtb2viS8Uwlb2hH8+no5Y=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=L01R80tjw55A1siVttWwr+htHiUJnep2s/l5hqnX6byHolI/l4YzyZcoc3z2Xv9O3 MbNMwCp+sDr7RL0LcjOT1ARHEiq4/3zpiRkOGLYETfZpsAAQYTR8VXEn/V0sYz1meg HrRMhWdiEOjFtDEJcVf2+7KQz/fBL7DCjk5G+MHI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 0E6C73898C73 for ; Mon, 14 Mar 2022 14:31:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E6C73898C73 Received: by mail-pg1-x530.google.com with SMTP id t187so13988252pgb.1 for ; Mon, 14 Mar 2022 07:31:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LleOzqjfi2j6QsRvEFg1VAdtb2viS8Uwlb2hH8+no5Y=; b=bTo8ym5tlCwBXdTuexP9oz9X7mAB56zrwhh7rbVwC4Tiu6f5RNzCCJCax7RN2iTIwm Mm6B3NIpd1Qj4mA4g/8UxFEZsw22UyIOeJP+WgDgkZWfW3seDfGZ29eU18Ac+gfyandU D8PCDIwq3aUZEhSjr+LHMdG+EghULQ2t0gM47IaXIXiyp7wVylP7ErAkzwEnf76yhXHE OBG3+HxIVzkZXx2jkrIo9PtqdegdmtD73QATroI+OB5WmTjKbHbjDD7qpOt4SLytQrmh Xeu9yysIfzI+7kXfmA8HBzQdz4nEs4cVspkBVPe9020uidQ0w4pKWtqWdw0I5L6W51CA Yfqw== X-Gm-Message-State: AOAM53337GMolk7LQvhKyKTejsildgCYr2cHy3peiMpbpa3oTVWpG4a4 U/I59302H/EyH4nTwffTqrzNUQzFzeY= X-Google-Smtp-Source: ABdhPJx5rEWva8PE6OdHwLyEBJlr+LCfiNp7HGm0XB4z5e8N0mAXV0c283OCEVhkLEHvWd/3VkzO3w== X-Received: by 2002:a65:63d6:0:b0:375:7cc6:2b63 with SMTP id n22-20020a6563d6000000b003757cc62b63mr20081421pgv.598.1647268278809; Mon, 14 Mar 2022 07:31:18 -0700 (PDT) Received: from gnu-tgl-3.localdomain ([172.58.35.176]) by smtp.gmail.com with ESMTPSA id w17-20020a056a0014d100b004f79bb37b54sm10922839pfu.195.2022.03.14.07.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Mar 2022 07:31:18 -0700 (PDT) Received: from gnu-tgl-3.. (localhost [IPv6:::1]) by gnu-tgl-3.localdomain (Postfix) with ESMTP id 47C85C0461; Mon, 14 Mar 2022 07:31:17 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [PATCH v2] x86: Also check _SOFT_FLOAT in Date: Mon, 14 Mar 2022 07:31:17 -0700 Message-Id: <20220314143117.1253752-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3029.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: Matthias Klose Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Push target("general-regs-only") in if x87 is enabled. gcc/ PR target/104890 * config/i386/x86gprintrin.h: Also check _SOFT_FLOAT before pushing target("general-regs-only"). gcc/testsuite/ PR target/104890 * gcc.target/i386/pr104890.c: New test. --- gcc/config/i386/x86gprintrin.h | 2 +- gcc/testsuite/gcc.target/i386/pr104890.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr104890.c diff --git a/gcc/config/i386/x86gprintrin.h b/gcc/config/i386/x86gprintrin.h index 017ec299793..e0be01d5e78 100644 --- a/gcc/config/i386/x86gprintrin.h +++ b/gcc/config/i386/x86gprintrin.h @@ -24,7 +24,7 @@ #ifndef _X86GPRINTRIN_H_INCLUDED #define _X86GPRINTRIN_H_INCLUDED -#if defined __MMX__ || defined __SSE__ +#if !defined _SOFT_FLOAT || defined __MMX__ || defined __SSE__ #pragma GCC push_options #pragma GCC target("general-regs-only") #define __DISABLE_GENERAL_REGS_ONLY__ diff --git a/gcc/testsuite/gcc.target/i386/pr104890.c b/gcc/testsuite/gcc.target/i386/pr104890.c new file mode 100644 index 00000000000..cb430eef688 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr104890.c @@ -0,0 +1,11 @@ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -mshstk -march=i686" } */ + +#include + +__attribute__((target ("general-regs-only"))) +int +foo () +{ + return _get_ssp (); +}