Index: llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td =================================================================== --- llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td +++ llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td @@ -226,8 +226,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; Index: llvm/test/CodeGen/RISCV/double-zfa.ll =================================================================== --- llvm/test/CodeGen/RISCV/double-zfa.ll +++ 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 Index: llvm/test/CodeGen/RISCV/float-zfa.ll =================================================================== --- llvm/test/CodeGen/RISCV/float-zfa.ll +++ 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 Index: llvm/test/CodeGen/RISCV/half-zfa.ll =================================================================== --- llvm/test/CodeGen/RISCV/half-zfa.ll +++ 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