aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/trunc-ext-ld-st.ll
blob: 9877d7be169b27c9c07ed38c3cb8ba332873bcd9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse41 | FileCheck %s

;CHECK: load_2_i8
; A single 16-bit load
;CHECK: movzwl
;CHECK: pshufb
;CHECK: paddq
;CHECK: pshufb
; A single 16-bit store
;CHECK: movw
;CHECK: ret

define void @load_2_i8(<2 x i8>* %A)  {
   %T = load <2 x i8>* %A
   %G = add <2 x i8> %T, <i8 9, i8 7>
   store <2 x i8> %G, <2 x i8>* %A
   ret void
} 

;CHECK: load_2_i16
; Read 32-bits
;CHECK: movd
;CHECK: pshufb
;CHECK: paddq
;CHECK: pshufb
;CHECK: movd
;CHECK: ret
define void @load_2_i16(<2 x i16>* %A)  {
   %T = load <2 x i16>* %A
   %G = add <2 x i16> %T, <i16 9, i16 7>
   store <2 x i16> %G, <2 x i16>* %A
   ret void
} 

;CHECK: load_2_i32
;CHECK: pshufd
;CHECK: paddq
;CHECK: pshufd
;CHECK: ret
define void @load_2_i32(<2 x i32>* %A)  {
   %T = load <2 x i32>* %A
   %G = add <2 x i32> %T, <i32 9, i32 7>
   store <2 x i32> %G, <2 x i32>* %A
   ret void
} 

;CHECK: load_4_i8
;CHECK: movd
;CHECK: pshufb
;CHECK: paddd
;CHECK: pshufb
;CHECK: ret
define void @load_4_i8(<4 x i8>* %A)  {
   %T = load <4 x i8>* %A
   %G = add <4 x i8> %T, <i8 1, i8 4, i8 9, i8 7>
   store <4 x i8> %G, <4 x i8>* %A
   ret void
} 

;CHECK: load_4_i16
;CHECK: punpcklwd
;CHECK: paddd
;CHECK: pshufb
;CHECK: ret
define void @load_4_i16(<4 x i16>* %A)  {
   %T = load <4 x i16>* %A
   %G = add <4 x i16> %T, <i16 1, i16 4, i16 9, i16 7>
   store <4 x i16> %G, <4 x i16>* %A
   ret void
} 

;CHECK: load_8_i8
;CHECK: punpcklbw
;CHECK: paddw
;CHECK: pshufb
;CHECK: ret
define void @load_8_i8(<8 x i8>* %A)  {
   %T = load <8 x i8>* %A
   %G = add <8 x i8> %T, %T
   store <8 x i8> %G, <8 x i8>* %A
   ret void
}