public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4075] RISC-V: Make bit manipulation value / round number and shift amount types for builtins unsigned
@ 2023-09-16 1:24 Tsukasa OI
0 siblings, 0 replies; only message in thread
From: Tsukasa OI @ 2023-09-16 1:24 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:a1751681867a3ce760ea6924c3c632f1b81db97e
commit r14-4075-ga1751681867a3ce760ea6924c3c632f1b81db97e
Author: Tsukasa OI <research_trasio@irq.a4lg.com>
Date: Wed Sep 6 06:28:39 2023 +0000
RISC-V: Make bit manipulation value / round number and shift amount types for builtins unsigned
For bit manipulation operations, input(s) 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).
To make consistent to the LLVM commit 599421ae36c3 ("[RISCV] Use unsigned
instead of signed types for Zk* and Zb* builtins."), round numbers and
shift amount on the scalar crypto instructions are also changed
to unsigned.
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/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.
Diff:
---
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 ++++++++++++------------
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 +-
23 files changed, 133 insertions(+), 134 deletions(-)
diff --git a/gcc/config/riscv/riscv-builtins.cc b/gcc/config/riscv/riscv-builtins.cc
index 8afe7b7e97d..f6b06b3c16a 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 b92044dc6ff..ff713b78e19 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 3b518195a29..366861ce640 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 c2caed5151d..db86ec9fd78 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
<http://www.gnu.org/licenses/>. */
// 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),
diff --git a/gcc/testsuite/gcc.target/riscv/zbc32.c b/gcc/testsuite/gcc.target/riscv/zbc32.c
index 08705c4a687..f3fb2238f7f 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 <stdint-gcc.h>
-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 a19f42b2883..841a0aa7847 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 <stdint-gcc.h>
-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 dd45b8b9dc7..b2e442dc49d 100644
--- a/gcc/testsuite/gcc.target/riscv/zbkb32.c
+++ b/gcc/testsuite/gcc.target/riscv/zbkb32.c
@@ -4,27 +4,27 @@
#include <stdint-gcc.h>
-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 960a2ae30ed..08ac9c2a9f0 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 <stdint-gcc.h>
-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 a8e29200250..29f0d624a7d 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 <stdint-gcc.h>
-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 728f8baf099..53e6ac215ed 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 <stdint-gcc.h>
-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 bd95524f548..b8b822a7c49 100644
--- a/gcc/testsuite/gcc.target/riscv/zbkx32.c
+++ b/gcc/testsuite/gcc.target/riscv/zbkx32.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 2a04a94b86c..732436701b3 100644
--- a/gcc/testsuite/gcc.target/riscv/zbkx64.c
+++ b/gcc/testsuite/gcc.target/riscv/zbkx64.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 5fcc66da901..e60c027e091 100644
--- a/gcc/testsuite/gcc.target/riscv/zknd32.c
+++ b/gcc/testsuite/gcc.target/riscv/zknd32.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 b1dff98f7e2..910b91c6ed8 100644
--- a/gcc/testsuite/gcc.target/riscv/zknd64.c
+++ b/gcc/testsuite/gcc.target/riscv/zknd64.c
@@ -4,27 +4,27 @@
#include <stdint-gcc.h>
-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 c131c9a6bbb..252e9ffa43b 100644
--- a/gcc/testsuite/gcc.target/riscv/zkne32.c
+++ b/gcc/testsuite/gcc.target/riscv/zkne32.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 7d82b5a5d41..b25f6b5c29a 100644
--- a/gcc/testsuite/gcc.target/riscv/zkne64.c
+++ b/gcc/testsuite/gcc.target/riscv/zkne64.c
@@ -4,22 +4,22 @@
#include <stdint-gcc.h>
-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 54329aa6af2..952d611cd0b 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 4ebc470f8ab..f2bcae36a1f 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 <stdint-gcc.h>
-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 0fb5c75b9ce..4f248575e66 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 <stdint-gcc.h>
-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 9548d007cb2..7df04147e05 100644
--- a/gcc/testsuite/gcc.target/riscv/zksed32.c
+++ b/gcc/testsuite/gcc.target/riscv/zksed32.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 190a654151d..3485adf9cd8 100644
--- a/gcc/testsuite/gcc.target/riscv/zksed64.c
+++ b/gcc/testsuite/gcc.target/riscv/zksed64.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 50370b58b7a..20513f986f8 100644
--- a/gcc/testsuite/gcc.target/riscv/zksh32.c
+++ b/gcc/testsuite/gcc.target/riscv/zksh32.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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 69847f3df35..bdd13787278 100644
--- a/gcc/testsuite/gcc.target/riscv/zksh64.c
+++ b/gcc/testsuite/gcc.target/riscv/zksh64.c
@@ -4,12 +4,12 @@
#include <stdint-gcc.h>
-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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-16 1:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-16 1:24 [gcc r14-4075] RISC-V: Make bit manipulation value / round number and shift amount types for builtins unsigned Tsukasa OI
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).