From patchwork Thu Sep 7 02:17:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 137603 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2691805vqo; Wed, 6 Sep 2023 19:18:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUmfR6jkvLCh0D6wsmlxRPlacr0gbavtCWpcSD3TYUjHFJ6kpVrsUWEfPOcVt5vCQk9Rjo X-Received: by 2002:a19:ae13:0:b0:500:a60d:c677 with SMTP id f19-20020a19ae13000000b00500a60dc677mr3429657lfc.59.1694053130388; Wed, 06 Sep 2023 19:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694053130; cv=none; d=google.com; s=arc-20160816; b=04/f0Dxc7V4Mz2RHxhdTtk5EBMTLBlEKc6eeZmVdgitCuRouO4RWPXIi0k96hNxjIY gc2XjATjNEDu8ykX3evpEtQr8AhLTM2/oSnuYBTMuDf/sQM1GgXiMT/Q3OY8Ji55u/O9 BxECgknbNuIcM/QsyAq07KAWIBPOSqWdUpKRy3PGLEpjvbL/Ro02Loblx6awc8uVINC7 yVwfYAvnSMFRNDPi/eiyZGVogPmeY8NXY3GAAGo1cb/aCgS+3YQ7hoPLqFTP2TXTHItY HYu4XMlVhqU6pqp2MVdsA/7UfJ9LPcsnFho1TOG1uChahCePOoHxZ6UWFmp1H8+ASjv6 aRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=M21h9VyQLTHlLGooPPy6AAL7cWnEj6aRjsa6j9dHBJc=; fh=HKgiOHUFLyfVG2npWMLYE8/3Ecp4EiEdadhQOzpm3aI=; b=Mf8dvlyZ7muYHcPRYWKNkYrejmXIl6la64NDjby++Jvy+JVbJkgmzL3Kjb8X7GRKl3 c7EPxrqYUGKMNndWibEjxkZXe44SnN4sbBp9G5P/F6jUtXQcOEk6dgkVw89Tjk2A5qsh FoorM9uQihiQOdRzdjSVXk31/u6/T50p80jIHNfH8C1DSGq7hgcBfy23lad1RvmJQKV+ 5Ac3/gFGGyQQTYB/KOphwm2F99wzaoDAKjMdgx+1RrjgQ4IkG1/pqSGx31SehS8wFaFD bLSPaKwW/04lD0QM+kaHCAdx3B9SCdKSWnQlLWGEgIT2xnhm85fFrcvo89WAHsqWJOnX RdWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IPwbhHpt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f13-20020a056402194d00b005221f3c3f0dsi7181748edz.577.2023.09.06.19.18.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 19:18:50 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=IPwbhHpt; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E0E03854826 for ; Thu, 7 Sep 2023 02:18:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E0E03854826 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694053093; bh=M21h9VyQLTHlLGooPPy6AAL7cWnEj6aRjsa6j9dHBJc=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=IPwbhHptDo6IsTuk5ma7K56nVRKRoae6uQAqT0wp8xALI+qhKB++78BQ2I7S2sDXg jFTTqYzzzSl7rZqmxu/Y4DPbZliaAV3NgsdaNNPHBiGvLp3nztleqjj9gg+Jegka/4 4Vfl+axA9wajS06+r4toS1qUTP8I2TNA/KRr2gJw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id D8C4C385842A for ; Thu, 7 Sep 2023 02:17:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D8C4C385842A Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 14BF5300089; Thu, 7 Sep 2023 02:17:21 +0000 (UTC) To: Tsukasa OI , Kito Cheng , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [RFC PATCH 1/2] RISC-V: Make bit manipulation value / round number and shift amount types for builtins unsigned Date: Thu, 7 Sep 2023 02:17:01 +0000 Message-ID: <3cd2b31959d83e13803f993da85fa67728d609fe.1694053004.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_MANYTO, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, UPPERCASE_50_75 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Gcc-patches From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776343455539279926 X-GMAIL-MSGID: 1776343455539279926 From: Tsukasa OI For bit manipulation operations, inputs and the manipulated output are better to be unsigned like other target-independent builtins like __builtin_bswap32 and __builtin_popcount. Although this is not completely compatible as before (as the type changes), most code will run normally, even without warnings (with -Wall -Wextra). Round numbers and shift amount on the scalar crypto instructions are changed to unsigned in parity with LLVM 17 commit 599421ae36c3 ("[RISCV] Use unsigned instead of signed types for Zk* and Zb* builtins."). gcc/ChangeLog: * config/riscv/riscv-builtins.cc (RISCV_ATYPE_UQI): New for uint8_t. (RISCV_ATYPE_UHI): New for uint16_t. (RISCV_ATYPE_QI, RISCV_ATYPE_HI, RISCV_ATYPE_SI, RISCV_ATYPE_DI): Removed as no longer used. (RISCV_ATYPE_UDI): New for uint64_t. * config/riscv/riscv-cmo.def: Make types unsigned for not working "zicbop_cbo_prefetchi" and working bit manipulation clmul builtin argument/return types. * config/riscv/riscv-ftypes.def: Make bit manipulation, round number and shift amount types unsigned. * config/riscv/riscv-scalar-crypto.def: Ditto. --- gcc/config/riscv/riscv-builtins.cc | 7 +- gcc/config/riscv/riscv-cmo.def | 16 ++-- gcc/config/riscv/riscv-ftypes.def | 24 +++--- gcc/config/riscv/riscv-scalar-crypto.def | 104 +++++++++++------------ 4 files changed, 75 insertions(+), 76 deletions(-) diff --git a/gcc/config/riscv/riscv-builtins.cc b/gcc/config/riscv/riscv-builtins.cc index 8afe7b7e97d3..f6b06b3c16ac 100644 --- a/gcc/config/riscv/riscv-builtins.cc +++ b/gcc/config/riscv/riscv-builtins.cc @@ -155,11 +155,10 @@ AVAIL (hint_pause, (!0)) /* Argument types. */ #define RISCV_ATYPE_VOID void_type_node +#define RISCV_ATYPE_UQI unsigned_intQI_type_node +#define RISCV_ATYPE_UHI unsigned_intHI_type_node #define RISCV_ATYPE_USI unsigned_intSI_type_node -#define RISCV_ATYPE_QI intQI_type_node -#define RISCV_ATYPE_HI intHI_type_node -#define RISCV_ATYPE_SI intSI_type_node -#define RISCV_ATYPE_DI intDI_type_node +#define RISCV_ATYPE_UDI unsigned_intDI_type_node #define RISCV_ATYPE_VOID_PTR ptr_type_node /* RISCV_FTYPE_ATYPESN takes N RISCV_FTYPES-like type codes and lists diff --git a/gcc/config/riscv/riscv-cmo.def b/gcc/config/riscv/riscv-cmo.def index b92044dc6ff9..ff713b78e19e 100644 --- a/gcc/config/riscv/riscv-cmo.def +++ b/gcc/config/riscv/riscv-cmo.def @@ -13,15 +13,15 @@ RISCV_BUILTIN (zero_si, "zicboz_cbo_zero", RISCV_BUILTIN_DIRECT_NO_TARGET, RISCV RISCV_BUILTIN (zero_di, "zicboz_cbo_zero", RISCV_BUILTIN_DIRECT_NO_TARGET, RISCV_VOID_FTYPE_VOID_PTR, zero64), // zicbop -RISCV_BUILTIN (prefetchi_si, "zicbop_cbo_prefetchi", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, prefetchi32), -RISCV_BUILTIN (prefetchi_di, "zicbop_cbo_prefetchi", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, prefetchi64), +RISCV_BUILTIN (prefetchi_si, "zicbop_cbo_prefetchi", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, prefetchi32), +RISCV_BUILTIN (prefetchi_di, "zicbop_cbo_prefetchi", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, prefetchi64), // zbkc or zbc -RISCV_BUILTIN (clmul_si, "clmul", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI, clmul_zbkc32_or_zbc32), -RISCV_BUILTIN (clmul_di, "clmul", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI, clmul_zbkc64_or_zbc64), -RISCV_BUILTIN (clmulh_si, "clmulh", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI, clmul_zbkc32_or_zbc32), -RISCV_BUILTIN (clmulh_di, "clmulh", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI, clmul_zbkc64_or_zbc64), +RISCV_BUILTIN (clmul_si, "clmul", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI, clmul_zbkc32_or_zbc32), +RISCV_BUILTIN (clmul_di, "clmul", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI, clmul_zbkc64_or_zbc64), +RISCV_BUILTIN (clmulh_si, "clmulh", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI, clmul_zbkc32_or_zbc32), +RISCV_BUILTIN (clmulh_di, "clmulh", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI, clmul_zbkc64_or_zbc64), // zbc -RISCV_BUILTIN (clmulr_si, "clmulr", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI, clmulr_zbc32), -RISCV_BUILTIN (clmulr_di, "clmulr", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI, clmulr_zbc64), +RISCV_BUILTIN (clmulr_si, "clmulr", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI, clmulr_zbc32), +RISCV_BUILTIN (clmulr_di, "clmulr", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI, clmulr_zbc64), diff --git a/gcc/config/riscv/riscv-ftypes.def b/gcc/config/riscv/riscv-ftypes.def index 3b518195a29c..366861ce640e 100644 --- a/gcc/config/riscv/riscv-ftypes.def +++ b/gcc/config/riscv/riscv-ftypes.def @@ -30,15 +30,15 @@ DEF_RISCV_FTYPE (0, (USI)) DEF_RISCV_FTYPE (0, (VOID)) DEF_RISCV_FTYPE (1, (VOID, USI)) DEF_RISCV_FTYPE (1, (VOID, VOID_PTR)) -DEF_RISCV_FTYPE (1, (SI, SI)) -DEF_RISCV_FTYPE (1, (DI, DI)) -DEF_RISCV_FTYPE (2, (SI, QI, QI)) -DEF_RISCV_FTYPE (2, (SI, HI, HI)) -DEF_RISCV_FTYPE (2, (SI, SI, SI)) -DEF_RISCV_FTYPE (2, (DI, QI, QI)) -DEF_RISCV_FTYPE (2, (DI, HI, HI)) -DEF_RISCV_FTYPE (2, (DI, SI, SI)) -DEF_RISCV_FTYPE (2, (DI, DI, SI)) -DEF_RISCV_FTYPE (2, (DI, DI, DI)) -DEF_RISCV_FTYPE (3, (SI, SI, SI, SI)) -DEF_RISCV_FTYPE (3, (DI, DI, DI, SI)) +DEF_RISCV_FTYPE (1, (USI, USI)) +DEF_RISCV_FTYPE (1, (UDI, UDI)) +DEF_RISCV_FTYPE (2, (USI, UQI, UQI)) +DEF_RISCV_FTYPE (2, (USI, UHI, UHI)) +DEF_RISCV_FTYPE (2, (USI, USI, USI)) +DEF_RISCV_FTYPE (2, (UDI, UQI, UQI)) +DEF_RISCV_FTYPE (2, (UDI, UHI, UHI)) +DEF_RISCV_FTYPE (2, (UDI, USI, USI)) +DEF_RISCV_FTYPE (2, (UDI, UDI, USI)) +DEF_RISCV_FTYPE (2, (UDI, UDI, UDI)) +DEF_RISCV_FTYPE (3, (USI, USI, USI, USI)) +DEF_RISCV_FTYPE (3, (UDI, UDI, UDI, USI)) diff --git a/gcc/config/riscv/riscv-scalar-crypto.def b/gcc/config/riscv/riscv-scalar-crypto.def index c2caed5151db..db86ec9fd78a 100644 --- a/gcc/config/riscv/riscv-scalar-crypto.def +++ b/gcc/config/riscv/riscv-scalar-crypto.def @@ -18,71 +18,71 @@ along with GCC; see the file COPYING3. If not see . */ // ZBKB -RISCV_BUILTIN (pack_sihi, "pack", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_HI_HI, crypto_zbkb32), -RISCV_BUILTIN (pack_disi, "pack", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_SI_SI, crypto_zbkb64), +RISCV_BUILTIN (pack_sihi, "pack", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_UHI_UHI, crypto_zbkb32), +RISCV_BUILTIN (pack_disi, "pack", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_USI_USI, crypto_zbkb64), -RISCV_BUILTIN (packh_si, "packh", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_QI_QI, crypto_zbkb32), -RISCV_BUILTIN (packh_di, "packh", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_QI_QI, crypto_zbkb64), +RISCV_BUILTIN (packh_si, "packh", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_UQI_UQI, crypto_zbkb32), +RISCV_BUILTIN (packh_di, "packh", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UQI_UQI, crypto_zbkb64), -RISCV_BUILTIN (packw, "packw", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_HI_HI, crypto_zbkb64), +RISCV_BUILTIN (packw, "packw", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UHI_UHI, crypto_zbkb64), -RISCV_BUILTIN (zip, "zip", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zbkb32), -RISCV_BUILTIN (unzip, "unzip", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zbkb32), +RISCV_BUILTIN (zip, "zip", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zbkb32), +RISCV_BUILTIN (unzip, "unzip", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zbkb32), -RISCV_BUILTIN (brev8_si, "brev8", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zbkb32), -RISCV_BUILTIN (brev8_di, "brev8", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zbkb64), +RISCV_BUILTIN (brev8_si, "brev8", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zbkb32), +RISCV_BUILTIN (brev8_di, "brev8", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zbkb64), // ZBKX -RISCV_BUILTIN (xperm4_si, "xperm4", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI, crypto_zbkx32), -RISCV_BUILTIN (xperm4_di, "xperm4", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI, crypto_zbkx64), -RISCV_BUILTIN (xperm8_si, "xperm8", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI, crypto_zbkx32), -RISCV_BUILTIN (xperm8_di, "xperm8", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI, crypto_zbkx64), +RISCV_BUILTIN (xperm4_si, "xperm4", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI, crypto_zbkx32), +RISCV_BUILTIN (xperm4_di, "xperm4", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI, crypto_zbkx64), +RISCV_BUILTIN (xperm8_si, "xperm8", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI, crypto_zbkx32), +RISCV_BUILTIN (xperm8_di, "xperm8", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI, crypto_zbkx64), // ZKND -DIRECT_BUILTIN (aes32dsi, RISCV_SI_FTYPE_SI_SI_SI, crypto_zknd32), -DIRECT_BUILTIN (aes32dsmi, RISCV_SI_FTYPE_SI_SI_SI, crypto_zknd32), -DIRECT_BUILTIN (aes64ds, RISCV_DI_FTYPE_DI_DI, crypto_zknd64), -DIRECT_BUILTIN (aes64dsm, RISCV_DI_FTYPE_DI_DI, crypto_zknd64), -DIRECT_BUILTIN (aes64im, RISCV_DI_FTYPE_DI, crypto_zknd64), -DIRECT_BUILTIN (aes64ks1i, RISCV_DI_FTYPE_DI_SI, crypto_zkne_or_zknd), -DIRECT_BUILTIN (aes64ks2, RISCV_DI_FTYPE_DI_DI, crypto_zkne_or_zknd), +DIRECT_BUILTIN (aes32dsi, RISCV_USI_FTYPE_USI_USI_USI, crypto_zknd32), +DIRECT_BUILTIN (aes32dsmi, RISCV_USI_FTYPE_USI_USI_USI, crypto_zknd32), +DIRECT_BUILTIN (aes64ds, RISCV_UDI_FTYPE_UDI_UDI, crypto_zknd64), +DIRECT_BUILTIN (aes64dsm, RISCV_UDI_FTYPE_UDI_UDI, crypto_zknd64), +DIRECT_BUILTIN (aes64im, RISCV_UDI_FTYPE_UDI, crypto_zknd64), +DIRECT_BUILTIN (aes64ks1i, RISCV_UDI_FTYPE_UDI_USI, crypto_zkne_or_zknd), +DIRECT_BUILTIN (aes64ks2, RISCV_UDI_FTYPE_UDI_UDI, crypto_zkne_or_zknd), // ZKNE -DIRECT_BUILTIN (aes32esi, RISCV_SI_FTYPE_SI_SI_SI, crypto_zkne32), -DIRECT_BUILTIN (aes32esmi, RISCV_SI_FTYPE_SI_SI_SI, crypto_zkne32), -DIRECT_BUILTIN (aes64es, RISCV_DI_FTYPE_DI_DI, crypto_zkne64), -DIRECT_BUILTIN (aes64esm, RISCV_DI_FTYPE_DI_DI, crypto_zkne64), +DIRECT_BUILTIN (aes32esi, RISCV_USI_FTYPE_USI_USI_USI, crypto_zkne32), +DIRECT_BUILTIN (aes32esmi, RISCV_USI_FTYPE_USI_USI_USI, crypto_zkne32), +DIRECT_BUILTIN (aes64es, RISCV_UDI_FTYPE_UDI_UDI, crypto_zkne64), +DIRECT_BUILTIN (aes64esm, RISCV_UDI_FTYPE_UDI_UDI, crypto_zkne64), // ZKNH -RISCV_BUILTIN (sha256sig0_si, "sha256sig0", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zknh32), -RISCV_BUILTIN (sha256sig0_di, "sha256sig0", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zknh64), -RISCV_BUILTIN (sha256sig1_si, "sha256sig1", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zknh32), -RISCV_BUILTIN (sha256sig1_di, "sha256sig1", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zknh64), -RISCV_BUILTIN (sha256sum0_si, "sha256sum0", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zknh32), -RISCV_BUILTIN (sha256sum0_di, "sha256sum0", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zknh64), -RISCV_BUILTIN (sha256sum1_si, "sha256sum1", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zknh32), -RISCV_BUILTIN (sha256sum1_di, "sha256sum1", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zknh64), - -DIRECT_BUILTIN (sha512sig0h, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), -DIRECT_BUILTIN (sha512sig0l, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), -DIRECT_BUILTIN (sha512sig1h, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), -DIRECT_BUILTIN (sha512sig1l, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), -DIRECT_BUILTIN (sha512sum0r, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), -DIRECT_BUILTIN (sha512sum1r, RISCV_SI_FTYPE_SI_SI, crypto_zknh32), - -DIRECT_BUILTIN (sha512sig0, RISCV_DI_FTYPE_DI, crypto_zknh64), -DIRECT_BUILTIN (sha512sig1, RISCV_DI_FTYPE_DI, crypto_zknh64), -DIRECT_BUILTIN (sha512sum0, RISCV_DI_FTYPE_DI, crypto_zknh64), -DIRECT_BUILTIN (sha512sum1, RISCV_DI_FTYPE_DI, crypto_zknh64), +RISCV_BUILTIN (sha256sig0_si, "sha256sig0", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zknh32), +RISCV_BUILTIN (sha256sig0_di, "sha256sig0", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +RISCV_BUILTIN (sha256sig1_si, "sha256sig1", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zknh32), +RISCV_BUILTIN (sha256sig1_di, "sha256sig1", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +RISCV_BUILTIN (sha256sum0_si, "sha256sum0", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zknh32), +RISCV_BUILTIN (sha256sum0_di, "sha256sum0", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +RISCV_BUILTIN (sha256sum1_si, "sha256sum1", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zknh32), +RISCV_BUILTIN (sha256sum1_di, "sha256sum1", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zknh64), + +DIRECT_BUILTIN (sha512sig0h, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), +DIRECT_BUILTIN (sha512sig0l, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), +DIRECT_BUILTIN (sha512sig1h, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), +DIRECT_BUILTIN (sha512sig1l, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), +DIRECT_BUILTIN (sha512sum0r, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), +DIRECT_BUILTIN (sha512sum1r, RISCV_USI_FTYPE_USI_USI, crypto_zknh32), + +DIRECT_BUILTIN (sha512sig0, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +DIRECT_BUILTIN (sha512sig1, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +DIRECT_BUILTIN (sha512sum0, RISCV_UDI_FTYPE_UDI, crypto_zknh64), +DIRECT_BUILTIN (sha512sum1, RISCV_UDI_FTYPE_UDI, crypto_zknh64), // ZKSH -RISCV_BUILTIN (sm3p0_si, "sm3p0", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zksh32), -RISCV_BUILTIN (sm3p0_di, "sm3p0", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zksh64), -RISCV_BUILTIN (sm3p1_si, "sm3p1", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI, crypto_zksh32), -RISCV_BUILTIN (sm3p1_di, "sm3p1", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI, crypto_zksh64), +RISCV_BUILTIN (sm3p0_si, "sm3p0", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zksh32), +RISCV_BUILTIN (sm3p0_di, "sm3p0", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zksh64), +RISCV_BUILTIN (sm3p1_si, "sm3p1", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI, crypto_zksh32), +RISCV_BUILTIN (sm3p1_di, "sm3p1", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI, crypto_zksh64), // ZKSED -RISCV_BUILTIN (sm4ed_si, "sm4ed", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI_SI, crypto_zksed32), -RISCV_BUILTIN (sm4ed_di, "sm4ed", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI_SI, crypto_zksed64), -RISCV_BUILTIN (sm4ks_si, "sm4ks", RISCV_BUILTIN_DIRECT, RISCV_SI_FTYPE_SI_SI_SI, crypto_zksed32), -RISCV_BUILTIN (sm4ks_di, "sm4ks", RISCV_BUILTIN_DIRECT, RISCV_DI_FTYPE_DI_DI_SI, crypto_zksed64), +RISCV_BUILTIN (sm4ed_si, "sm4ed", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI_USI, crypto_zksed32), +RISCV_BUILTIN (sm4ed_di, "sm4ed", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI_USI, crypto_zksed64), +RISCV_BUILTIN (sm4ks_si, "sm4ks", RISCV_BUILTIN_DIRECT, RISCV_USI_FTYPE_USI_USI_USI, crypto_zksed32), +RISCV_BUILTIN (sm4ks_di, "sm4ks", RISCV_BUILTIN_DIRECT, RISCV_UDI_FTYPE_UDI_UDI_USI, crypto_zksed64), From patchwork Thu Sep 7 02:17:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 137604 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2691916vqo; Wed, 6 Sep 2023 19:19:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGVdXobIltsYdVZL2SjJYcWGOvJ930wyobseeV0wcJuZL86l9NYsBALIP03z1sDWAzZ25DG X-Received: by 2002:a17:906:3158:b0:9a9:e53d:5d59 with SMTP id e24-20020a170906315800b009a9e53d5d59mr74230eje.25.1694053151357; Wed, 06 Sep 2023 19:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694053151; cv=none; d=google.com; s=arc-20160816; b=iYyrCiHQKoZrQNOnWtrKeBpe7r7MsHSpTQRgDk8W0561GH7VniZ/NYyfYcgkCEU/KB o944SuK2o+TiHX8/Im5+fcNRww0FNJxlXBaNFnYlHP9a4UhrNpirbovlckVlnC+If6Mt nViUE9nea0JzipEmOOjGSg63GGl7gdOzFfyQWxSxBcfCfs7FdzgL/U1UM5PyBK6pFpiY kqDmQ4mzrqJs5704GHk+BlmwNtXmPnVcxBdVzrn+oHEk3Yxc4K+ePFihsO8ipWsUHw6p DCoq44X5zB2OquZlGumNJi/8P2DcWHxp3hWppErf9ytbhTiSw+yPSc412mvJXDWaB+F8 14ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=JA/sPYxP+qMFvRYpZtP8igL0BSfhT22I5OtdCmVFDIM=; fh=HKgiOHUFLyfVG2npWMLYE8/3Ecp4EiEdadhQOzpm3aI=; b=c8PK1xufJKYmpPZWApXFF0p7Iqhi0EDacUPDqs16ypLn5jwX1JZC61fEUtRkpqYMkb 76w4VJbYcVIZ2Lokg+m7YQBz+Oc+LDSr93UbGArjg2IFzl7ro0WCWXRmf9VAH7osH48F zx9XAClX5tC4HLJOZkIrxENoazhhXZbNTGm5O2tU6JGXSTD/pG72EK2jpjZh05kOYVGE aShIKogdcJauvyhfxM6Rs3OoAn39Vl0bsgmXwJkMapGNEI31V/QtNEyNNVnOv0KPJ/2z WmdTLsknr/bhAlMKr/gN6ShsYyVbtdOZ/dNZFGsKRi1lGA3K8PQydx9BHMoAcT/4fOvv SZLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Tnb8bQ/M"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id lo26-20020a170906fa1a00b0099d97da6b19si10272771ejb.790.2023.09.06.19.19.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 19:19:11 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="Tnb8bQ/M"; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D11CA3856254 for ; Thu, 7 Sep 2023 02:18:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D11CA3856254 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694053101; bh=JA/sPYxP+qMFvRYpZtP8igL0BSfhT22I5OtdCmVFDIM=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Tnb8bQ/MjGh6Pm7+FbeHx+5TXzor+T9lK8QVse+tT4Vy15EHrJORlbi2fd+N8bNo9 5hSMxLXNxpwm0WKbyvbUDG0nFAIku+nqtl0BCusO1j2siI6otfEc90E2TRqMyq/4pz 3YTyINvoRnmQ2iEpHa69ngs4U2Tgy1fdKH+H4aio= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 940463858426 for ; Thu, 7 Sep 2023 02:17:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 940463858426 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id CB55E300089; Thu, 7 Sep 2023 02:17:31 +0000 (UTC) To: Tsukasa OI , Kito Cheng , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Jeff Law Cc: gcc-patches@gcc.gnu.org Subject: [RFC PATCH 2/2] RISC-V: Update testsuite for type-changed builtins Date: Thu, 7 Sep 2023 02:17:02 +0000 Message-ID: In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_MANYTO, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Gcc-patches From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776343477364642932 X-GMAIL-MSGID: 1776343477364642932 From: Tsukasa OI This commit replaces the type of the builtin used in the testsuite. Even without this commit, it won't cause any test failures but changed so that no confusion occurs. gcc/testsuite/ChangeLog: * gcc.target/riscv/zbc32.c: Make signed type to unsigned. * gcc.target/riscv/zbc64.c: Ditto. * gcc.target/riscv/zbkb32.c: Ditto. * gcc.target/riscv/zbkb64.c: Ditto. * gcc.target/riscv/zbkc32.c: Ditto. * gcc.target/riscv/zbkc64.c: Ditto. * gcc.target/riscv/zbkx32.c: Ditto. * gcc.target/riscv/zbkx64.c: Ditto. * gcc.target/riscv/zknd32.c: Ditto. * gcc.target/riscv/zknd64.c: Ditto. * gcc.target/riscv/zkne32.c: Ditto. * gcc.target/riscv/zkne64.c: Ditto. * gcc.target/riscv/zknh-sha256.c: Ditto. * gcc.target/riscv/zknh-sha512-32.c: Ditto. * gcc.target/riscv/zknh-sha512-64.c: Ditto. * gcc.target/riscv/zksed32.c: Ditto. * gcc.target/riscv/zksed64.c: Ditto. * gcc.target/riscv/zksh32.c: Ditto. * gcc.target/riscv/zksh64.c: Ditto. --- gcc/testsuite/gcc.target/riscv/zbc32.c | 6 +++--- gcc/testsuite/gcc.target/riscv/zbc64.c | 6 +++--- gcc/testsuite/gcc.target/riscv/zbkb32.c | 10 +++++----- gcc/testsuite/gcc.target/riscv/zbkb64.c | 8 ++++---- gcc/testsuite/gcc.target/riscv/zbkc32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zbkc64.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zbkx32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zbkx64.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zknd32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zknd64.c | 10 +++++----- gcc/testsuite/gcc.target/riscv/zkne32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zkne64.c | 8 ++++---- gcc/testsuite/gcc.target/riscv/zknh-sha256.c | 8 ++++---- gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c | 12 ++++++------ gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c | 8 ++++---- gcc/testsuite/gcc.target/riscv/zksed32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zksed64.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zksh32.c | 4 ++-- gcc/testsuite/gcc.target/riscv/zksh64.c | 4 ++-- 19 files changed, 58 insertions(+), 58 deletions(-) diff --git a/gcc/testsuite/gcc.target/riscv/zbc32.c b/gcc/testsuite/gcc.target/riscv/zbc32.c index 08705c4a687e..f3fb2238f7f4 100644 --- a/gcc/testsuite/gcc.target/riscv/zbc32.c +++ b/gcc/testsuite/gcc.target/riscv/zbc32.c @@ -3,17 +3,17 @@ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ #include -int32_t foo1(int32_t rs1, int32_t rs2) +uint32_t foo1(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_clmul(rs1, rs2); } -int32_t foo2(int32_t rs1, int32_t rs2) +uint32_t foo2(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_clmulh(rs1, rs2); } -int32_t foo3(int32_t rs1, int32_t rs2) +uint32_t foo3(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_clmulr(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zbc64.c b/gcc/testsuite/gcc.target/riscv/zbc64.c index a19f42b2883f..841a0aa7847d 100644 --- a/gcc/testsuite/gcc.target/riscv/zbc64.c +++ b/gcc/testsuite/gcc.target/riscv/zbc64.c @@ -3,17 +3,17 @@ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ #include -int64_t foo1(int64_t rs1, int64_t rs2) +uint64_t foo1(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_clmul(rs1, rs2); } -int64_t foo2(int64_t rs1, int64_t rs2) +uint64_t foo2(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_clmulh(rs1, rs2); } -int64_t foo3(int64_t rs1, int64_t rs2) +uint64_t foo3(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_clmulr(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkb32.c b/gcc/testsuite/gcc.target/riscv/zbkb32.c index dd45b8b9dc72..b2e442dc49d8 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkb32.c +++ b/gcc/testsuite/gcc.target/riscv/zbkb32.c @@ -4,27 +4,27 @@ #include -int32_t foo1(int16_t rs1, int16_t rs2) +uint32_t foo1(uint16_t rs1, uint16_t rs2) { return __builtin_riscv_pack(rs1, rs2); } -int32_t foo2(int8_t rs1, int8_t rs2) +uint32_t foo2(uint8_t rs1, uint8_t rs2) { return __builtin_riscv_packh(rs1, rs2); } -int32_t foo3(int32_t rs1) +uint32_t foo3(uint32_t rs1) { return __builtin_riscv_brev8(rs1); } -int32_t foo4(int32_t rs1) +uint32_t foo4(uint32_t rs1) { return __builtin_riscv_zip(rs1); } -int32_t foo5(int32_t rs1) +uint32_t foo5(uint32_t rs1) { return __builtin_riscv_unzip(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkb64.c b/gcc/testsuite/gcc.target/riscv/zbkb64.c index 960a2ae30ed6..08ac9c2a9f00 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkb64.c +++ b/gcc/testsuite/gcc.target/riscv/zbkb64.c @@ -3,22 +3,22 @@ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ #include -int64_t foo1(int32_t rs1, int32_t rs2) +uint64_t foo1(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_pack(rs1, rs2); } -int64_t foo2(int8_t rs1, int8_t rs2) +uint64_t foo2(uint8_t rs1, uint8_t rs2) { return __builtin_riscv_packh(rs1, rs2); } -int64_t foo3(int16_t rs1, int16_t rs2) +uint64_t foo3(uint16_t rs1, uint16_t rs2) { return __builtin_riscv_packw(rs1, rs2); } -int64_t foo4(int64_t rs1, int64_t rs2) +uint64_t foo4(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_brev8(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkc32.c b/gcc/testsuite/gcc.target/riscv/zbkc32.c index a8e29200250b..29f0d624a7d7 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkc32.c +++ b/gcc/testsuite/gcc.target/riscv/zbkc32.c @@ -3,12 +3,12 @@ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ #include -int32_t foo1(int32_t rs1, int32_t rs2) +uint32_t foo1(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_clmul(rs1, rs2); } -int32_t foo2(int32_t rs1, int32_t rs2) +uint32_t foo2(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_clmulh(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkc64.c b/gcc/testsuite/gcc.target/riscv/zbkc64.c index 728f8baf099d..53e6ac215ed3 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkc64.c +++ b/gcc/testsuite/gcc.target/riscv/zbkc64.c @@ -3,12 +3,12 @@ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ #include -int64_t foo1(int64_t rs1, int64_t rs2) +uint64_t foo1(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_clmul(rs1, rs2); } -int64_t foo2(int64_t rs1, int64_t rs2) +uint64_t foo2(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_clmulh(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkx32.c b/gcc/testsuite/gcc.target/riscv/zbkx32.c index bd95524f548b..b8b822a7c499 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkx32.c +++ b/gcc/testsuite/gcc.target/riscv/zbkx32.c @@ -4,12 +4,12 @@ #include -int32_t foo3(int32_t rs1, int32_t rs2) +uint32_t foo3(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_xperm8(rs1, rs2); } -int32_t foo4(int32_t rs1, int32_t rs2) +uint32_t foo4(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_xperm4(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zbkx64.c b/gcc/testsuite/gcc.target/riscv/zbkx64.c index 2a04a94b86c4..732436701b33 100644 --- a/gcc/testsuite/gcc.target/riscv/zbkx64.c +++ b/gcc/testsuite/gcc.target/riscv/zbkx64.c @@ -4,12 +4,12 @@ #include -int64_t foo1(int64_t rs1, int64_t rs2) +uint64_t foo1(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_xperm8(rs1, rs2); } -int64_t foo2(int64_t rs1, int64_t rs2) +uint64_t foo2(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_xperm4(rs1, rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zknd32.c b/gcc/testsuite/gcc.target/riscv/zknd32.c index 5fcc66da9015..e60c027e0911 100644 --- a/gcc/testsuite/gcc.target/riscv/zknd32.c +++ b/gcc/testsuite/gcc.target/riscv/zknd32.c @@ -4,12 +4,12 @@ #include -int32_t foo1(int32_t rs1, int32_t rs2, int bs) +uint32_t foo1(uint32_t rs1, uint32_t rs2, int bs) { return __builtin_riscv_aes32dsi(rs1,rs2,bs); } -int32_t foo2(int32_t rs1, int32_t rs2, int bs) +uint32_t foo2(uint32_t rs1, uint32_t rs2, int bs) { return __builtin_riscv_aes32dsmi(rs1,rs2,bs); } diff --git a/gcc/testsuite/gcc.target/riscv/zknd64.c b/gcc/testsuite/gcc.target/riscv/zknd64.c index b1dff98f7e21..910b91c6ed88 100644 --- a/gcc/testsuite/gcc.target/riscv/zknd64.c +++ b/gcc/testsuite/gcc.target/riscv/zknd64.c @@ -4,27 +4,27 @@ #include -int64_t foo1(int64_t rs1, int64_t rs2) +uint64_t foo1(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64ds(rs1,rs2); } -int64_t foo2(int64_t rs1, int64_t rs2) +uint64_t foo2(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64dsm(rs1,rs2); } -int64_t foo3(int64_t rs1, int rnum) +uint64_t foo3(uint64_t rs1, unsigned rnum) { return __builtin_riscv_aes64ks1i(rs1,rnum); } -int64_t foo4(int64_t rs1, int64_t rs2) +uint64_t foo4(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64ks2(rs1,rs2); } -int64_t foo5(int64_t rs1) +uint64_t foo5(uint64_t rs1) { return __builtin_riscv_aes64im(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zkne32.c b/gcc/testsuite/gcc.target/riscv/zkne32.c index c131c9a6bbb1..252e9ffa43b3 100644 --- a/gcc/testsuite/gcc.target/riscv/zkne32.c +++ b/gcc/testsuite/gcc.target/riscv/zkne32.c @@ -4,12 +4,12 @@ #include -int32_t foo1(int32_t rs1, int32_t rs2, int bs) +uint32_t foo1(uint32_t rs1, uint32_t rs2, unsigned bs) { return __builtin_riscv_aes32esi(rs1, rs2, bs); } -int32_t foo2(int32_t rs1, int32_t rs2, int bs) +uint32_t foo2(uint32_t rs1, uint32_t rs2, unsigned bs) { return __builtin_riscv_aes32esmi(rs1, rs2, bs); } diff --git a/gcc/testsuite/gcc.target/riscv/zkne64.c b/gcc/testsuite/gcc.target/riscv/zkne64.c index 7d82b5a5d411..b25f6b5c29ac 100644 --- a/gcc/testsuite/gcc.target/riscv/zkne64.c +++ b/gcc/testsuite/gcc.target/riscv/zkne64.c @@ -4,22 +4,22 @@ #include -int64_t foo1(int64_t rs1, int64_t rs2) +uint64_t foo1(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64es(rs1,rs2); } -int64_t foo2(int64_t rs1, int64_t rs2) +uint64_t foo2(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64esm(rs1,rs2); } -int64_t foo3(int64_t rs1, int rnum) +uint64_t foo3(uint64_t rs1, unsigned rnum) { return __builtin_riscv_aes64ks1i(rs1,rnum); } -int64_t foo4(int64_t rs1, int64_t rs2) +uint64_t foo4(uint64_t rs1, uint64_t rs2) { return __builtin_riscv_aes64ks2(rs1,rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zknh-sha256.c b/gcc/testsuite/gcc.target/riscv/zknh-sha256.c index 54329aa6af2e..952d611cd0b9 100644 --- a/gcc/testsuite/gcc.target/riscv/zknh-sha256.c +++ b/gcc/testsuite/gcc.target/riscv/zknh-sha256.c @@ -2,22 +2,22 @@ /* { dg-options "-O2 -march=rv64gc_zknh -mabi=lp64" } */ /* { dg-skip-if "" { *-*-* } { "-g" "-flto"} } */ -long foo1(long rs1) +unsigned long foo1(unsigned long rs1) { return __builtin_riscv_sha256sig0(rs1); } -long foo2(long rs1) +unsigned long foo2(unsigned long rs1) { return __builtin_riscv_sha256sig1(rs1); } -long foo3(long rs1) +unsigned long foo3(unsigned long rs1) { return __builtin_riscv_sha256sum0(rs1); } -long foo4(long rs1) +unsigned long foo4(unsigned long rs1) { return __builtin_riscv_sha256sum1(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c b/gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c index 4ebc470f8ab7..f2bcae36a1f2 100644 --- a/gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c +++ b/gcc/testsuite/gcc.target/riscv/zknh-sha512-32.c @@ -4,32 +4,32 @@ #include -int32_t foo1(int32_t rs1, int32_t rs2) +uint32_t foo1(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sig0h(rs1,rs2); } -int32_t foo2(int32_t rs1, int32_t rs2) +uint32_t foo2(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sig0l(rs1,rs2); } -int32_t foo3(int32_t rs1, int32_t rs2) +uint32_t foo3(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sig1h(rs1,rs2); } -int32_t foo4(int32_t rs1, int32_t rs2) +uint32_t foo4(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sig1l(rs1,rs2); } -int32_t foo5(int32_t rs1, int32_t rs2) +uint32_t foo5(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sum0r(rs1,rs2); } -int32_t foo6(int32_t rs1, int32_t rs2) +uint32_t foo6(uint32_t rs1, uint32_t rs2) { return __builtin_riscv_sha512sum1r(rs1,rs2); } diff --git a/gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c b/gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c index 0fb5c75b9ce6..4f248575e66e 100644 --- a/gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c +++ b/gcc/testsuite/gcc.target/riscv/zknh-sha512-64.c @@ -4,22 +4,22 @@ #include -int64_t foo1(int64_t rs1) +uint64_t foo1(uint64_t rs1) { return __builtin_riscv_sha512sig0(rs1); } -int64_t foo2(int64_t rs1) +uint64_t foo2(uint64_t rs1) { return __builtin_riscv_sha512sig1(rs1); } -int64_t foo3(int64_t rs1) +uint64_t foo3(uint64_t rs1) { return __builtin_riscv_sha512sum0(rs1); } -int64_t foo4(int64_t rs1) +uint64_t foo4(uint64_t rs1) { return __builtin_riscv_sha512sum1(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zksed32.c b/gcc/testsuite/gcc.target/riscv/zksed32.c index 9548d007cb22..7df04147e05c 100644 --- a/gcc/testsuite/gcc.target/riscv/zksed32.c +++ b/gcc/testsuite/gcc.target/riscv/zksed32.c @@ -4,12 +4,12 @@ #include -int32_t foo1(int32_t rs1, int32_t rs2, int bs) +uint32_t foo1(uint32_t rs1, uint32_t rs2, unsigned bs) { return __builtin_riscv_sm4ks(rs1,rs2,bs); } -int32_t foo2(int32_t rs1, int32_t rs2, int bs) +uint32_t foo2(uint32_t rs1, uint32_t rs2, unsigned bs) { return __builtin_riscv_sm4ed(rs1,rs2,bs); } diff --git a/gcc/testsuite/gcc.target/riscv/zksed64.c b/gcc/testsuite/gcc.target/riscv/zksed64.c index 190a654151db..3485adf9cd88 100644 --- a/gcc/testsuite/gcc.target/riscv/zksed64.c +++ b/gcc/testsuite/gcc.target/riscv/zksed64.c @@ -4,12 +4,12 @@ #include -int64_t foo1(int64_t rs1, int64_t rs2, int bs) +uint64_t foo1(uint64_t rs1, uint64_t rs2, unsigned bs) { return __builtin_riscv_sm4ks(rs1,rs2,bs); } -int64_t foo2(int64_t rs1, int64_t rs2, int bs) +uint64_t foo2(uint64_t rs1, uint64_t rs2, unsigned bs) { return __builtin_riscv_sm4ed(rs1,rs2,bs); } diff --git a/gcc/testsuite/gcc.target/riscv/zksh32.c b/gcc/testsuite/gcc.target/riscv/zksh32.c index 50370b58b7a9..20513f986f88 100644 --- a/gcc/testsuite/gcc.target/riscv/zksh32.c +++ b/gcc/testsuite/gcc.target/riscv/zksh32.c @@ -4,12 +4,12 @@ #include -int32_t foo1(int32_t rs1) +uint32_t foo1(uint32_t rs1) { return __builtin_riscv_sm3p0(rs1); } -int32_t foo2(int32_t rs1) +uint32_t foo2(uint32_t rs1) { return __builtin_riscv_sm3p1(rs1); } diff --git a/gcc/testsuite/gcc.target/riscv/zksh64.c b/gcc/testsuite/gcc.target/riscv/zksh64.c index 69847f3df359..bdd137872785 100644 --- a/gcc/testsuite/gcc.target/riscv/zksh64.c +++ b/gcc/testsuite/gcc.target/riscv/zksh64.c @@ -4,12 +4,12 @@ #include -int64_t foo1(int64_t rs1) +uint64_t foo1(uint64_t rs1) { return __builtin_riscv_sm3p0(rs1); } -int64_t foo2(int64_t rs1) +uint64_t foo2(uint64_t rs1) { return __builtin_riscv_sm3p1(rs1); }