From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id 2F2FC3857C5F for ; Wed, 14 Apr 2021 22:39:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2F2FC3857C5F Received: by mail-pj1-x102e.google.com with SMTP id e8-20020a17090a7288b029014e51f5a6baso6273430pjg.2 for ; Wed, 14 Apr 2021 15:39:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6whhnOQ4OufWaxbm0BFK1bqFqxI/qniXgtpJVMq/jes=; b=s1W+gchUEpcFFBXWIZ+L2mGPcnDHwytK33kXZS6oTmIjfpzJpAq9haRjEBDpBxCqAl 1CHePUsFfhIGOehLoNrJYn4VQUM2RmgVyoW2/85IBg3/9exNMajfdWMCDs5qRwGGWuUJ b40Jo14LQsl/XjkzG8a/NwUFJe6QdDsIEvds6IZSV5fYQvIQ8ma8tHAvcB2jvUdibLhC S9VtenfnV9AADEZuq5vcx4R/7YQ1Mcyn5noKW9msFg7+0qdZk728SNKKq0lBX25AX0zL Ax5CSY6QejRXDDxK3SkBaOwTiqmPGlHHRtZLf1IfekVUAcbPQomTu+/Dvhi0v0lXr9BD SrNA== X-Gm-Message-State: AOAM530jVyS76H1P3RYEnXiqxKAiELBYCpU0s4UElkeYoOWPKxmVLWG7 +bVGAZvL/of0//SzH7HODadkEkQQHt9K0w== X-Google-Smtp-Source: ABdhPJwH/f8lR4fF5BRaZ8O1t60MEELRTCwPBHhCHFP528NyQDESZ6q/WtC5r+lXyp1VhMEUL7CyPg== X-Received: by 2002:a17:90a:ad84:: with SMTP id s4mr380038pjq.153.1618439960501; Wed, 14 Apr 2021 15:39:20 -0700 (PDT) Received: from gnu-cfl-2.localdomain ([2607:fb90:a62d:2d5e:38da:e56e:0:c66]) by smtp.gmail.com with ESMTPSA id g24sm344753pfh.164.2021.04.14.15.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 15:39:19 -0700 (PDT) Received: from gnu-cfl-2.lan (localhost [IPv6:::1]) by gnu-cfl-2.localdomain (Postfix) with ESMTP id 9DF361A00E6; Wed, 14 Apr 2021 15:39:18 -0700 (PDT) From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: Uros Bizjak , Jakub Jelinek , Bernhard Reutner-Fischer , Martin Sebor , Richard Biener Subject: [PATCH v4 0/2] x86: Add general_regs_only function attribute Date: Wed, 14 Apr 2021 15:39:16 -0700 Message-Id: <20210414223918.230495-1-hjl.tools@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3029.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 14 Apr 2021 22:39:24 -0000 I realized that commit 87c753ac241f25d222d46ba1ac66ceba89d6a200 Author: H.J. Lu Date: Fri Aug 21 09:42:49 2020 -0700 x86: Add target("general-regs-only") function attribute is incomplete since it is impossible to call integer intrinsics from a function with general-regs-only target attribute. We need to add a general_regs_only function attribute to go with it to mark functions which use only general purpose registers. When making inlining decisions on such functions, x86 backend can exclude non-GPR compiler options. The general_regs_only attribute should be added to all x86 intrinsics which use only general purpose registers. H.J. Lu (2): x86: Move OPTION_MASK_* to i386-common.h x86: Add general_regs_only function attribute gcc/common/config/i386/i386-common.c | 297 ------------------ gcc/common/config/i386/i386-common.h | 315 +++++++++++++++++++ gcc/config/i386/adxintrin.h | 18 +- gcc/config/i386/bmi2intrin.h | 24 +- gcc/config/i386/bmiintrin.h | 92 ++++-- gcc/config/i386/cetintrin.h | 33 +- gcc/config/i386/cldemoteintrin.h | 3 +- gcc/config/i386/clflushoptintrin.h | 3 +- gcc/config/i386/clwbintrin.h | 3 +- gcc/config/i386/clzerointrin.h | 4 +- gcc/config/i386/enqcmdintrin.h | 6 +- gcc/config/i386/fxsrintrin.h | 12 +- gcc/config/i386/hresetintrin.h | 3 +- gcc/config/i386/i386-options.c | 2 + gcc/config/i386/i386.c | 29 +- gcc/config/i386/i386.h | 1 + gcc/config/i386/ia32intrin.h | 82 +++-- gcc/config/i386/lwpintrin.h | 24 +- gcc/config/i386/lzcntintrin.h | 20 +- gcc/config/i386/movdirintrin.h | 9 +- gcc/config/i386/mwaitxintrin.h | 8 +- gcc/config/i386/pconfigintrin.h | 3 +- gcc/config/i386/pkuintrin.h | 6 +- gcc/config/i386/popcntintrin.h | 8 +- gcc/config/i386/rdseedintrin.h | 9 +- gcc/config/i386/rtmintrin.h | 9 +- gcc/config/i386/serializeintrin.h | 8 +- gcc/config/i386/sgxintrin.h | 9 +- gcc/config/i386/tbmintrin.h | 80 +++-- gcc/config/i386/tsxldtrkintrin.h | 6 +- gcc/config/i386/uintrintrin.h | 12 +- gcc/config/i386/waitpkgintrin.h | 9 +- gcc/config/i386/wbnoinvdintrin.h | 3 +- gcc/config/i386/x86gprintrin.h | 45 ++- gcc/config/i386/xsavecintrin.h | 6 +- gcc/config/i386/xsaveintrin.h | 18 +- gcc/config/i386/xsaveoptintrin.h | 6 +- gcc/config/i386/xsavesintrin.h | 12 +- gcc/config/i386/xtestintrin.h | 3 +- gcc/doc/extend.texi | 5 + gcc/testsuite/gcc.target/i386/pr99744-3.c | 13 + gcc/testsuite/gcc.target/i386/pr99744-4.c | 352 ++++++++++++++++++++++ 42 files changed, 1134 insertions(+), 476 deletions(-) create mode 100644 gcc/common/config/i386/i386-common.h create mode 100644 gcc/testsuite/gcc.target/i386/pr99744-3.c create mode 100644 gcc/testsuite/gcc.target/i386/pr99744-4.c -- 2.30.2