1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mcpu=pentium4 | FileCheck %s
4 @f1 = global float 1.000000e+00, align 4
6 define zeroext i1 @_Z9test_log2v() {
7 ; CHECK-LABEL: _Z9test_log2v:
8 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: pushl %eax
10 ; CHECK-NEXT: .cfi_def_cfa_offset 8
14 ; CHECK-NEXT: fxch %st(1)
17 ; CHECK-NEXT: fstps (%esp)
18 ; CHECK-NEXT: xorps %xmm0, %xmm0
19 ; CHECK-NEXT: cmpeqss (%esp), %xmm0
20 ; CHECK-NEXT: movd %xmm0, %eax
21 ; CHECK-NEXT: andl $1, %eax
22 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
23 ; CHECK-NEXT: popl %ecx
24 ; CHECK-NEXT: .cfi_def_cfa_offset 4
27 %0 = load float, ptr @f1, align 4
28 %1 = fpext float %0 to x86_fp80
29 %2 = tail call x86_fp80 asm "fld1; fxch; fyl2x", "={st},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %1)
30 %conv = fptrunc x86_fp80 %2 to float
31 %3 = fcmp oeq float %conv, 0.000000e+00
35 @fpi = external dso_local global float, align 4
37 define zeroext i1 @_Z8test_cosv() {
38 ; CHECK-LABEL: _Z8test_cosv:
39 ; CHECK: # %bb.0: # %entry
40 ; CHECK-NEXT: subl $8, %esp
41 ; CHECK-NEXT: .cfi_def_cfa_offset 12
42 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
43 ; CHECK-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
44 ; CHECK-NEXT: divss {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
45 ; CHECK-NEXT: movss %xmm0, {{[0-9]+}}(%esp)
46 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
47 ; CHECK-NEXT: flds {{[0-9]+}}(%esp)
51 ; CHECK-NEXT: fstps (%esp)
52 ; CHECK-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
53 ; CHECK-NEXT: cmpleps %xmm1, %xmm0
54 ; CHECK-NEXT: cmpleps %xmm2, %xmm1
55 ; CHECK-NEXT: andps %xmm0, %xmm1
56 ; CHECK-NEXT: movd %xmm1, %eax
57 ; CHECK-NEXT: andb $1, %al
58 ; CHECK-NEXT: # kill: def $al killed $al killed $eax
59 ; CHECK-NEXT: addl $8, %esp
60 ; CHECK-NEXT: .cfi_def_cfa_offset 4
63 %0 = load float, ptr @fpi, align 4
64 %div = fdiv float %0, 6.000000e+00
65 %1 = fpext float %div to x86_fp80
66 %2 = tail call x86_fp80 asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %1)
67 %conv = fptrunc x86_fp80 %2 to float
68 %cmp = fcmp ole float %conv, 0x3FEBD70A40000000
69 %cmp1 = fcmp oge float %conv, 0x3FEB851EC0000000
70 %or.cond = and i1 %cmp, %cmp1