2009-09-09 00:09:15 +00:00
|
|
|
; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
|
2009-06-22 23:27:02 +00:00
|
|
|
|
|
|
|
define <8 x i8> @vaddi8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddi8:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i8
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <8 x i8>* %A
|
|
|
|
%tmp2 = load <8 x i8>* %B
|
|
|
|
%tmp3 = add <8 x i8> %tmp1, %tmp2
|
|
|
|
ret <8 x i8> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vaddi16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddi16:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i16
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <4 x i16>* %A
|
|
|
|
%tmp2 = load <4 x i16>* %B
|
|
|
|
%tmp3 = add <4 x i16> %tmp1, %tmp2
|
|
|
|
ret <4 x i16> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vaddi32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddi32:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i32
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <2 x i32>* %A
|
|
|
|
%tmp2 = load <2 x i32>* %B
|
|
|
|
%tmp3 = add <2 x i32> %tmp1, %tmp2
|
|
|
|
ret <2 x i32> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <1 x i64> @vaddi64(<1 x i64>* %A, <1 x i64>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddi64:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i64
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <1 x i64>* %A
|
|
|
|
%tmp2 = load <1 x i64>* %B
|
|
|
|
%tmp3 = add <1 x i64> %tmp1, %tmp2
|
|
|
|
ret <1 x i64> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x float> @vaddf32(<2 x float>* %A, <2 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddf32:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.f32
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <2 x float>* %A
|
|
|
|
%tmp2 = load <2 x float>* %B
|
2010-05-03 22:36:46 +00:00
|
|
|
%tmp3 = fadd <2 x float> %tmp1, %tmp2
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <2 x float> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <16 x i8> @vaddQi8(<16 x i8>* %A, <16 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddQi8:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i8
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <16 x i8>* %A
|
|
|
|
%tmp2 = load <16 x i8>* %B
|
|
|
|
%tmp3 = add <16 x i8> %tmp1, %tmp2
|
|
|
|
ret <16 x i8> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vaddQi16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddQi16:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i16
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <8 x i16>* %A
|
|
|
|
%tmp2 = load <8 x i16>* %B
|
|
|
|
%tmp3 = add <8 x i16> %tmp1, %tmp2
|
|
|
|
ret <8 x i16> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vaddQi32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddQi32:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i32
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <4 x i32>* %A
|
|
|
|
%tmp2 = load <4 x i32>* %B
|
|
|
|
%tmp3 = add <4 x i32> %tmp1, %tmp2
|
|
|
|
ret <4 x i32> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vaddQi64(<2 x i64>* %A, <2 x i64>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddQi64:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.i64
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <2 x i64>* %A
|
|
|
|
%tmp2 = load <2 x i64>* %B
|
|
|
|
%tmp3 = add <2 x i64> %tmp1, %tmp2
|
|
|
|
ret <2 x i64> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x float> @vaddQf32(<4 x float>* %A, <4 x float>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddQf32:
|
2009-08-07 23:45:02 +00:00
|
|
|
;CHECK: vadd.f32
|
2009-06-22 23:27:02 +00:00
|
|
|
%tmp1 = load <4 x float>* %A
|
|
|
|
%tmp2 = load <4 x float>* %B
|
2010-05-03 22:36:46 +00:00
|
|
|
%tmp3 = fadd <4 x float> %tmp1, %tmp2
|
2009-06-22 23:27:02 +00:00
|
|
|
ret <4 x float> %tmp3
|
|
|
|
}
|
2009-10-09 20:20:54 +00:00
|
|
|
|
|
|
|
define <8 x i8> @vaddhni16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddhni16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddhn.i16
|
|
|
|
%tmp1 = load <8 x i16>* %A
|
|
|
|
%tmp2 = load <8 x i16>* %B
|
|
|
|
%tmp3 = call <8 x i8> @llvm.arm.neon.vaddhn.v8i8(<8 x i16> %tmp1, <8 x i16> %tmp2)
|
|
|
|
ret <8 x i8> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vaddhni32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddhni32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddhn.i32
|
|
|
|
%tmp1 = load <4 x i32>* %A
|
|
|
|
%tmp2 = load <4 x i32>* %B
|
|
|
|
%tmp3 = call <4 x i16> @llvm.arm.neon.vaddhn.v4i16(<4 x i32> %tmp1, <4 x i32> %tmp2)
|
|
|
|
ret <4 x i16> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vaddhni64(<2 x i64>* %A, <2 x i64>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddhni64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddhn.i64
|
|
|
|
%tmp1 = load <2 x i64>* %A
|
|
|
|
%tmp2 = load <2 x i64>* %B
|
|
|
|
%tmp3 = call <2 x i32> @llvm.arm.neon.vaddhn.v2i32(<2 x i64> %tmp1, <2 x i64> %tmp2)
|
|
|
|
ret <2 x i32> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <8 x i8> @llvm.arm.neon.vaddhn.v8i8(<8 x i16>, <8 x i16>) nounwind readnone
|
|
|
|
declare <4 x i16> @llvm.arm.neon.vaddhn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
|
|
|
|
declare <2 x i32> @llvm.arm.neon.vaddhn.v2i32(<2 x i64>, <2 x i64>) nounwind readnone
|
|
|
|
|
|
|
|
define <8 x i8> @vraddhni16(<8 x i16>* %A, <8 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vraddhni16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vraddhn.i16
|
|
|
|
%tmp1 = load <8 x i16>* %A
|
|
|
|
%tmp2 = load <8 x i16>* %B
|
|
|
|
%tmp3 = call <8 x i8> @llvm.arm.neon.vraddhn.v8i8(<8 x i16> %tmp1, <8 x i16> %tmp2)
|
|
|
|
ret <8 x i8> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i16> @vraddhni32(<4 x i32>* %A, <4 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vraddhni32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vraddhn.i32
|
|
|
|
%tmp1 = load <4 x i32>* %A
|
|
|
|
%tmp2 = load <4 x i32>* %B
|
|
|
|
%tmp3 = call <4 x i16> @llvm.arm.neon.vraddhn.v4i16(<4 x i32> %tmp1, <4 x i32> %tmp2)
|
|
|
|
ret <4 x i16> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i32> @vraddhni64(<2 x i64>* %A, <2 x i64>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vraddhni64:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vraddhn.i64
|
|
|
|
%tmp1 = load <2 x i64>* %A
|
|
|
|
%tmp2 = load <2 x i64>* %B
|
|
|
|
%tmp3 = call <2 x i32> @llvm.arm.neon.vraddhn.v2i32(<2 x i64> %tmp1, <2 x i64> %tmp2)
|
|
|
|
ret <2 x i32> %tmp3
|
|
|
|
}
|
|
|
|
|
|
|
|
declare <8 x i8> @llvm.arm.neon.vraddhn.v8i8(<8 x i16>, <8 x i16>) nounwind readnone
|
|
|
|
declare <4 x i16> @llvm.arm.neon.vraddhn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
|
|
|
|
declare <2 x i32> @llvm.arm.neon.vraddhn.v2i32(<2 x i64>, <2 x i64>) nounwind readnone
|
|
|
|
|
|
|
|
define <8 x i16> @vaddls8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddls8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.s8
|
|
|
|
%tmp1 = load <8 x i8>* %A
|
|
|
|
%tmp2 = load <8 x i8>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%tmp4 = sext <8 x i8> %tmp2 to <8 x i16>
|
|
|
|
%tmp5 = add <8 x i16> %tmp3, %tmp4
|
|
|
|
ret <8 x i16> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vaddls16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddls16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.s16
|
|
|
|
%tmp1 = load <4 x i16>* %A
|
|
|
|
%tmp2 = load <4 x i16>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%tmp4 = sext <4 x i16> %tmp2 to <4 x i32>
|
|
|
|
%tmp5 = add <4 x i32> %tmp3, %tmp4
|
|
|
|
ret <4 x i32> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vaddls32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddls32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.s32
|
|
|
|
%tmp1 = load <2 x i32>* %A
|
|
|
|
%tmp2 = load <2 x i32>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%tmp4 = sext <2 x i32> %tmp2 to <2 x i64>
|
|
|
|
%tmp5 = add <2 x i64> %tmp3, %tmp4
|
|
|
|
ret <2 x i64> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vaddlu8(<8 x i8>* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddlu8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.u8
|
|
|
|
%tmp1 = load <8 x i8>* %A
|
|
|
|
%tmp2 = load <8 x i8>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%tmp4 = zext <8 x i8> %tmp2 to <8 x i16>
|
|
|
|
%tmp5 = add <8 x i16> %tmp3, %tmp4
|
|
|
|
ret <8 x i16> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vaddlu16(<4 x i16>* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddlu16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.u16
|
|
|
|
%tmp1 = load <4 x i16>* %A
|
|
|
|
%tmp2 = load <4 x i16>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%tmp4 = zext <4 x i16> %tmp2 to <4 x i32>
|
|
|
|
%tmp5 = add <4 x i32> %tmp3, %tmp4
|
|
|
|
ret <4 x i32> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vaddlu32(<2 x i32>* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddlu32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddl.u32
|
|
|
|
%tmp1 = load <2 x i32>* %A
|
|
|
|
%tmp2 = load <2 x i32>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%tmp4 = zext <2 x i32> %tmp2 to <2 x i64>
|
|
|
|
%tmp5 = add <2 x i64> %tmp3, %tmp4
|
|
|
|
ret <2 x i64> %tmp5
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vaddws8(<8 x i16>* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddws8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.s8
|
|
|
|
%tmp1 = load <8 x i16>* %A
|
|
|
|
%tmp2 = load <8 x i8>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <8 x i8> %tmp2 to <8 x i16>
|
|
|
|
%tmp4 = add <8 x i16> %tmp1, %tmp3
|
|
|
|
ret <8 x i16> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vaddws16(<4 x i32>* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddws16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.s16
|
|
|
|
%tmp1 = load <4 x i32>* %A
|
|
|
|
%tmp2 = load <4 x i16>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <4 x i16> %tmp2 to <4 x i32>
|
|
|
|
%tmp4 = add <4 x i32> %tmp1, %tmp3
|
|
|
|
ret <4 x i32> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vaddws32(<2 x i64>* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddws32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.s32
|
|
|
|
%tmp1 = load <2 x i64>* %A
|
|
|
|
%tmp2 = load <2 x i32>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = sext <2 x i32> %tmp2 to <2 x i64>
|
|
|
|
%tmp4 = add <2 x i64> %tmp1, %tmp3
|
|
|
|
ret <2 x i64> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vaddwu8(<8 x i16>* %A, <8 x i8>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddwu8:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.u8
|
|
|
|
%tmp1 = load <8 x i16>* %A
|
|
|
|
%tmp2 = load <8 x i8>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <8 x i8> %tmp2 to <8 x i16>
|
|
|
|
%tmp4 = add <8 x i16> %tmp1, %tmp3
|
|
|
|
ret <8 x i16> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vaddwu16(<4 x i32>* %A, <4 x i16>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddwu16:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.u16
|
|
|
|
%tmp1 = load <4 x i32>* %A
|
|
|
|
%tmp2 = load <4 x i16>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <4 x i16> %tmp2 to <4 x i32>
|
|
|
|
%tmp4 = add <4 x i32> %tmp1, %tmp3
|
|
|
|
ret <4 x i32> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vaddwu32(<2 x i64>* %A, <2 x i32>* %B) nounwind {
|
2013-07-14 06:24:09 +00:00
|
|
|
;CHECK-LABEL: vaddwu32:
|
2009-10-09 20:20:54 +00:00
|
|
|
;CHECK: vaddw.u32
|
|
|
|
%tmp1 = load <2 x i64>* %A
|
|
|
|
%tmp2 = load <2 x i32>* %B
|
2010-08-29 05:57:34 +00:00
|
|
|
%tmp3 = zext <2 x i32> %tmp2 to <2 x i64>
|
|
|
|
%tmp4 = add <2 x i64> %tmp1, %tmp3
|
|
|
|
ret <2 x i64> %tmp4
|
2009-10-09 20:20:54 +00:00
|
|
|
}
|