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