[PATCH] D153403: [RISCV] Use unsigned types for orc_b builtins.
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 25 22:54:44 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGf67dfb3cdb4b: [RISCV] Use unsigned types for orc_b builtins. (authored by craig.topper).
Changed prior to commit:
https://reviews.llvm.org/D153403?vs=533169&id=534429#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153403/new/
https://reviews.llvm.org/D153403
Files:
clang/include/clang/Basic/BuiltinsRISCV.def
clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb-error.c
clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c
clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbb.c
Index: clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbb.c
===================================================================
--- clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbb.c
+++ clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbb.c
@@ -10,7 +10,7 @@
// RV64ZBB-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.orc.b.i32(i32 [[TMP0]])
// RV64ZBB-NEXT: ret i32 [[TMP1]]
//
-int orc_b_32(int a) {
+unsigned int orc_b_32(unsigned int a) {
return __builtin_riscv_orc_b_32(a);
}
@@ -22,7 +22,7 @@
// RV64ZBB-NEXT: [[TMP1:%.*]] = call i64 @llvm.riscv.orc.b.i64(i64 [[TMP0]])
// RV64ZBB-NEXT: ret i64 [[TMP1]]
//
-long orc_b_64(long a) {
+unsigned long orc_b_64(unsigned long a) {
return __builtin_riscv_orc_b_64(a);
}
@@ -78,4 +78,4 @@
//
int ctz_64(unsigned long a) {
return __builtin_riscv_ctz_64(a);
-}
\ No newline at end of file
+}
Index: clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c
===================================================================
--- clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c
+++ clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb.c
@@ -10,7 +10,7 @@
// RV32ZBB-NEXT: [[TMP1:%.*]] = call i32 @llvm.riscv.orc.b.i32(i32 [[TMP0]])
// RV32ZBB-NEXT: ret i32 [[TMP1]]
//
-int orc_b_32(int a) {
+unsigned int orc_b_32(unsigned int a) {
return __builtin_riscv_orc_b_32(a);
}
@@ -36,4 +36,4 @@
//
int ctz_32(unsigned int a) {
return __builtin_riscv_ctz_32(a);
-}
\ No newline at end of file
+}
Index: clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb-error.c
===================================================================
--- clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb-error.c
+++ clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbb-error.c
@@ -1,6 +1,6 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple riscv32 -target-feature +zbb -verify %s -o -
-int orc_b_64(int a) {
+unsigned int orc_b_64(unsigned int a) {
return __builtin_riscv_orc_b_64(a); // expected-error {{builtin requires: 'RV64'}}
}
Index: clang/include/clang/Basic/BuiltinsRISCV.def
===================================================================
--- clang/include/clang/Basic/BuiltinsRISCV.def
+++ clang/include/clang/Basic/BuiltinsRISCV.def
@@ -16,8 +16,8 @@
#endif
// Zbb extension
-TARGET_BUILTIN(__builtin_riscv_orc_b_32, "ZiZi", "nc", "zbb")
-TARGET_BUILTIN(__builtin_riscv_orc_b_64, "WiWi", "nc", "zbb,64bit")
+TARGET_BUILTIN(__builtin_riscv_orc_b_32, "UZiUZi", "nc", "zbb")
+TARGET_BUILTIN(__builtin_riscv_orc_b_64, "UWiUWi", "nc", "zbb,64bit")
TARGET_BUILTIN(__builtin_riscv_clz_32, "iUZi", "nc", "zbb|xtheadbb")
TARGET_BUILTIN(__builtin_riscv_clz_64, "iUWi", "nc", "zbb|xtheadbb,64bit")
TARGET_BUILTIN(__builtin_riscv_ctz_32, "iUZi", "nc", "zbb")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153403.534429.patch
Type: text/x-patch
Size: 2810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230626/bcd1e2b4/attachment.bin>
More information about the cfe-commits
mailing list