2013-08-23 20:39:19 +00:00
|
|
|
; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse4.1 | FileCheck %s
|
2011-09-18 10:39:32 +00:00
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_2_i8:
|
2011-09-18 10:39:32 +00:00
|
|
|
; A single 16-bit load
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxbq
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_2_i16:
|
2011-09-18 10:39:32 +00:00
|
|
|
; Read 32-bits
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxwq
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_2_i32:
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxdq
|
2014-07-24 22:15:28 +00:00
|
|
|
;CHECK: paddd
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_4_i8:
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxbd
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_4_i16:
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxwd
|
2014-07-24 22:15:28 +00:00
|
|
|
;CHECK: paddw
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|
|
|
|
|
2013-07-18 22:47:09 +00:00
|
|
|
;CHECK-LABEL: load_8_i8:
|
2012-10-23 17:34:00 +00:00
|
|
|
;CHECK: pmovzxbw
|
2014-07-24 22:15:28 +00:00
|
|
|
;CHECK: paddb
|
2011-09-18 10:39:32 +00:00
|
|
|
;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
|
|
|
|
}
|