Skip to content

Commit 658cac8

Browse files
authored
[RISCV] Rename XCValu intrinsic name *_slet(u) to *_sle(u)) (#138498)
The instruction name and intrinsic name have been renamed to sle(u). The `t` was removed. Please refer to https://github.com/openhwgroup/core-v-sw/blob/master/specifications/corev-builtin-spec.md.
1 parent ca1ebff commit 658cac8

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

clang/include/clang/Basic/BuiltinsRISCVXCV.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ let Attributes = [NoThrow, Const] in {
2121
//===----------------------------------------------------------------------===//
2222
// XCValu extension.
2323
//===----------------------------------------------------------------------===//
24-
def alu_slet : RISCVXCVBuiltin<"int(int, int)", "xcvalu">;
25-
def alu_sletu : RISCVXCVBuiltin<"int(unsigned int, unsigned int)", "xcvalu">;
24+
def alu_sle : RISCVXCVBuiltin<"int(int, int)", "xcvalu">;
25+
def alu_sleu : RISCVXCVBuiltin<"int(unsigned int, unsigned int)", "xcvalu">;
2626
def alu_exths : RISCVXCVBuiltin<"int(int)", "xcvalu">;
2727
def alu_exthz : RISCVXCVBuiltin<"unsigned int(unsigned int)", "xcvalu">;
2828
def alu_extbs : RISCVXCVBuiltin<"int(int)", "xcvalu">;

clang/lib/CodeGen/TargetBuiltins/RISCV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ Value *CodeGenFunction::EmitRISCVBuiltinExpr(unsigned BuiltinID,
388388
case RISCV::BI__builtin_riscv_cv_alu_exthz:
389389
return Builder.CreateZExt(Builder.CreateTrunc(Ops[0], Int16Ty), Int32Ty,
390390
"exthz");
391-
case RISCV::BI__builtin_riscv_cv_alu_slet:
391+
case RISCV::BI__builtin_riscv_cv_alu_sle:
392392
return Builder.CreateZExt(Builder.CreateICmpSLE(Ops[0], Ops[1]), Int32Ty,
393393
"sle");
394-
case RISCV::BI__builtin_riscv_cv_alu_sletu:
394+
case RISCV::BI__builtin_riscv_cv_alu_sleu:
395395
return Builder.CreateZExt(Builder.CreateICmpULE(Ops[0], Ops[1]), Int32Ty,
396396
"sleu");
397397
case RISCV::BI__builtin_riscv_cv_alu_subN:

clang/lib/Headers/riscv_corev_alu.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ static __inline__ long __DEFAULT_FN_ATTRS __riscv_cv_abs(long a) {
2424
return __builtin_abs(a);
2525
}
2626

27-
static __inline__ long __DEFAULT_FN_ATTRS __riscv_cv_alu_slet(long a, long b) {
28-
return __builtin_riscv_cv_alu_slet(a, b);
27+
static __inline__ long __DEFAULT_FN_ATTRS __riscv_cv_alu_sle(long a, long b) {
28+
return __builtin_riscv_cv_alu_sle(a, b);
2929
}
3030

3131
static __inline__ long __DEFAULT_FN_ATTRS
32-
__riscv_cv_alu_sletu(unsigned long a, unsigned long b) {
33-
return __builtin_riscv_cv_alu_sletu(a, b);
32+
__riscv_cv_alu_sleu(unsigned long a, unsigned long b) {
33+
return __builtin_riscv_cv_alu_sleu(a, b);
3434
}
3535

3636
static __inline__ long __DEFAULT_FN_ATTRS __riscv_cv_alu_min(long a, long b) {

clang/test/CodeGen/RISCV/riscv-xcvalu-c-api.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <stdint.h>
66
#include <riscv_corev_alu.h>
77

8-
// CHECK-LABEL: @test_alu_slet(
8+
// CHECK-LABEL: @test_alu_sle(
99
// CHECK-NEXT: entry:
1010
// CHECK-NEXT: [[A_ADDR_I:%.*]] = alloca i32, align 4
1111
// CHECK-NEXT: [[B_ADDR_I:%.*]] = alloca i32, align 4
@@ -23,11 +23,11 @@
2323
// CHECK-NEXT: [[SLE_I:%.*]] = zext i1 [[TMP4]] to i32
2424
// CHECK-NEXT: ret i32 [[SLE_I]]
2525
//
26-
int test_alu_slet(int32_t a, int32_t b) {
27-
return __riscv_cv_alu_slet(a, b);
26+
int test_alu_sle(int32_t a, int32_t b) {
27+
return __riscv_cv_alu_sle(a, b);
2828
}
2929

30-
// CHECK-LABEL: @test_alu_sletu(
30+
// CHECK-LABEL: @test_alu_sleu(
3131
// CHECK-NEXT: entry:
3232
// CHECK-NEXT: [[A_ADDR_I:%.*]] = alloca i32, align 4
3333
// CHECK-NEXT: [[B_ADDR_I:%.*]] = alloca i32, align 4
@@ -45,8 +45,8 @@ int test_alu_slet(int32_t a, int32_t b) {
4545
// CHECK-NEXT: [[SLEU_I:%.*]] = zext i1 [[TMP4]] to i32
4646
// CHECK-NEXT: ret i32 [[SLEU_I]]
4747
//
48-
int test_alu_sletu(uint32_t a, uint32_t b) {
49-
return __riscv_cv_alu_sletu(a, b);
48+
int test_alu_sleu(uint32_t a, uint32_t b) {
49+
return __riscv_cv_alu_sleu(a, b);
5050
}
5151

5252
// CHECK-LABEL: @test_alu_min(

clang/test/CodeGen/RISCV/riscv-xcvalu.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int test_abs(int a) {
1616
return __builtin_abs(a);
1717
}
1818

19-
// CHECK-LABEL: @test_alu_slet(
19+
// CHECK-LABEL: @test_alu_sle(
2020
// CHECK-NEXT: entry:
2121
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2222
// CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
@@ -28,11 +28,11 @@ int test_abs(int a) {
2828
// CHECK-NEXT: [[SLE:%.*]] = zext i1 [[TMP2]] to i32
2929
// CHECK-NEXT: ret i32 [[SLE]]
3030
//
31-
int test_alu_slet(int32_t a, int32_t b) {
32-
return __builtin_riscv_cv_alu_slet(a, b);
31+
int test_alu_sle(int32_t a, int32_t b) {
32+
return __builtin_riscv_cv_alu_sle(a, b);
3333
}
3434

35-
// CHECK-LABEL: @test_alu_sletu(
35+
// CHECK-LABEL: @test_alu_sleu(
3636
// CHECK-NEXT: entry:
3737
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3838
// CHECK-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
@@ -44,8 +44,8 @@ int test_alu_slet(int32_t a, int32_t b) {
4444
// CHECK-NEXT: [[SLEU:%.*]] = zext i1 [[TMP2]] to i32
4545
// CHECK-NEXT: ret i32 [[SLEU]]
4646
//
47-
int test_alu_sletu(uint32_t a, uint32_t b) {
48-
return __builtin_riscv_cv_alu_sletu(a, b);
47+
int test_alu_sleu(uint32_t a, uint32_t b) {
48+
return __builtin_riscv_cv_alu_sleu(a, b);
4949
}
5050

5151
// CHECK-LABEL: @test_alu_exths(

llvm/test/CodeGen/RISCV/xcvalu.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ define i32 @abs(i32 %a) {
1717
ret i32 %1
1818
}
1919

20-
define i1 @slet(i32 %a, i32 %b) {
21-
; CHECK-LABEL: slet:
20+
define i1 @sle(i32 %a, i32 %b) {
21+
; CHECK-LABEL: sle:
2222
; CHECK: # %bb.0:
2323
; CHECK-NEXT: cv.sle a0, a0, a1
2424
; CHECK-NEXT: ret
2525
%1 = icmp sle i32 %a, %b
2626
ret i1 %1
2727
}
2828

29-
define i1 @sletu(i32 %a, i32 %b) {
30-
; CHECK-LABEL: sletu:
29+
define i1 @sleu(i32 %a, i32 %b) {
30+
; CHECK-LABEL: sleu:
3131
; CHECK: # %bb.0:
3232
; CHECK-NEXT: cv.sleu a0, a0, a1
3333
; CHECK-NEXT: ret

0 commit comments

Comments
 (0)