File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
test/CodeGen/RISCV/GlobalISel Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
473
473
474
474
auto &AbsActions = getActionDefinitionsBuilder (G_ABS);
475
475
if (ST.hasStdExtZbb ())
476
- AbsActions.customFor ({s32, sXLen }).minScalar (0 , sXLen );
476
+ AbsActions.customFor ({sXLen }).minScalar (0 , sXLen );
477
477
AbsActions.lower ();
478
478
479
479
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 @@ -101,11 +101,9 @@ body: |
101
101
; RV64ZBB-LABEL: name: abs_i32
102
102
; RV64ZBB: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
103
103
; RV64ZBB-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32
104
- ; RV64ZBB-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[ASSERT_SEXT]](s64)
105
- ; RV64ZBB-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
106
- ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[TRUNC]]
107
- ; RV64ZBB-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[SUB]](s32)
108
- ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[SEXT]]
104
+ ; RV64ZBB-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0
105
+ ; RV64ZBB-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[C]], [[ASSERT_SEXT]]
106
+ ; RV64ZBB-NEXT: [[SMAX:%[0-9]+]]:_(s64) = G_SMAX [[ASSERT_SEXT]], [[SUB]]
109
107
; RV64ZBB-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SMAX]], 32
110
108
; RV64ZBB-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
111
109
; RV64ZBB-NEXT: PseudoRET implicit $x10
You can’t perform that action at this time.
0 commit comments