File tree 3 files changed +5
-7
lines changed
test/CodeGen/RISCV/GlobalISel 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
423
423
424
424
auto &AbsActions = getActionDefinitionsBuilder (G_ABS);
425
425
if (ST.hasStdExtZbb ())
426
- AbsActions.customFor ({s32, sXLen }).minScalar (0 , sXLen );
426
+ AbsActions.customFor ({sXLen }).minScalar (0 , sXLen );
427
427
AbsActions.lower ();
428
428
429
429
auto &MinMaxActions =
Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ define i32 @abs32(i32 %x) {
108
108
;
109
109
; RV64ZBB-LABEL: abs32:
110
110
; RV64ZBB: # %bb.0:
111
- ; RV64ZBB-NEXT: negw a1, a0
112
111
; RV64ZBB-NEXT: sext.w a0, a0
112
+ ; RV64ZBB-NEXT: neg a1, a0
113
113
; RV64ZBB-NEXT: max a0, a0, a1
114
114
; RV64ZBB-NEXT: ret
115
115
%abs = tail call i32 @llvm.abs.i32 (i32 %x , i1 true )
Original file line number Diff line number Diff line change @@ -102,11 +102,9 @@ body: |
102
102
; RV64ZBB-LABEL: name: abs_i32
103
103
; RV64ZBB: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
104
104
; RV64ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32
105
- ; RV64ZBB-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[ASSERT_SEXT]](s64)
106
- ; RV64ZBB-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
107
- ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[TRUNC]]
108
- ; RV64ZBB-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SUB]](s32)
109
- ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[SEXT]]
105
+ ; RV64ZBB-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
106
+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[C]], [[ASSERT_SEXT]]
107
+ ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[SUB]]
110
108
; RV64ZBB-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SMAX]], 32
111
109
; RV64ZBB-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
112
110
; RV64ZBB-NEXT: PseudoRET implicit $x10
You can’t perform that action at this time.
0 commit comments