blob: 7414b56311d674cea555d25e3f3f0515779dfee7 [file] [log] [blame]
Christophe Lyon073831a2011-01-24 17:37:40 +01001/*
2
Christophe Lyon80902f62013-03-29 16:26:42 +01003Copyright (c) 2009, 2010, 2011, 2013 STMicroelectronics
Christophe Lyon073831a2011-01-24 17:37:40 +01004Written by Christophe Lyon
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22THE SOFTWARE.
23
24*/
25
26#define INSN_NAME vsri
27#define TEST_MSG "VSRI_N"
28
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010029/* Extra tests for functions requiring corner cases tests */
30void vsri_extra(void);
31#define EXTRA_TESTS vsri_extra
32
33#include "ref_vsXi_n.c"
34
35void vsri_extra(void)
36{
37 /* Test cases with maximum shift amount (this amount is different
Christophe Lyon4b5570c2015-01-16 20:47:22 +010038 from vsli). */
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010039
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" */
Christophe Lyonf2053672014-12-16 10:26:00 +010049 TEST_MACRO_ALL_VARIANTS_2_5(VLOAD, vector, buffer);
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010050
51 /* Fill input vector2 with arbitrary values */
Christophe Lyonf2053672014-12-16 10:26:00 +010052 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);
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010072
73 /* Use maximum allowed shift amount */
74 TEST_VSXI_N(INSN_NAME, , int, s, 8, 8, 8);
75 TEST_VSXI_N(INSN_NAME, , int, s, 16, 4, 16);
76 TEST_VSXI_N(INSN_NAME, , int, s, 32, 2, 32);
77 TEST_VSXI_N(INSN_NAME, , int, s, 64, 1, 64);
78 TEST_VSXI_N(INSN_NAME, , uint, u, 8, 8, 8);
79 TEST_VSXI_N(INSN_NAME, , uint, u, 16, 4, 16);
80 TEST_VSXI_N(INSN_NAME, , uint, u, 32, 2, 32);
81 TEST_VSXI_N(INSN_NAME, , uint, u, 64, 1, 64);
Christophe Lyon80902f62013-03-29 16:26:42 +010082 TEST_VSXI_N(INSN_NAME, , poly, p, 8, 8, 8);
83 TEST_VSXI_N(INSN_NAME, , poly, p, 16, 4, 16);
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010084 TEST_VSXI_N(INSN_NAME, q, int, s, 8, 16, 8);
85 TEST_VSXI_N(INSN_NAME, q, int, s, 16, 8, 16);
86 TEST_VSXI_N(INSN_NAME, q, int, s, 32, 4, 32);
87 TEST_VSXI_N(INSN_NAME, q, int, s, 64, 2, 64);
88 TEST_VSXI_N(INSN_NAME, q, uint, u, 8, 16, 8);
89 TEST_VSXI_N(INSN_NAME, q, uint, u, 16, 8, 16);
90 TEST_VSXI_N(INSN_NAME, q, uint, u, 32, 4, 32);
91 TEST_VSXI_N(INSN_NAME, q, uint, u, 64, 2, 64);
Christophe Lyon80902f62013-03-29 16:26:42 +010092 TEST_VSXI_N(INSN_NAME, q, poly, p, 8, 16, 8);
93 TEST_VSXI_N(INSN_NAME, q, poly, p, 16, 8, 16);
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010094
Christophe Lyoncd2eaa62011-09-22 11:30:19 +020095 dump_results_hex2 (TEST_MSG, " max shift amount");
Christophe Lyonf0ecb5a2011-02-08 18:15:05 +010096}