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)
473473
474474 auto &AbsActions = getActionDefinitionsBuilder (G_ABS);
475475 if (ST.hasStdExtZbb ())
476- AbsActions.customFor ({s32, sXLen }).minScalar (0 , sXLen );
476+ AbsActions.customFor ({sXLen }).minScalar (0 , sXLen );
477477 AbsActions.lower ();
478478
479479 auto &MinMaxActions =
Original file line number Diff line number Diff line change @@ -108,8 +108,8 @@ define i32 @abs32(i32 %x) {
108108;
109109; RV64ZBB-LABEL: abs32:
110110; RV64ZBB: # %bb.0:
111- ; RV64ZBB-NEXT: negw a1, a0
112111; RV64ZBB-NEXT: sext.w a0, a0
112+ ; RV64ZBB-NEXT: neg a1, a0
113113; RV64ZBB-NEXT: max a0, a0, a1
114114; RV64ZBB-NEXT: ret
115115 %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: |
101101 ; RV64ZBB-LABEL: name: abs_i32
102102 ; RV64ZBB: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
103103 ; 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]]
109107 ; RV64ZBB-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[SMAX]], 32
110108 ; RV64ZBB-NEXT: $x10 = COPY [[SEXT_INREG]](s64)
111109 ; RV64ZBB-NEXT: PseudoRET implicit $x10
You can’t perform that action at this time.
0 commit comments