• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 
3 Copyright (c) 2009, 2010, 2011, 2013 STMicroelectronics
4 Written by Christophe Lyon
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 
24 */
25 
26 #define INSN_NAME vsli
27 #define TEST_MSG "VSLI_N"
28 
29 /* Extra tests for functions requiring corner cases tests */
30 void vsli_extra(void);
31 #define EXTRA_TESTS vsli_extra
32 
33 #include "ref_vsXi_n.c"
34 
vsli_extra(void)35 void vsli_extra(void)
36 {
37     /* Test cases with maximum shift amount (this amount is different
38        from vsri).  */
39 
40   /* With ARM RVCT, we need to declare variables before any executable
41      statement */
42   DECL_VARIABLE_ALL_VARIANTS(vector);
43   DECL_VARIABLE_ALL_VARIANTS(vector2);
44   DECL_VARIABLE_ALL_VARIANTS(vector_res);
45 
46   clean_results ();
47 
48   /* Initialize input "vector" from "buffer"  */
49   TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer);
50 
51   /* Fill input vector2 with arbitrary values */
52   VDUP(vector2, , int, s, 8, 8, 2);
53   VDUP(vector2, , int, s, 16, 4, -4);
54   VDUP(vector2, , int, s, 32, 2, 3);
55   VDUP(vector2, , int, s, 64, 1, 100);
56   VDUP(vector2, , uint, u, 8, 8, 20);
57   VDUP(vector2, , uint, u, 16, 4, 30);
58   VDUP(vector2, , uint, u, 32, 2, 40);
59   VDUP(vector2, , uint, u, 64, 1, 2);
60   VDUP(vector2, , poly, p, 8, 8, 20);
61   VDUP(vector2, , poly, p, 16, 4, 30);
62   VDUP(vector2, q, int, s, 8, 16, -10);
63   VDUP(vector2, q, int, s, 16, 8, -20);
64   VDUP(vector2, q, int, s, 32, 4, -30);
65   VDUP(vector2, q, int, s, 64, 2, 24);
66   VDUP(vector2, q, uint, u, 8, 16, 12);
67   VDUP(vector2, q, uint, u, 16, 8, 3);
68   VDUP(vector2, q, uint, u, 32, 4, 55);
69   VDUP(vector2, q, uint, u, 64, 2, 3);
70   VDUP(vector2, q, poly, p, 8, 16, 12);
71   VDUP(vector2, q, poly, p, 16, 8, 3);
72 
73   /* Use maximum allowed shift amount */
74   TEST_VSXI_N(INSN_NAME, , int, s, 8, 8, 7);
75   TEST_VSXI_N(INSN_NAME, , int, s, 16, 4, 15);
76   TEST_VSXI_N(INSN_NAME, , int, s, 32, 2, 31);
77   TEST_VSXI_N(INSN_NAME, , int, s, 64, 1, 63);
78   TEST_VSXI_N(INSN_NAME, , uint, u, 8, 8, 7);
79   TEST_VSXI_N(INSN_NAME, , uint, u, 16, 4, 15);
80   TEST_VSXI_N(INSN_NAME, , uint, u, 32, 2, 31);
81   TEST_VSXI_N(INSN_NAME, , uint, u, 64, 1, 63);
82   TEST_VSXI_N(INSN_NAME, , poly, p, 8, 8, 7);
83   TEST_VSXI_N(INSN_NAME, , poly, p, 16, 4, 15);
84   TEST_VSXI_N(INSN_NAME, q, int, s, 8, 16, 7);
85   TEST_VSXI_N(INSN_NAME, q, int, s, 16, 8, 15);
86   TEST_VSXI_N(INSN_NAME, q, int, s, 32, 4, 31);
87   TEST_VSXI_N(INSN_NAME, q, int, s, 64, 2, 63);
88   TEST_VSXI_N(INSN_NAME, q, uint, u, 8, 16, 7);
89   TEST_VSXI_N(INSN_NAME, q, uint, u, 16, 8, 15);
90   TEST_VSXI_N(INSN_NAME, q, uint, u, 32, 4, 31);
91   TEST_VSXI_N(INSN_NAME, q, uint, u, 64, 2, 63);
92   TEST_VSXI_N(INSN_NAME, q, poly, p, 8, 16, 7);
93   TEST_VSXI_N(INSN_NAME, q, poly, p, 16, 8, 15);
94 
95   dump_results_hex2 (TEST_MSG, "max shift amount");
96 }
97