1 ; RUN: llc -mtriple=arm-eabi -mattr=+neon %s -o - | FileCheck %s
3 define <8 x i8> @vshrns8(<8 x i16>* %A) nounwind {
6 %tmp1 = load <8 x i16>, <8 x i16>* %A
7 %tmp2 = lshr <8 x i16> %tmp1, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
8 %tmp3 = trunc <8 x i16> %tmp2 to <8 x i8>
12 define <4 x i16> @vshrns16(<4 x i32>* %A) nounwind {
13 ;CHECK-LABEL: vshrns16:
15 %tmp1 = load <4 x i32>, <4 x i32>* %A
16 %tmp2 = ashr <4 x i32> %tmp1, <i32 16, i32 16, i32 16, i32 16>
17 %tmp3 = trunc <4 x i32> %tmp2 to <4 x i16>
21 define <2 x i32> @vshrns32(<2 x i64>* %A) nounwind {
22 ;CHECK-LABEL: vshrns32:
24 %tmp1 = load <2 x i64>, <2 x i64>* %A
25 %tmp2 = ashr <2 x i64> %tmp1, <i64 32, i64 32>
26 %tmp3 = trunc <2 x i64> %tmp2 to <2 x i32>
30 define <8 x i8> @vshrns8_bad(<8 x i16>* %A) nounwind {
31 ; CHECK-LABEL: vshrns8_bad:
34 %tmp1 = load <8 x i16>, <8 x i16>* %A
35 %tmp2 = ashr <8 x i16> %tmp1, <i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9, i16 9>
36 %tmp3 = trunc <8 x i16> %tmp2 to <8 x i8>
40 define <4 x i16> @vshrns16_bad(<4 x i32>* %A) nounwind {
41 ; CHECK-LABEL: vshrns16_bad:
44 %tmp1 = load <4 x i32>, <4 x i32>* %A
45 %tmp2 = lshr <4 x i32> %tmp1, <i32 17, i32 17, i32 17, i32 17>
46 %tmp3 = trunc <4 x i32> %tmp2 to <4 x i16>
50 define <2 x i32> @vshrns32_bad(<2 x i64>* %A) nounwind {
51 ; CHECK-LABEL: vshrns32_bad:
54 %tmp1 = load <2 x i64>, <2 x i64>* %A
55 %tmp2 = lshr <2 x i64> %tmp1, <i64 33, i64 33>
56 %tmp3 = trunc <2 x i64> %tmp2 to <2 x i32>
60 define <8 x i8> @vrshrns8(<8 x i16>* %A) nounwind {
61 ;CHECK-LABEL: vrshrns8:
63 %tmp1 = load <8 x i16>, <8 x i16>* %A
64 %tmp2 = call <8 x i8> @llvm.arm.neon.vrshiftn.v8i8(<8 x i16> %tmp1, <8 x i16> < i16 -8, i16 -8, i16 -8, i16 -8, i16 -8, i16 -8, i16 -8, i16 -8 >)
68 define <4 x i16> @vrshrns16(<4 x i32>* %A) nounwind {
69 ;CHECK-LABEL: vrshrns16:
71 %tmp1 = load <4 x i32>, <4 x i32>* %A
72 %tmp2 = call <4 x i16> @llvm.arm.neon.vrshiftn.v4i16(<4 x i32> %tmp1, <4 x i32> < i32 -16, i32 -16, i32 -16, i32 -16 >)
76 define <2 x i32> @vrshrns32(<2 x i64>* %A) nounwind {
77 ;CHECK-LABEL: vrshrns32:
79 %tmp1 = load <2 x i64>, <2 x i64>* %A
80 %tmp2 = call <2 x i32> @llvm.arm.neon.vrshiftn.v2i32(<2 x i64> %tmp1, <2 x i64> < i64 -32, i64 -32 >)
84 declare <8 x i8> @llvm.arm.neon.vrshiftn.v8i8(<8 x i16>, <8 x i16>) nounwind readnone
85 declare <4 x i16> @llvm.arm.neon.vrshiftn.v4i16(<4 x i32>, <4 x i32>) nounwind readnone
86 declare <2 x i32> @llvm.arm.neon.vrshiftn.v2i32(<2 x i64>, <2 x i64>) nounwind readnone