diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td @@ -197,8 +197,8 @@ def: Pat<(any_fnearbyint FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b111)>; def: Pat<(any_fround FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b100)>; -def: Pat<(any_ffloor FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b011)>; -def: Pat<(any_fceil FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b010)>; +def: Pat<(any_ffloor FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b010)>; +def: Pat<(any_fceil FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b011)>; def: Pat<(any_ftrunc FPR32:$rs1), (FROUND_S FPR32:$rs1, 0b001)>; def: PatSetCC; @@ -220,8 +220,8 @@ def: Pat<(any_fround FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b100)>; def: Pat<(any_froundeven FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b000)>; -def: Pat<(any_ffloor FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b011)>; -def: Pat<(any_fceil FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b010)>; +def: Pat<(any_ffloor FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b010)>; +def: Pat<(any_fceil FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b011)>; def: Pat<(any_ftrunc FPR64:$rs1), (FROUND_D FPR64:$rs1, 0b001)>; def: PatSetCC; @@ -248,8 +248,8 @@ def: Pat<(any_fround FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b100)>; def: Pat<(any_froundeven FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b000)>; -def: Pat<(any_ffloor FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b011)>; -def: Pat<(any_fceil FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b010)>; +def: Pat<(any_ffloor FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b010)>; +def: Pat<(any_fceil FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b011)>; def: Pat<(any_ftrunc FPR16:$rs1), (FROUND_H FPR16:$rs1, 0b001)>; def: PatSetCC; diff --git a/llvm/test/CodeGen/RISCV/double-zfa.ll b/llvm/test/CodeGen/RISCV/double-zfa.ll --- a/llvm/test/CodeGen/RISCV/double-zfa.ll +++ b/llvm/test/CodeGen/RISCV/double-zfa.ll @@ -170,7 +170,7 @@ define double @fround_d_2(double %a) nounwind { ; CHECK-LABEL: fround_d_2: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.d fa0, fa0, rup +; CHECK-NEXT: fround.d fa0, fa0, rdn ; CHECK-NEXT: ret %call = tail call double @floor(double %a) nounwind readnone ret double %call @@ -182,7 +182,7 @@ define double @fround_d_3(double %a) nounwind { ; CHECK-LABEL: fround_d_3: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.d fa0, fa0, rdn +; CHECK-NEXT: fround.d fa0, fa0, rup ; CHECK-NEXT: ret %call = tail call double @ceil(double %a) nounwind readnone ret double %call diff --git a/llvm/test/CodeGen/RISCV/float-zfa.ll b/llvm/test/CodeGen/RISCV/float-zfa.ll --- a/llvm/test/CodeGen/RISCV/float-zfa.ll +++ b/llvm/test/CodeGen/RISCV/float-zfa.ll @@ -125,7 +125,7 @@ define float @fround_s_2(float %a) nounwind { ; CHECK-LABEL: fround_s_2: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.s fa0, fa0, rup +; CHECK-NEXT: fround.s fa0, fa0, rdn ; CHECK-NEXT: ret %call = tail call float @floorf(float %a) nounwind readnone ret float %call @@ -137,7 +137,7 @@ define float @fround_s_3(float %a) nounwind { ; CHECK-LABEL: fround_s_3: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.s fa0, fa0, rdn +; CHECK-NEXT: fround.s fa0, fa0, rup ; CHECK-NEXT: ret %call = tail call float @ceilf(float %a) nounwind readnone ret float %call diff --git a/llvm/test/CodeGen/RISCV/half-zfa.ll b/llvm/test/CodeGen/RISCV/half-zfa.ll --- a/llvm/test/CodeGen/RISCV/half-zfa.ll +++ b/llvm/test/CodeGen/RISCV/half-zfa.ll @@ -41,7 +41,7 @@ define half @fround_h_2(half %a) nounwind { ; CHECK-LABEL: fround_h_2: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.h fa0, fa0, rup +; CHECK-NEXT: fround.h fa0, fa0, rdn ; CHECK-NEXT: ret %call = tail call half @llvm.floor.f16(half %a) nounwind readnone ret half %call @@ -53,7 +53,7 @@ define half @fround_h_3(half %a) nounwind { ; CHECK-LABEL: fround_h_3: ; CHECK: # %bb.0: -; CHECK-NEXT: fround.h fa0, fa0, rdn +; CHECK-NEXT: fround.h fa0, fa0, rup ; CHECK-NEXT: ret %call = tail call half @llvm.ceil.f16(half %a) nounwind readnone ret half %call