1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse2 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=CHECK --check-prefix=SSE41
5 ; A single 16-bit load + a single 16-bit store
6 define void @load_2_i8(ptr %A) {
7 ; SSE2-LABEL: load_2_i8:
9 ; SSE2-NEXT: movzwl (%rdi), %eax
10 ; SSE2-NEXT: movd %eax, %xmm0
11 ; SSE2-NEXT: paddb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
12 ; SSE2-NEXT: movd %xmm0, %eax
13 ; SSE2-NEXT: movw %ax, (%rdi)
16 ; SSE41-LABEL: load_2_i8:
18 ; SSE41-NEXT: movzwl (%rdi), %eax
19 ; SSE41-NEXT: movd %eax, %xmm0
20 ; SSE41-NEXT: paddb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
21 ; SSE41-NEXT: pextrw $0, %xmm0, (%rdi)
23 %T = load <2 x i8>, ptr %A
24 %G = add <2 x i8> %T, <i8 9, i8 7>
25 store <2 x i8> %G, ptr %A
30 define void @load_2_i16(ptr %A) {
31 ; CHECK-LABEL: load_2_i16:
33 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
34 ; CHECK-NEXT: paddw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
35 ; CHECK-NEXT: movd %xmm0, (%rdi)
37 %T = load <2 x i16>, ptr %A
38 %G = add <2 x i16> %T, <i16 9, i16 7>
39 store <2 x i16> %G, ptr %A
43 define void @load_2_i32(ptr %A) {
44 ; CHECK-LABEL: load_2_i32:
46 ; CHECK-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
47 ; CHECK-NEXT: paddd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
48 ; CHECK-NEXT: movq %xmm0, (%rdi)
50 %T = load <2 x i32>, ptr %A
51 %G = add <2 x i32> %T, <i32 9, i32 7>
52 store <2 x i32> %G, ptr %A
56 define void @load_4_i8(ptr %A) {
57 ; CHECK-LABEL: load_4_i8:
59 ; CHECK-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
60 ; CHECK-NEXT: paddb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
61 ; CHECK-NEXT: movd %xmm0, (%rdi)
63 %T = load <4 x i8>, ptr %A
64 %G = add <4 x i8> %T, <i8 1, i8 4, i8 9, i8 7>
65 store <4 x i8> %G, ptr %A
69 define void @load_4_i16(ptr %A) {
70 ; CHECK-LABEL: load_4_i16:
72 ; CHECK-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
73 ; CHECK-NEXT: paddw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
74 ; CHECK-NEXT: movq %xmm0, (%rdi)
76 %T = load <4 x i16>, ptr %A
77 %G = add <4 x i16> %T, <i16 1, i16 4, i16 9, i16 7>
78 store <4 x i16> %G, ptr %A
82 define void @load_8_i8(ptr %A) {
83 ; CHECK-LABEL: load_8_i8:
85 ; CHECK-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
86 ; CHECK-NEXT: paddb %xmm0, %xmm0
87 ; CHECK-NEXT: movq %xmm0, (%rdi)
89 %T = load <8 x i8>, ptr %A
90 %G = add <8 x i8> %T, %T
91 store <8 x i8> %G, ptr %A