Skip to content

Commit 70a64fe

Browse files
committed
[RISCV] Remove support for the unratified Zbt extension.
This extension does not appear to be on its way to ratification. Out of the unratified bitmanip extensions, this one had the largest impact on the compiler. Posting this patch to start a discussion about whether we should remove these extensions. We'll talk more at the RISC-V sync meeting this Thursday. Reviewed By: asb, reames Differential Revision: https://reviews.llvm.org/D133834
1 parent 669e508 commit 70a64fe

38 files changed

+367
-4536
lines changed

clang/include/clang/Basic/BuiltinsRISCV.def

-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ TARGET_BUILTIN(__builtin_riscv_crc32c_w, "LiLi", "nc", "experimental-zbr")
6969
TARGET_BUILTIN(__builtin_riscv_crc32_d, "LiLi", "nc", "experimental-zbr,64bit")
7070
TARGET_BUILTIN(__builtin_riscv_crc32c_d, "LiLi", "nc", "experimental-zbr,64bit")
7171

72-
// Zbt extension
73-
TARGET_BUILTIN(__builtin_riscv_fsl_32, "LiLiLiLi", "nc", "experimental-zbt")
74-
TARGET_BUILTIN(__builtin_riscv_fsr_32, "LiLiLiLi", "nc", "experimental-zbt")
75-
TARGET_BUILTIN(__builtin_riscv_fsl_64, "WiWiWiWi", "nc", "experimental-zbt,64bit")
76-
TARGET_BUILTIN(__builtin_riscv_fsr_64, "WiWiWiWi", "nc", "experimental-zbt,64bit")
77-
7872
// Zbkb extension
7973
TARGET_BUILTIN(__builtin_riscv_brev8, "LiLi", "nc", "zbkb")
8074
TARGET_BUILTIN(__builtin_riscv_zip_32, "ZiZi", "nc", "zbkb,32bit")

clang/lib/CodeGen/CGBuiltin.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -19212,10 +19212,6 @@ Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned BuiltinID,
1921219212
case RISCV::BI__builtin_riscv_crc32c_h:
1921319213
case RISCV::BI__builtin_riscv_crc32c_w:
1921419214
case RISCV::BI__builtin_riscv_crc32c_d:
19215-
case RISCV::BI__builtin_riscv_fsl_32:
19216-
case RISCV::BI__builtin_riscv_fsr_32:
19217-
case RISCV::BI__builtin_riscv_fsl_64:
19218-
case RISCV::BI__builtin_riscv_fsr_64:
1921919215
case RISCV::BI__builtin_riscv_brev8:
1922019216
case RISCV::BI__builtin_riscv_zip_32:
1922119217
case RISCV::BI__builtin_riscv_unzip_32: {
@@ -19320,16 +19316,6 @@ Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned BuiltinID,
1932019316
ID = Intrinsic::riscv_crc32c_d;
1932119317
break;
1932219318

19323-
// Zbt
19324-
case RISCV::BI__builtin_riscv_fsl_32:
19325-
case RISCV::BI__builtin_riscv_fsl_64:
19326-
ID = Intrinsic::riscv_fsl;
19327-
break;
19328-
case RISCV::BI__builtin_riscv_fsr_32:
19329-
case RISCV::BI__builtin_riscv_fsr_64:
19330-
ID = Intrinsic::riscv_fsr;
19331-
break;
19332-
1933319319
// Zbkx
1933419320
case RISCV::BI__builtin_riscv_xperm8:
1933519321
ID = Intrinsic::riscv_xperm8;

clang/test/CodeGen/RISCV/rvb-intrinsics/riscv32-zbt.c

-54
This file was deleted.

clang/test/CodeGen/RISCV/rvb-intrinsics/riscv64-zbt.c

-116
This file was deleted.

llvm/docs/RISCVUsage.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ The primary goal of experimental support is to assist in the process of ratifica
131131
``experimental-zawrs``
132132
LLVM implements the `1.0-rc3 draft specification <https://github.com/riscv/riscv-zawrs/releases/download/V1.0-rc3/Zawrs.pdf>`_. Note that have been backwards incompatible changes made between release candidates for the 1.0 draft.
133133

134-
``experimental-zbe``, ``experimental-zbf``, ``experimental-zbm``, ``experimental-zbp``, ``experimental-zbr``, ``experimental-zbt``
134+
``experimental-zbe``, ``experimental-zbf``, ``experimental-zbm``, ``experimental-zbp``, ``experimental-zbr``
135135
LLVM implements the `latest state of the bitmanip working branch <https://github.com/riscv/riscv-bitmanip/tree/main-history>`_, which is largely similar to the 0.93 draft specification but with some instruction naming changes. These are individual portions of the bitmanip efforts which did *not* get ratified. Given ratification for these sub-extensions appears stalled; they are a likely candidate for removal in the future.
136136

137137
``experimental-zca``

llvm/docs/ReleaseNotes.rst

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ Changes to the PowerPC Backend
112112
Changes to the RISC-V Backend
113113
-----------------------------
114114

115+
* Support the unratified Zbt extension has been removed.
116+
115117
Changes to the WebAssembly Backend
116118
----------------------------------
117119

llvm/include/llvm/IR/IntrinsicsRISCV.td

-4
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,6 @@ let TargetPrefix = "riscv" in {
129129
def int_riscv_crc32c_w : BitManipGPRIntrinsics;
130130
def int_riscv_crc32c_d : BitManipGPRIntrinsics;
131131

132-
// Zbt
133-
def int_riscv_fsl : BitManipGPRGPRGRIntrinsics;
134-
def int_riscv_fsr : BitManipGPRGPRGRIntrinsics;
135-
136132
// Zbkb
137133
def int_riscv_brev8 : BitManipGPRIntrinsics;
138134
def int_riscv_zip : BitManipGPRIntrinsics;

llvm/lib/Target/RISCV/RISCV.td

-7
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ def HasStdExtZbs : Predicate<"Subtarget->hasStdExtZbs()">,
198198
AssemblerPredicate<(all_of FeatureStdExtZbs),
199199
"'Zbs' (Single-Bit Instructions)">;
200200

201-
def FeatureStdExtZbt
202-
: SubtargetFeature<"experimental-zbt", "HasStdExtZbt", "true",
203-
"'Zbt' (Ternary 'Zb' Instructions)">;
204-
def HasStdExtZbt : Predicate<"Subtarget->hasStdExtZbt()">,
205-
AssemblerPredicate<(all_of FeatureStdExtZbt),
206-
"'Zbt' (Ternary 'Zb' Instructions)">;
207-
208201
// Some instructions belong to both the basic and the permutation
209202
// subextensions. They should be enabled if either has been specified.
210203
def HasStdExtZbbOrZbp

0 commit comments

Comments
 (0)