1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; FIXME: Expansion for f80
3 ; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck -check-prefixes=X64 %s
4 ; XUN: llc -mtriple=i386-pc-win32 < %s | FileCheck -check-prefix=X64 %s
6 define { x86_fp80, i32 } @test_frexp_f80_i32(x86_fp80 %a) {
7 ; X64-LABEL: test_frexp_f80_i32:
9 ; X64-NEXT: subq $24, %rsp
10 ; X64-NEXT: .cfi_def_cfa_offset 32
11 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
12 ; X64-NEXT: fstpt (%rsp)
13 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rdi
14 ; X64-NEXT: callq frexpl@PLT
15 ; X64-NEXT: movl {{[0-9]+}}(%rsp), %eax
16 ; X64-NEXT: addq $24, %rsp
17 ; X64-NEXT: .cfi_def_cfa_offset 8
19 %result = call { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80 %a)
20 ret { x86_fp80, i32 } %result
23 define x86_fp80 @test_frexp_f80_i32_only_use_fract(x86_fp80 %a) {
24 ; X64-LABEL: test_frexp_f80_i32_only_use_fract:
26 ; X64-NEXT: subq $24, %rsp
27 ; X64-NEXT: .cfi_def_cfa_offset 32
28 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
29 ; X64-NEXT: fstpt (%rsp)
30 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rdi
31 ; X64-NEXT: callq frexpl@PLT
32 ; X64-NEXT: addq $24, %rsp
33 ; X64-NEXT: .cfi_def_cfa_offset 8
35 %result = call { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80 %a)
36 %result.0 = extractvalue { x86_fp80, i32 } %result, 0
37 ret x86_fp80 %result.0
40 define x86_fp80 @test_frexp_f80_i32_only_use_fract_math(x86_fp80 %a) {
41 ; X64-LABEL: test_frexp_f80_i32_only_use_fract_math:
43 ; X64-NEXT: subq $24, %rsp
44 ; X64-NEXT: .cfi_def_cfa_offset 32
45 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
46 ; X64-NEXT: fstpt (%rsp)
47 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rdi
48 ; X64-NEXT: callq frexpl@PLT
49 ; X64-NEXT: fadd %st, %st(0)
50 ; X64-NEXT: addq $24, %rsp
51 ; X64-NEXT: .cfi_def_cfa_offset 8
53 %result = call { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80 %a)
54 %result.0 = extractvalue { x86_fp80, i32 } %result, 0
55 %add = fadd x86_fp80 %result.0,%result.0
59 define i32 @test_frexp_f80_i32_only_use_exp(x86_fp80 %a) {
60 ; X64-LABEL: test_frexp_f80_i32_only_use_exp:
62 ; X64-NEXT: subq $24, %rsp
63 ; X64-NEXT: .cfi_def_cfa_offset 32
64 ; X64-NEXT: fldt {{[0-9]+}}(%rsp)
65 ; X64-NEXT: fstpt (%rsp)
66 ; X64-NEXT: leaq {{[0-9]+}}(%rsp), %rdi
67 ; X64-NEXT: callq frexpl@PLT
68 ; X64-NEXT: fstp %st(0)
69 ; X64-NEXT: movl {{[0-9]+}}(%rsp), %eax
70 ; X64-NEXT: addq $24, %rsp
71 ; X64-NEXT: .cfi_def_cfa_offset 8
73 %result = call { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80 %a)
74 %result.0 = extractvalue { x86_fp80, i32 } %result, 1
78 declare { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80) #0
80 attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }