Skip to content

Commit 22a535e

Browse files
committed
[X86] Add fptosi test to fp-intrinsics.ll
1 parent ff1504d commit 22a535e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

llvm/test/CodeGen/X86/fp-intrinsics.ll

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,25 @@ entry:
400400
ret double %rem
401401
}
402402

403+
; Verify that fptosi(%x) isn't simplified when the rounding mode is
404+
; unknown. The expansion should have only one conversion instruction.
405+
; Verify that no gross errors happen.
406+
define i32 @f20s(double %x) #0 {
407+
; SSE-LABEL: f20s:
408+
; SSE: # %bb.0: # %entry
409+
; SSE-NEXT: cvttsd2si %xmm0, %eax
410+
; SSE-NEXT: retq
411+
;
412+
; AVX-LABEL: f20s:
413+
; AVX: # %bb.0: # %entry
414+
; AVX-NEXT: vcvttsd2si %xmm0, %eax
415+
; AVX-NEXT: retq
416+
entry:
417+
%result = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %x,
418+
metadata !"fpexcept.strict") #0
419+
ret i32 %result
420+
}
421+
403422
; Verify that fptoui(%x) isn't simplified when the rounding mode is
404423
; unknown. The expansion should have only one conversion instruction.
405424
; Verify that no gross errors happen.

0 commit comments

Comments
 (0)