1 ; RUN: llc < %s -march=x86-64 -mcpu=core2 -mattr=+sse2 | FileCheck %s
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
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.
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
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.
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
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
61 ; FIXME: At the moment we still produce the sequence pshufd+paddq+pshufd.
62 ; Ideally, we should fold that sequence into a single paddd.
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
82 define double @test6(double %A) {
83 %1 = bitcast double %A to <4 x i16>
84 %add = add <4 x i16> %1, <i16 3, i16 4, i16 5, i16 6>
85 %2 = bitcast <4 x i16> %add to double
88 ; FIXME: Ideally we should be able to fold the entire body of @test6 into a
89 ; single paddw instruction.
99 define double @test7(double %A, double %B) {
100 %1 = bitcast double %A to <4 x i16>
101 %2 = bitcast double %B to <4 x i16>
102 %add = add <4 x i16> %1, %2
103 %3 = bitcast <4 x i16> %add to double
106 ; FIXME: Ideally we should be able to fold the entire body of @test7 into a
107 ; single 'paddw %xmm1, %xmm0' instruction. At the moment we produce the
108 ; sequence pshufd+pshufd+paddd+pshufd.
113 ; CHECK-NEXT: punpcklwd
119 define double @test8(double %A) {
120 %1 = bitcast double %A to <8 x i8>
121 %add = add <8 x i8> %1, <i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10>
122 %2 = bitcast <8 x i8> %add to double
125 ; FIXME: Ideally we should be able to fold the entire body of @test8 into a
126 ; single paddb instruction. At the moment we produce the sequence
127 ; pshufd+paddw+pshufd.
137 define double @test9(double %A, double %B) {
138 %1 = bitcast double %A to <8 x i8>
139 %2 = bitcast double %B to <8 x i8>
140 %add = add <8 x i8> %1, %2
141 %3 = bitcast <8 x i8> %add to double
144 ; FIXME: Ideally we should be able to fold the entire body of @test9 into a
145 ; single 'paddb %xmm1, %xmm0' instruction. At the moment we produce the
146 ; sequence pshufd+pshufd+paddw+pshufd.
151 ; CHECK-NEXT: punpcklbw