xref: /aosp_15_r20/external/arm-neon-tests/ref_vqrshl.c (revision f37826520a923688f9e110915f3811e385d8b6d1)
1*f3782652STreehugger Robot /*
2*f3782652STreehugger Robot 
3*f3782652STreehugger Robot Copyright (c) 2009, 2010, 2011, 2012 STMicroelectronics
4*f3782652STreehugger Robot Written by Christophe Lyon
5*f3782652STreehugger Robot 
6*f3782652STreehugger Robot Permission is hereby granted, free of charge, to any person obtaining a copy
7*f3782652STreehugger Robot of this software and associated documentation files (the "Software"), to deal
8*f3782652STreehugger Robot in the Software without restriction, including without limitation the rights
9*f3782652STreehugger Robot to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10*f3782652STreehugger Robot copies of the Software, and to permit persons to whom the Software is
11*f3782652STreehugger Robot furnished to do so, subject to the following conditions:
12*f3782652STreehugger Robot 
13*f3782652STreehugger Robot The above copyright notice and this permission notice shall be included in
14*f3782652STreehugger Robot all copies or substantial portions of the Software.
15*f3782652STreehugger Robot 
16*f3782652STreehugger Robot THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17*f3782652STreehugger Robot IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18*f3782652STreehugger Robot FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19*f3782652STreehugger Robot AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20*f3782652STreehugger Robot LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21*f3782652STreehugger Robot OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22*f3782652STreehugger Robot THE SOFTWARE.
23*f3782652STreehugger Robot 
24*f3782652STreehugger Robot */
25*f3782652STreehugger Robot 
26*f3782652STreehugger Robot #if defined(__arm__) || defined(__aarch64__)
27*f3782652STreehugger Robot #include <arm_neon.h>
28*f3782652STreehugger Robot #else
29*f3782652STreehugger Robot #include "stm-arm-neon.h"
30*f3782652STreehugger Robot #endif
31*f3782652STreehugger Robot 
32*f3782652STreehugger Robot #include "stm-arm-neon-ref.h"
33*f3782652STreehugger Robot 
34*f3782652STreehugger Robot #define INSN vqrshl
35*f3782652STreehugger Robot #define TEST_MSG "VQRSHL/VQRSHLQ"
36*f3782652STreehugger Robot 
37*f3782652STreehugger Robot #define FNNAME1(NAME) void exec_ ## NAME (void)
38*f3782652STreehugger Robot #define FNNAME(NAME) FNNAME1(NAME)
39*f3782652STreehugger Robot 
FNNAME(INSN)40*f3782652STreehugger Robot FNNAME (INSN)
41*f3782652STreehugger Robot {
42*f3782652STreehugger Robot   /* Basic test: v3=vqrshl(v1,v2), then store the result.  */
43*f3782652STreehugger Robot #define TEST_VQRSHL2(INSN, T3, Q, T1, T2, W, N)			\
44*f3782652STreehugger Robot   Set_Neon_Cumulative_Sat(0, VECT_VAR(vector_res, T1, W, N));	\
45*f3782652STreehugger Robot   VECT_VAR(vector_res, T1, W, N) =				\
46*f3782652STreehugger Robot     INSN##Q##_##T2##W(VECT_VAR(vector, T1, W, N),		\
47*f3782652STreehugger Robot 		      VECT_VAR(vector_shift, T3, W, N));	\
48*f3782652STreehugger Robot   vst1##Q##_##T2##W(VECT_VAR(result, T1, W, N),			\
49*f3782652STreehugger Robot 		    VECT_VAR(vector_res, T1, W, N));		\
50*f3782652STreehugger Robot   dump_neon_cumulative_sat(TEST_MSG, xSTR(INSN##Q##_##T2##W),	\
51*f3782652STreehugger Robot 			   xSTR(T1), W, N)
52*f3782652STreehugger Robot 
53*f3782652STreehugger Robot   /* Two auxliary macros are necessary to expand INSN */
54*f3782652STreehugger Robot #define TEST_VQRSHL1(INSN, T3, Q, T1, T2, W, N)	\
55*f3782652STreehugger Robot   TEST_VQRSHL2(INSN, T3, Q, T1, T2, W, N)
56*f3782652STreehugger Robot 
57*f3782652STreehugger Robot #define TEST_VQRSHL(T3, Q, T1, T2, W, N)	\
58*f3782652STreehugger Robot   TEST_VQRSHL1(INSN, T3, Q, T1, T2, W, N)
59*f3782652STreehugger Robot 
60*f3782652STreehugger Robot 
61*f3782652STreehugger Robot   /* With ARM RVCT, we need to declare variables before any executable
62*f3782652STreehugger Robot      statement */
63*f3782652STreehugger Robot   DECL_VARIABLE_ALL_VARIANTS(vector);
64*f3782652STreehugger Robot   DECL_VARIABLE_ALL_VARIANTS(vector_res);
65*f3782652STreehugger Robot 
66*f3782652STreehugger Robot   DECL_VARIABLE_SIGNED_VARIANTS(vector_shift);
67*f3782652STreehugger Robot 
68*f3782652STreehugger Robot   clean_results ();
69*f3782652STreehugger Robot 
70*f3782652STreehugger Robot   /* Fill input vector with 0, to check saturation on limits */
71*f3782652STreehugger Robot   VDUP(vector, , int, s, 8, 8, 0);
72*f3782652STreehugger Robot   VDUP(vector, , int, s, 16, 4, 0);
73*f3782652STreehugger Robot   VDUP(vector, , int, s, 32, 2, 0);
74*f3782652STreehugger Robot   VDUP(vector, , int, s, 64, 1, 0);
75*f3782652STreehugger Robot   VDUP(vector, , uint, u, 8, 8, 0);
76*f3782652STreehugger Robot   VDUP(vector, , uint, u, 16, 4, 0);
77*f3782652STreehugger Robot   VDUP(vector, , uint, u, 32, 2, 0);
78*f3782652STreehugger Robot   VDUP(vector, , uint, u, 64, 1, 0);
79*f3782652STreehugger Robot   VDUP(vector, q, int, s, 8, 16, 0);
80*f3782652STreehugger Robot   VDUP(vector, q, int, s, 16, 8, 0);
81*f3782652STreehugger Robot   VDUP(vector, q, int, s, 32, 4, 0);
82*f3782652STreehugger Robot   VDUP(vector, q, int, s, 64, 2, 0);
83*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 8, 16, 0);
84*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 16, 8, 0);
85*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 32, 4, 0);
86*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 64, 2, 0);
87*f3782652STreehugger Robot 
88*f3782652STreehugger Robot   /* Choose init value arbitrarily, will be used as shift amount */
89*f3782652STreehugger Robot   /* Use values equal or one-less-than the type width to check
90*f3782652STreehugger Robot      behaviour on limits */
91*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, 7);
92*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, 15);
93*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, 31);
94*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, 63);
95*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, 8);
96*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, 16);
97*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, 32);
98*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, 64);
99*f3782652STreehugger Robot 
100*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
101*f3782652STreehugger Robot 	  TEST_MSG " (with input = 0)");
102*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
103*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG, " (with input = 0)");
104*f3782652STreehugger Robot 
105*f3782652STreehugger Robot   /* Use negative shift amounts */
106*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -1);
107*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -2);
108*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -3);
109*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -4);
110*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -7);
111*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -11);
112*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -13);
113*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -20);
114*f3782652STreehugger Robot 
115*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
116*f3782652STreehugger Robot 	  TEST_MSG " (input 0 and negative shift amount)");
117*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
118*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG, " (input 0 and negative shift amount)");
119*f3782652STreehugger Robot 
120*f3782652STreehugger Robot   /* Test again, with predefined input values */
121*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer);
122*f3782652STreehugger Robot 
123*f3782652STreehugger Robot   /* Choose init value arbitrarily, will be used as shift amount */
124*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, 1);
125*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, 3);
126*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, 8);
127*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, 3);
128*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, 10);
129*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, 12);
130*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, 31);
131*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, 63);
132*f3782652STreehugger Robot 
133*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n", TEST_MSG);
134*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
135*f3782652STreehugger Robot   dump_results_hex (TEST_MSG);
136*f3782652STreehugger Robot 
137*f3782652STreehugger Robot   /* Use negative shift amounts */
138*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -2);
139*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -2);
140*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -3);
141*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -4);
142*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -7);
143*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -11);
144*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -13);
145*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -20);
146*f3782652STreehugger Robot 
147*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
148*f3782652STreehugger Robot 	  TEST_MSG " (negative shift amount)");
149*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
150*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG, " (negative shift amount)");
151*f3782652STreehugger Robot 
152*f3782652STreehugger Robot 
153*f3782652STreehugger Robot   /* Fill input vector with max value, to check saturation on limits */
154*f3782652STreehugger Robot   VDUP(vector, , int, s, 8, 8, 0x7F);
155*f3782652STreehugger Robot   VDUP(vector, , int, s, 16, 4, 0x7FFF);
156*f3782652STreehugger Robot   VDUP(vector, , int, s, 32, 2, 0x7FFFFFFF);
157*f3782652STreehugger Robot   VDUP(vector, , int, s, 64, 1, 0x7FFFFFFFFFFFFFFFLL);
158*f3782652STreehugger Robot   VDUP(vector, , uint, u, 8, 8, 0xFF);
159*f3782652STreehugger Robot   VDUP(vector, , uint, u, 16, 4, 0xFFFF);
160*f3782652STreehugger Robot   VDUP(vector, , uint, u, 32, 2, 0xFFFFFFFF);
161*f3782652STreehugger Robot   VDUP(vector, , uint, u, 64, 1, 0xFFFFFFFFFFFFFFFFULL);
162*f3782652STreehugger Robot   VDUP(vector, q, int, s, 8, 16, 0x7F);
163*f3782652STreehugger Robot   VDUP(vector, q, int, s, 16, 8, 0x7FFF);
164*f3782652STreehugger Robot   VDUP(vector, q, int, s, 32, 4, 0x7FFFFFFF);
165*f3782652STreehugger Robot   VDUP(vector, q, int, s, 64, 2, 0x7FFFFFFFFFFFFFFFLL);
166*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 8, 16, 0xFF);
167*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 16, 8, 0xFFFF);
168*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 32, 4, 0xFFFFFFFF);
169*f3782652STreehugger Robot   VDUP(vector, q, uint, u, 64, 2, 0xFFFFFFFFFFFFFFFFULL);
170*f3782652STreehugger Robot 
171*f3782652STreehugger Robot   /* Use -1 shift amount to check cumulative saturation with round_const */
172*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -1);
173*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -1);
174*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -1);
175*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -1);
176*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -1);
177*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -1);
178*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -1);
179*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -1);
180*f3782652STreehugger Robot 
181*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
182*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: shift by -1)");
183*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
184*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
185*f3782652STreehugger Robot 		     " (checking cumulative saturation: shift by -1)");
186*f3782652STreehugger Robot 
187*f3782652STreehugger Robot 
188*f3782652STreehugger Robot   /* Use -3 shift amount to check cumulative saturation with round_const */
189*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -3);
190*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -3);
191*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -3);
192*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -3);
193*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -3);
194*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -3);
195*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -3);
196*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -3);
197*f3782652STreehugger Robot 
198*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
199*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: shift by -3)");
200*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
201*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
202*f3782652STreehugger Robot 		     " (checking cumulative saturation: shift by -3)");
203*f3782652STreehugger Robot 
204*f3782652STreehugger Robot 
205*f3782652STreehugger Robot   /* Use large shift amount  */
206*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, 10);
207*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, 20);
208*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, 40);
209*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, 70);
210*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, 10);
211*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, 20);
212*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, 40);
213*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, 70);
214*f3782652STreehugger Robot 
215*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
216*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: large shift amount)");
217*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
218*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
219*f3782652STreehugger Robot 		     " (checking cumulative saturation: large shift amount)");
220*f3782652STreehugger Robot 
221*f3782652STreehugger Robot 
222*f3782652STreehugger Robot   /* Fill input vector with negative values, to check saturation on limits */
223*f3782652STreehugger Robot   VDUP(vector, , int, s, 8, 8, 0x80);
224*f3782652STreehugger Robot   VDUP(vector, , int, s, 16, 4, 0x8000);
225*f3782652STreehugger Robot   VDUP(vector, , int, s, 32, 2, 0x80000000);
226*f3782652STreehugger Robot   VDUP(vector, , int, s, 64, 1, 0x8000000000000000LL);
227*f3782652STreehugger Robot   VDUP(vector, q, int, s, 8, 16, 0x80);
228*f3782652STreehugger Robot   VDUP(vector, q, int, s, 16, 8, 0x8000);
229*f3782652STreehugger Robot   VDUP(vector, q, int, s, 32, 4, 0x80000000);
230*f3782652STreehugger Robot   VDUP(vector, q, int, s, 64, 2, 0x8000000000000000LL);
231*f3782652STreehugger Robot 
232*f3782652STreehugger Robot   /* Use large shift amount  */
233*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, 10);
234*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, 20);
235*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, 40);
236*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, 70);
237*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, 10);
238*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, 20);
239*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, 40);
240*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, 70);
241*f3782652STreehugger Robot 
242*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
243*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: large shift amount with negative input)");
244*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
245*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
246*f3782652STreehugger Robot 		     " (checking cumulative saturation: large shift amount with negative input)");
247*f3782652STreehugger Robot 
248*f3782652STreehugger Robot 
249*f3782652STreehugger Robot   /* Fill input vector with negative and positive values, to check
250*f3782652STreehugger Robot    * saturation on limits */
251*f3782652STreehugger Robot   VDUP(vector, , int, s, 8, 8, 0x7F);
252*f3782652STreehugger Robot   VDUP(vector, , int, s, 16, 4, 0x7FFF);
253*f3782652STreehugger Robot   VDUP(vector, , int, s, 32, 2, 0x7FFFFFFF);
254*f3782652STreehugger Robot   VDUP(vector, , int, s, 64, 1, 0x7FFFFFFFFFFFFFFFLL);
255*f3782652STreehugger Robot   VDUP(vector, q, int, s, 8, 16, 0x80);
256*f3782652STreehugger Robot   VDUP(vector, q, int, s, 16, 8, 0x8000);
257*f3782652STreehugger Robot   VDUP(vector, q, int, s, 32, 4, 0x80000000);
258*f3782652STreehugger Robot   VDUP(vector, q, int, s, 64, 2, 0x8000000000000000LL);
259*f3782652STreehugger Robot 
260*f3782652STreehugger Robot   /* Use large negative shift amount  */
261*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -10);
262*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -20);
263*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -40);
264*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -70);
265*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -10);
266*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -20);
267*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -40);
268*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -70);
269*f3782652STreehugger Robot 
270*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
271*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: large negative shift amount)");
272*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
273*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
274*f3782652STreehugger Robot 		     " (checking cumulative saturation: large negative shift amount)");
275*f3782652STreehugger Robot 
276*f3782652STreehugger Robot 
277*f3782652STreehugger Robot   /* Fill input vector with 0, to check saturation in case of large
278*f3782652STreehugger Robot    * shift amount */
279*f3782652STreehugger Robot   VDUP(vector, , int, s, 8, 8, 0);
280*f3782652STreehugger Robot   VDUP(vector, , int, s, 16, 4, 0);
281*f3782652STreehugger Robot   VDUP(vector, , int, s, 32, 2, 0);
282*f3782652STreehugger Robot   VDUP(vector, , int, s, 64, 1, 0);
283*f3782652STreehugger Robot   VDUP(vector, q, int, s, 8, 16, 0);
284*f3782652STreehugger Robot   VDUP(vector, q, int, s, 16, 8, 0);
285*f3782652STreehugger Robot   VDUP(vector, q, int, s, 32, 4, 0);
286*f3782652STreehugger Robot   VDUP(vector, q, int, s, 64, 2, 0);
287*f3782652STreehugger Robot 
288*f3782652STreehugger Robot   /* Use large shift amount  */
289*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 8, 8, -10);
290*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 16, 4, -20);
291*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 32, 2, -40);
292*f3782652STreehugger Robot   VDUP(vector_shift, , int, s, 64, 1, -70);
293*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 8, 16, -10);
294*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 16, 8, -20);
295*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 32, 4, -40);
296*f3782652STreehugger Robot   VDUP(vector_shift, q, int, s, 64, 2, -70);
297*f3782652STreehugger Robot 
298*f3782652STreehugger Robot   fprintf(ref_file, "\n%s cumulative saturation output:\n",
299*f3782652STreehugger Robot 	  TEST_MSG " (checking cumulative saturation: large shift amount with 0 input)");
300*f3782652STreehugger Robot   TEST_MACRO_ALL_VARIANTS_1_5(TEST_VQRSHL, int);
301*f3782652STreehugger Robot   dump_results_hex2 (TEST_MSG,
302*f3782652STreehugger Robot 		     " (checking cumulative saturation: large shift amount with 0 input)");
303*f3782652STreehugger Robot }
304