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, float* @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 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 {{.*#+}} xmm1 = mem[0],zero,zero,zero
44 ; CHECK-NEXT: divss {{\.LCPI.*}}, %xmm0
45 ; CHECK-NEXT: movss %xmm0, {{[0-9]+}}(%esp)
46 ; CHECK-NEXT: flds {{[0-9]+}}(%esp)
50 ; CHECK-NEXT: fstps (%esp)
51 ; CHECK-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
52 ; CHECK-NEXT: ucomiss %xmm0, %xmm1
53 ; CHECK-NEXT: setae %cl
54 ; CHECK-NEXT: ucomiss {{\.LCPI.*}}, %xmm0
55 ; CHECK-NEXT: setae %al
56 ; CHECK-NEXT: andb %cl, %al
57 ; CHECK-NEXT: addl $8, %esp
58 ; CHECK-NEXT: .cfi_def_cfa_offset 4
61 %0 = load float, float* @fpi, align 4
62 %div = fdiv float %0, 6.000000e+00
63 %1 = fpext float %div to x86_fp80
64 %2 = tail call x86_fp80 asm "fcos", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %1)
65 %conv = fptrunc x86_fp80 %2 to float
66 %cmp = fcmp ole float %conv, 0x3FEBD70A40000000
67 %cmp1 = fcmp oge float %conv, 0x3FEB851EC0000000
68 %or.cond = and i1 %cmp, %cmp1