|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc -mtriple=i386-pc-win32 < %s | FileCheck -check-prefix=WIN32 %s |
| 3 | +; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck -check-prefixes=X64 %s |
| 4 | + |
| 5 | +; On 32-bit windows this should be promoted to a call to modf (not modff). |
| 6 | +define { float, float } @test_modf_f32(float %a) { |
| 7 | +; WIN32-LABEL: test_modf_f32: |
| 8 | +; WIN32: # %bb.0: |
| 9 | +; WIN32-NEXT: pushl %ebp |
| 10 | +; WIN32-NEXT: movl %esp, %ebp |
| 11 | +; WIN32-NEXT: andl $-8, %esp |
| 12 | +; WIN32-NEXT: subl $32, %esp |
| 13 | +; WIN32-NEXT: leal {{[0-9]+}}(%esp), %eax |
| 14 | +; WIN32-NEXT: movl %eax, {{[0-9]+}}(%esp) |
| 15 | +; WIN32-NEXT: flds 8(%ebp) |
| 16 | +; WIN32-NEXT: fstpl (%esp) |
| 17 | +; WIN32-NEXT: calll _modf |
| 18 | +; WIN32-NEXT: fstps {{[0-9]+}}(%esp) |
| 19 | +; WIN32-NEXT: fldl {{[0-9]+}}(%esp) |
| 20 | +; WIN32-NEXT: fstps {{[0-9]+}}(%esp) |
| 21 | +; WIN32-NEXT: flds {{[0-9]+}}(%esp) |
| 22 | +; WIN32-NEXT: flds {{[0-9]+}}(%esp) |
| 23 | +; WIN32-NEXT: fxch %st(1) |
| 24 | +; WIN32-NEXT: movl %ebp, %esp |
| 25 | +; WIN32-NEXT: popl %ebp |
| 26 | +; WIN32-NEXT: retl |
| 27 | +; |
| 28 | +; X64-LABEL: test_modf_f32: |
| 29 | +; X64: # %bb.0: |
| 30 | +; X64-NEXT: pushq %rax |
| 31 | +; X64-NEXT: .cfi_def_cfa_offset 16 |
| 32 | +; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rdi |
| 33 | +; X64-NEXT: callq modff@PLT |
| 34 | +; X64-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero |
| 35 | +; X64-NEXT: popq %rax |
| 36 | +; X64-NEXT: .cfi_def_cfa_offset 8 |
| 37 | +; X64-NEXT: retq |
| 38 | + %result = call { float, float } @llvm.modf.f32(float %a) |
| 39 | + ret { float, float } %result |
| 40 | +} |
0 commit comments