[X86] Update test/CodeGen/X86/avg.ll with the help of update_llc_test_checks.py....
[oota-llvm.git] / test / CodeGen / X86 / fp-une-cmp.ll
1 ; RUN: llc < %s -march=x86 -mattr=sse4.1 | FileCheck %s
2 ; <rdar://problem/7859988>
3
4 ; Make sure we don't generate more jumps than we need to. We used to generate
5 ; something like this:
6 ;
7 ;       jne  LBB0_1
8 ;       jnp  LBB0_2
9 ;   LBB0_1:
10 ;       jmp  LBB0_3
11 ;   LBB0_2:
12 ;       addsd ...
13 ;   LBB0_3:
14 ;
15 ; Now we generate this:
16 ;
17 ;       jne  LBB0_2
18 ;       jp   LBB0_2
19 ;       addsd ...
20 ;   LBB0_2:
21
22 ; CHECK:       func
23 ; CHECK:       jne [[LABEL:.*]]
24 ; CHECK-NEXT:  jp  [[LABEL]]
25 ; CHECK-NOT:   jmp
26
27 define float @func(float %x, float %y) nounwind readnone optsize ssp {
28 entry:
29   %0 = fpext float %x to double
30   %1 = fpext float %y to double
31   %2 = fmul double %0, %1
32   %3 = fcmp une double %2, 0.000000e+00
33   br i1 %3, label %bb2, label %bb1
34
35 bb1:
36   %4 = fadd double %2, -1.000000e+00
37   br label %bb2
38
39 bb2:
40   %.0.in = phi double [ %4, %bb1 ], [ %2, %entry ]
41   %.0 = fptrunc double %.0.in to float
42   ret float %.0
43 }