def int_nearbyint : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
def int_round : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
def int_roundeven : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
+
+ // Truncate a floating point number with a specific rounding mode
+ def int_fptrunc_round : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ],
+ [ llvm_anyfloat_ty, llvm_metadata_ty ]>;
+
def int_canonicalize : DefaultAttrsIntrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>],
[IntrNoMem]>;
// Arithmetic fence intrinsic.
// FIXME: Consider maybe adding intrinsics for sitofp, uitofp.
-// Truncate a floating point number with a specific rounding mode
-def int_fptrunc_round : DefaultAttrsIntrinsic<[ llvm_anyfloat_ty ],
- [ llvm_anyfloat_ty, llvm_metadata_ty ],
- [ IntrNoMem, IntrWillReturn ]>;
-
//===------------------------- Expect Intrinsics --------------------------===//
//
def int_expect : DefaultAttrsIntrinsic<[llvm_anyint_ty],
declare i1 @llvm.is.fpclass.f32(float, i32)
declare float @llvm.arithmetic.fence.f32(float)
+
+; CHECK-LABEL: @ifThen_fptrunc_round(
+; CHECK: %round = call half @llvm.fptrunc.round.f16.f32(float %x, metadata !"round.downward")
+; CHECK-NEXT: br i1 true
+define void @ifThen_fptrunc_round(float %x) {
+ br i1 true, label %a, label %b
+
+a:
+ %round = call half @llvm.fptrunc.round.f16.f32(float %x, metadata !"round.downward")
+ br label %b
+
+b:
+ ret void
+}
+
+declare half @llvm.fptrunc.round.f16.f32(float, metadata)