2014-04-03 18:01:44 +02:00
|
|
|
; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
|
2009-06-23 01:27:02 +02:00
|
|
|
|
|
|
|
define <8 x i16> @vshlls8(<8 x i8>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlls8:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.s8
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%sext = sext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%shift = shl <8 x i16> %sext, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
|
|
|
|
ret <8 x i16> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vshlls16(<4 x i16>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlls16:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.s16
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%sext = sext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%shift = shl <4 x i32> %sext, <i32 15, i32 15, i32 15, i32 15>
|
|
|
|
ret <4 x i32> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vshlls32(<2 x i32>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlls32:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.s32
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%sext = sext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%shift = shl <2 x i64> %sext, <i64 31, i64 31>
|
|
|
|
ret <2 x i64> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <8 x i16> @vshllu8(<8 x i8>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshllu8:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.u8
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%shift = shl <8 x i16> %zext, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
|
|
|
|
ret <8 x i16> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vshllu16(<4 x i16>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshllu16:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.u16
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%shift = shl <4 x i32> %zext, <i32 15, i32 15, i32 15, i32 15>
|
|
|
|
ret <4 x i32> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vshllu32(<2 x i32>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshllu32:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.u32
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%shift = shl <2 x i64> %zext, <i64 31, i64 31>
|
|
|
|
ret <2 x i64> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
; The following tests use the maximum shift count, so the signedness is
|
|
|
|
; irrelevant. Test both signed and unsigned versions.
|
|
|
|
define <8 x i16> @vshlli8(<8 x i8>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlli8:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.i8
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%sext = sext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%shift = shl <8 x i16> %sext, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
|
|
|
|
ret <8 x i16> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vshlli16(<4 x i16>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlli16:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.i16
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%shift = shl <4 x i32> %zext, <i32 16, i32 16, i32 16, i32 16>
|
|
|
|
ret <4 x i32> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i64> @vshlli32(<2 x i32>* %A) nounwind {
|
2013-07-14 08:24:09 +02:00
|
|
|
;CHECK-LABEL: vshlli32:
|
2009-10-09 07:14:48 +02:00
|
|
|
;CHECK: vshll.i32
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%shift = shl <2 x i64> %zext, <i64 32, i64 32>
|
|
|
|
ret <2 x i64> %shift
|
2009-06-23 01:27:02 +02:00
|
|
|
}
|
|
|
|
|
2014-02-10 17:20:29 +01:00
|
|
|
; And these have a shift just out of range so separate vmovl and vshl
|
|
|
|
; instructions are needed.
|
|
|
|
define <8 x i16> @vshllu8_bad(<8 x i8>* %A) nounwind {
|
|
|
|
; CHECK-LABEL: vshllu8_bad:
|
|
|
|
; CHECK: vmovl.u8
|
|
|
|
; CHECK: vshl.i16
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <8 x i8>, <8 x i8>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <8 x i8> %tmp1 to <8 x i16>
|
|
|
|
%shift = shl <8 x i16> %zext, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
|
|
|
|
ret <8 x i16> %shift
|
|
|
|
}
|
|
|
|
|
|
|
|
define <4 x i32> @vshlls16_bad(<4 x i16>* %A) nounwind {
|
|
|
|
; CHECK-LABEL: vshlls16_bad:
|
2017-09-25 21:26:08 +02:00
|
|
|
; CHECK: vmovl.u16
|
2014-02-10 17:20:29 +01:00
|
|
|
; CHECK: vshl.i32
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <4 x i16>, <4 x i16>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%sext = sext <4 x i16> %tmp1 to <4 x i32>
|
|
|
|
%shift = shl <4 x i32> %sext, <i32 17, i32 17, i32 17, i32 17>
|
|
|
|
ret <4 x i32> %shift
|
|
|
|
}
|
2009-06-23 01:27:02 +02:00
|
|
|
|
2014-02-10 17:20:29 +01:00
|
|
|
define <2 x i64> @vshllu32_bad(<2 x i32>* %A) nounwind {
|
|
|
|
; CHECK-LABEL: vshllu32_bad:
|
|
|
|
; CHECK: vmovl.u32
|
|
|
|
; CHECK: vshl.i64
|
2015-02-27 22:17:42 +01:00
|
|
|
%tmp1 = load <2 x i32>, <2 x i32>* %A
|
2014-02-10 17:20:29 +01:00
|
|
|
%zext = zext <2 x i32> %tmp1 to <2 x i64>
|
|
|
|
%shift = shl <2 x i64> %zext, <i64 33, i64 33>
|
|
|
|
ret <2 x i64> %shift
|
|
|
|
}
|