[X86] SRL non-LSB extracts when folding to truncating broadcasts.
[oota-llvm.git] / test / CodeGen / X86 / pseudo_cmov_lower1.ll
1 ; RUN: llc < %s -mtriple=i386-linux-gnu -mattr=+sse2 -o - | FileCheck %s 
2 ; RUN: llc < %s -mtriple=x86_64-linux-gnu -o - | FileCheck %s 
3
4 ; This test checks that only a single jae gets generated in the final code
5 ; for lowering the CMOV pseudos that get created for this IR.
6 ; CHECK-LABEL: foo1:
7 ; CHECK: jae
8 ; CHECK-NOT: jae
9 define double @foo1(float %p1, double %p2, double %p3) nounwind {
10 entry:
11   %c1 = fcmp oge float %p1, 0.000000e+00
12   %d0 = fadd double %p2, 1.25e0
13   %d1 = fadd double %p3, 1.25e0
14   %d2 = select i1 %c1, double %d0, double %d1
15   %d3 = select i1 %c1, double %d0, double %p2
16   %d4 = select i1 %c1, double %p3, double %d1
17   %d5 = fsub double %d2, %d3
18   %d6 = fadd double %d5, %d4
19   ret double %d6
20 }
21
22 ; This test checks that only a single jae gets generated in the final code
23 ; for lowering the CMOV pseudos that get created for this IR.
24 ; CHECK-LABEL: foo2:
25 ; CHECK: jae
26 ; CHECK-NOT: jae
27 define float @foo2(float %p1, float %p2, float %p3) nounwind {
28 entry:
29   %c1 = fcmp oge float %p1, 0.000000e+00
30   %d0 = fadd float %p2, 1.25e0
31   %d1 = fadd float %p3, 1.25e0
32   %d2 = select i1 %c1, float %d0, float %d1
33   %d3 = select i1 %c1, float %d1, float %p2
34   %d4 = select i1 %c1, float %d0, float %p3
35   %d5 = fsub float %d2, %d3
36   %d6 = fadd float %d5, %d4
37   ret float %d6
38 }
39