1; RUN: llc -mtriple=x86_64-none-linux -fast-isel -fast-isel-abort=1 -mattr=+sse2 < %s | FileCheck %s
2; RUN: llc -mtriple=i686-none-linux -fast-isel -fast-isel-abort=1 -mattr=+sse2 < %s | FileCheck %s
3
4define i32 @test_store_32(i32* nocapture %addr, i32 %value) {
5entry:
6  store i32 %value, i32* %addr, align 1
7  ret i32 %value
8}
9
10; CHECK: ret
11
12define i16 @test_store_16(i16* nocapture %addr, i16 %value) {
13entry:
14  store i16 %value, i16* %addr, align 1
15  ret i16 %value
16}
17
18; CHECK: ret
19
20define <4 x i32> @test_store_4xi32(<4 x i32>* nocapture %addr, <4 x i32> %value, <4 x i32> %value2) {
21; CHECK: movdqu
22; CHECK: ret
23  %foo = add <4 x i32> %value, %value2 ; to force integer type on store
24  store <4 x i32> %foo, <4 x i32>* %addr, align 1
25  ret <4 x i32> %foo
26}
27
28define <4 x i32> @test_store_4xi32_aligned(<4 x i32>* nocapture %addr, <4 x i32> %value, <4 x i32> %value2) {
29; CHECK: movdqa
30; CHECK: ret
31  %foo = add <4 x i32> %value, %value2 ; to force integer type on store
32  store <4 x i32> %foo, <4 x i32>* %addr, align 16
33  ret <4 x i32> %foo
34}
35
36define <4 x float> @test_store_4xf32(<4 x float>* nocapture %addr, <4 x float> %value) {
37; CHECK: movups
38; CHECK: ret
39  store <4 x float> %value, <4 x float>* %addr, align 1
40  ret <4 x float> %value
41}
42
43define <4 x float> @test_store_4xf32_aligned(<4 x float>* nocapture %addr, <4 x float> %value) {
44; CHECK: movaps
45; CHECK: ret
46  store <4 x float> %value, <4 x float>* %addr, align 16
47  ret <4 x float> %value
48}
49
50define <2 x double> @test_store_2xf64(<2 x double>* nocapture %addr, <2 x double> %value, <2 x double> %value2) {
51; CHECK: movupd
52; CHECK: ret
53  %foo = fadd <2 x double> %value, %value2 ; to force dobule type on store
54  store <2 x double> %foo, <2 x double>* %addr, align 1
55  ret <2 x double> %foo
56}
57
58define <2 x double> @test_store_2xf64_aligned(<2 x double>* nocapture %addr, <2 x double> %value, <2 x double> %value2) {
59; CHECK: movapd
60; CHECK: ret
61  %foo = fadd <2 x double> %value, %value2 ; to force dobule type on store
62  store <2 x double> %foo, <2 x double>* %addr, align 16
63  ret <2 x double> %foo
64}
65