summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2019-11-11 23:30:55 -0800
committerCraig Topper <craig.topper@gmail.com>2019-11-11 23:55:12 -0800
commit22a535e91a795e52c8b8c01ad04e3577e9f7ae5b (patch)
treec87927a74698dcc4a84cb38df350c05f6dd1203b
parentff1504da6fa9977a20e2e3ba11a157cf9acf3bad (diff)
downloadbcm5719-llvm-22a535e91a795e52c8b8c01ad04e3577e9f7ae5b.tar.gz
bcm5719-llvm-22a535e91a795e52c8b8c01ad04e3577e9f7ae5b.zip
[X86] Add fptosi test to fp-intrinsics.ll
-rw-r--r--llvm/test/CodeGen/X86/fp-intrinsics.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp-intrinsics.ll b/llvm/test/CodeGen/X86/fp-intrinsics.ll
index 0ce21d7d4c8..7d5a04dfe51 100644
--- a/llvm/test/CodeGen/X86/fp-intrinsics.ll
+++ b/llvm/test/CodeGen/X86/fp-intrinsics.ll
@@ -400,6 +400,25 @@ entry:
ret double %rem
}
+; Verify that fptosi(%x) isn't simplified when the rounding mode is
+; unknown. The expansion should have only one conversion instruction.
+; Verify that no gross errors happen.
+define i32 @f20s(double %x) #0 {
+; SSE-LABEL: f20s:
+; SSE: # %bb.0: # %entry
+; SSE-NEXT: cvttsd2si %xmm0, %eax
+; SSE-NEXT: retq
+;
+; AVX-LABEL: f20s:
+; AVX: # %bb.0: # %entry
+; AVX-NEXT: vcvttsd2si %xmm0, %eax
+; AVX-NEXT: retq
+entry:
+ %result = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %x,
+ metadata !"fpexcept.strict") #0
+ ret i32 %result
+}
+
; Verify that fptoui(%x) isn't simplified when the rounding mode is
; unknown. The expansion should have only one conversion instruction.
; Verify that no gross errors happen.
OpenPOWER on IntegriCloud