ARM64: remove '#' from annotation of add/sub immediate
[oota-llvm.git] / test / CodeGen / X86 / lower-bitcast-v2i32.ll
1 ; RUN: llc < %s -march=x86-64 -mcpu=core2 -mattr=+sse2 | FileCheck %s
2
3
4 define double @test1(double %A) {
5   %1 = bitcast double %A to <2 x i32>
6   %add = add <2 x i32> %1, <i32 3, i32 5>
7   %2 = bitcast <2 x i32> %add to double
8   ret double %2
9 }
10 ; FIXME: Ideally we should be able to fold the entire body of @test1 into a
11 ; single paddd instruction. At the moment we produce the sequence 
12 ; pshufd+paddq+pshufd.
13
14 ; CHECK-LABEL: test1
15 ; CHECK-NOT: movsd
16 ; CHECK: pshufd
17 ; CHECK-NEXT: paddq
18 ; CHECK-NEXT: pshufd
19 ; CHECK-NEXT: ret
20
21
22 define double @test2(double %A, double %B) {
23   %1 = bitcast double %A to <2 x i32>
24   %2 = bitcast double %B to <2 x i32>
25   %add = add <2 x i32> %1, %2
26   %3 = bitcast <2 x i32> %add to double
27   ret double %3
28 }
29 ; FIXME: Ideally we should be able to fold the entire body of @test2 into a
30 ; single 'paddd %xmm1, %xmm0' instruction. At the moment we produce the
31 ; sequence pshufd+pshufd+paddq+pshufd.
32
33 ; CHECK-LABEL: test2
34 ; CHECK-NOT: movsd
35 ; CHECK: pshufd
36 ; CHECK-NEXT: pshufd
37 ; CHECK-NEXT: paddq
38 ; CHECK-NEXT: pshufd
39 ; CHECK-NEXT: ret
40
41
42 define i64 @test3(i64 %A) {
43   %1 = bitcast i64 %A to <2 x float>
44   %add = fadd <2 x float> %1, <float 3.0, float 5.0>
45   %2 = bitcast <2 x float> %add to i64
46   ret i64 %2
47 }
48 ; CHECK-LABEL: test3
49 ; CHECK-NOT: pshufd
50 ; CHECK: addps
51 ; CHECK-NOT: pshufd
52 ; CHECK: ret
53
54
55 define i64 @test4(i64 %A) {
56   %1 = bitcast i64 %A to <2 x i32>
57   %add = add <2 x i32> %1, <i32 3, i32 5>
58   %2 = bitcast <2 x i32> %add to i64
59   ret i64 %2
60 }
61 ; FIXME: At the moment we still produce the sequence pshufd+paddq+pshufd.
62 ; Ideally, we should fold that sequence into a single paddd.
63
64 ; CHECK-LABEL: test4
65 ; CHECK: pshufd
66 ; CHECK-NEXT: paddq
67 ; CHECK-NEXT: pshufd
68 ; CHECK: ret
69
70
71 define double @test5(double %A) {
72   %1 = bitcast double %A to <2 x float>
73   %add = fadd <2 x float> %1, <float 3.0, float 5.0>
74   %2 = bitcast <2 x float> %add to double
75   ret double %2
76 }
77 ; CHECK-LABEL: test5
78 ; CHECK: addps
79 ; CHECK-NEXT: ret
80