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
35 define i64 @test3(i64 %A) {
36 %1 = bitcast i64 %A to <2 x float>
37 %add = fadd <2 x float> %1, <float 3.0, float 5.0>
38 %2 = bitcast <2 x float> %add to i64
48 define i64 @test4(i64 %A) {
49 %1 = bitcast i64 %A to <2 x i32>
50 %add = add <2 x i32> %1, <i32 3, i32 5>
51 %2 = bitcast <2 x i32> %add to i64
54 ; FIXME: At the moment we still produce the sequence pshufd+paddq+pshufd.
55 ; Ideally, we should fold that sequence into a single paddd.
64 define double @test5(double %A) {
65 %1 = bitcast double %A to <2 x float>
66 %add = fadd <2 x float> %1, <float 3.0, float 5.0>
67 %2 = bitcast <2 x float> %add to double
75 define double @test6(double %A) {
76 %1 = bitcast double %A to <4 x i16>
77 %add = add <4 x i16> %1, <i16 3, i16 4, i16 5, i16 6>
78 %2 = bitcast <4 x i16> %add to double
81 ; FIXME: Ideally we should be able to fold the entire body of @test6 into a
82 ; single paddw instruction.
92 define double @test7(double %A, double %B) {
93 %1 = bitcast double %A to <4 x i16>
94 %2 = bitcast double %B to <4 x i16>
95 %add = add <4 x i16> %1, %2
96 %3 = bitcast <4 x i16> %add to double
101 ; CHECK-NOT: punpcklwd
106 define double @test8(double %A) {
107 %1 = bitcast double %A to <8 x i8>
108 %add = add <8 x i8> %1, <i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10>
109 %2 = bitcast <8 x i8> %add to double
112 ; FIXME: Ideally we should be able to fold the entire body of @test8 into a
113 ; single paddb instruction. At the moment we produce the sequence
114 ; pshufd+paddw+pshufd.
124 define double @test9(double %A, double %B) {
125 %1 = bitcast double %A to <8 x i8>
126 %2 = bitcast double %B to <8 x i8>
127 %add = add <8 x i8> %1, %2
128 %3 = bitcast <8 x i8> %add to double
133 ; CHECK-NOT: punpcklbw