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<FPR32, strict_fsetcc, SETLT, FLTQ_S>;
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<FPR64, strict_fsetcc, SETLT, FLTQ_D>;
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<FPR16, strict_fsetcc, SETLT, FLTQ_H>;
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
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
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
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
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
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