Skip to content

Commit 71093b8

Browse files
committed
[X86] Add modf test using fp128 (NFC)
1 parent c8c271a commit 71093b8

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

llvm/test/CodeGen/X86/fp128-libcalls.ll

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,3 +2403,112 @@ define fp128 @Test128Tanh(fp128 %a) nounwind {
24032403
%x = call fp128 @llvm.tanh.f128(fp128 %a)
24042404
ret fp128 %x
24052405
}
2406+
2407+
define { fp128, fp128 } @Test128Modf(fp128 %a) nounwind {
2408+
; ANDROID-LABEL: Test128Modf:
2409+
; ANDROID: # %bb.0:
2410+
; ANDROID-NEXT: subq $24, %rsp
2411+
; ANDROID-NEXT: movq %rsp, %rdi
2412+
; ANDROID-NEXT: callq modfl@PLT
2413+
; ANDROID-NEXT: movaps (%rsp), %xmm1
2414+
; ANDROID-NEXT: addq $24, %rsp
2415+
; ANDROID-NEXT: retq
2416+
;
2417+
; GNU-LABEL: Test128Modf:
2418+
; GNU: # %bb.0:
2419+
; GNU-NEXT: subq $24, %rsp
2420+
; GNU-NEXT: movq %rsp, %rdi
2421+
; GNU-NEXT: callq modfl@PLT
2422+
; GNU-NEXT: movaps (%rsp), %xmm1
2423+
; GNU-NEXT: addq $24, %rsp
2424+
; GNU-NEXT: retq
2425+
;
2426+
; X86-LABEL: Test128Modf:
2427+
; X86: # %bb.0:
2428+
; X86-NEXT: pushl %esi
2429+
; X86-NEXT: subl $40, %esp
2430+
; X86-NEXT: movl {{[0-9]+}}(%esp), %esi
2431+
; X86-NEXT: subl $8, %esp
2432+
; X86-NEXT: leal {{[0-9]+}}(%esp), %eax
2433+
; X86-NEXT: leal {{[0-9]+}}(%esp), %ecx
2434+
; X86-NEXT: pushl %eax
2435+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
2436+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
2437+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
2438+
; X86-NEXT: pushl {{[0-9]+}}(%esp)
2439+
; X86-NEXT: pushl %ecx
2440+
; X86-NEXT: calll modfl
2441+
; X86-NEXT: addl $28, %esp
2442+
; X86-NEXT: movaps (%esp), %xmm0
2443+
; X86-NEXT: movaps {{[0-9]+}}(%esp), %xmm1
2444+
; X86-NEXT: movaps %xmm1, 16(%esi)
2445+
; X86-NEXT: movaps %xmm0, (%esi)
2446+
; X86-NEXT: movl %esi, %eax
2447+
; X86-NEXT: addl $40, %esp
2448+
; X86-NEXT: popl %esi
2449+
; X86-NEXT: retl $4
2450+
;
2451+
; WIN-LABEL: Test128Modf:
2452+
; WIN: # %bb.0:
2453+
; WIN-NEXT: subq $72, %rsp
2454+
; WIN-NEXT: movaps (%rcx), %xmm0
2455+
; WIN-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)
2456+
; WIN-NEXT: leaq {{[0-9]+}}(%rsp), %rcx
2457+
; WIN-NEXT: leaq {{[0-9]+}}(%rsp), %rdx
2458+
; WIN-NEXT: callq modfl
2459+
; WIN-NEXT: movaps {{[0-9]+}}(%rsp), %xmm1
2460+
; WIN-NEXT: addq $72, %rsp
2461+
; WIN-NEXT: retq
2462+
;
2463+
; WIN-X86-LABEL: Test128Modf:
2464+
; WIN-X86: # %bb.0:
2465+
; WIN-X86-NEXT: pushl %ebp
2466+
; WIN-X86-NEXT: movl %esp, %ebp
2467+
; WIN-X86-NEXT: pushl %ebx
2468+
; WIN-X86-NEXT: pushl %edi
2469+
; WIN-X86-NEXT: pushl %esi
2470+
; WIN-X86-NEXT: andl $-16, %esp
2471+
; WIN-X86-NEXT: subl $64, %esp
2472+
; WIN-X86-NEXT: movl 8(%ebp), %esi
2473+
; WIN-X86-NEXT: leal {{[0-9]+}}(%esp), %eax
2474+
; WIN-X86-NEXT: leal {{[0-9]+}}(%esp), %ecx
2475+
; WIN-X86-NEXT: pushl %eax
2476+
; WIN-X86-NEXT: pushl 24(%ebp)
2477+
; WIN-X86-NEXT: pushl 20(%ebp)
2478+
; WIN-X86-NEXT: pushl 16(%ebp)
2479+
; WIN-X86-NEXT: pushl 12(%ebp)
2480+
; WIN-X86-NEXT: pushl %ecx
2481+
; WIN-X86-NEXT: calll _modfl
2482+
; WIN-X86-NEXT: addl $24, %esp
2483+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
2484+
; WIN-X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
2485+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
2486+
; WIN-X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
2487+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
2488+
; WIN-X86-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
2489+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %edi
2490+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %ebx
2491+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
2492+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
2493+
; WIN-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
2494+
; WIN-X86-NEXT: movl %edx, 28(%esi)
2495+
; WIN-X86-NEXT: movl %eax, 24(%esi)
2496+
; WIN-X86-NEXT: movl %ecx, 20(%esi)
2497+
; WIN-X86-NEXT: movl %ebx, 16(%esi)
2498+
; WIN-X86-NEXT: movl %edi, 12(%esi)
2499+
; WIN-X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
2500+
; WIN-X86-NEXT: movl %eax, 8(%esi)
2501+
; WIN-X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
2502+
; WIN-X86-NEXT: movl %eax, 4(%esi)
2503+
; WIN-X86-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
2504+
; WIN-X86-NEXT: movl %eax, (%esi)
2505+
; WIN-X86-NEXT: movl %esi, %eax
2506+
; WIN-X86-NEXT: leal -12(%ebp), %esp
2507+
; WIN-X86-NEXT: popl %esi
2508+
; WIN-X86-NEXT: popl %edi
2509+
; WIN-X86-NEXT: popl %ebx
2510+
; WIN-X86-NEXT: popl %ebp
2511+
; WIN-X86-NEXT: retl
2512+
%x = call { fp128, fp128 } @llvm.modf.f128(fp128 %a)
2513+
ret { fp128, fp128 } %x
2514+
}

0 commit comments

Comments
 (0)