13104
|
1 |
/*
|
|
2 |
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
20 |
* or visit www.oracle.com if you need additional information or have any
|
|
21 |
* questions.
|
|
22 |
*
|
|
23 |
*/
|
|
24 |
|
|
25 |
/**
|
|
26 |
* @test
|
|
27 |
* @bug 7119644
|
|
28 |
* @summary Increase superword's vector size up to 256 bits
|
|
29 |
*
|
|
30 |
* @run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestBooleanVect
|
|
31 |
*/
|
|
32 |
|
|
33 |
public class TestBooleanVect {
|
|
34 |
private static final int ARRLEN = 997;
|
|
35 |
private static final int ITERS = 11000;
|
|
36 |
private static final int OFFSET = 3;
|
|
37 |
private static final int SCALE = 2;
|
|
38 |
private static final int ALIGN_OFF = 8;
|
|
39 |
private static final int UNALIGN_OFF = 5;
|
|
40 |
|
|
41 |
public static void main(String args[]) {
|
|
42 |
System.out.println("Testing Boolean vectors");
|
|
43 |
int errn = test();
|
|
44 |
if (errn > 0) {
|
|
45 |
System.err.println("FAILED: " + errn + " errors");
|
|
46 |
System.exit(97);
|
|
47 |
}
|
|
48 |
System.out.println("PASSED");
|
|
49 |
}
|
|
50 |
|
|
51 |
static int test() {
|
|
52 |
boolean[] a1 = new boolean[ARRLEN];
|
|
53 |
boolean[] a2 = new boolean[ARRLEN];
|
|
54 |
System.out.println("Warmup");
|
|
55 |
for (int i=0; i<ITERS; i++) {
|
|
56 |
test_ci(a1);
|
|
57 |
test_vi(a2, true);
|
|
58 |
test_cp(a1, a2);
|
|
59 |
test_2ci(a1, a2);
|
|
60 |
test_2vi(a1, a2, true, true);
|
|
61 |
test_ci_neg(a1);
|
|
62 |
test_vi_neg(a2, true);
|
|
63 |
test_cp_neg(a1, a2);
|
|
64 |
test_2ci_neg(a1, a2);
|
|
65 |
test_2vi_neg(a1, a2, true, true);
|
|
66 |
test_ci_oppos(a1);
|
|
67 |
test_vi_oppos(a2, true);
|
|
68 |
test_cp_oppos(a1, a2);
|
|
69 |
test_2ci_oppos(a1, a2);
|
|
70 |
test_2vi_oppos(a1, a2, true, true);
|
|
71 |
test_ci_off(a1);
|
|
72 |
test_vi_off(a2, true);
|
|
73 |
test_cp_off(a1, a2);
|
|
74 |
test_2ci_off(a1, a2);
|
|
75 |
test_2vi_off(a1, a2, true, true);
|
|
76 |
test_ci_inv(a1, OFFSET);
|
|
77 |
test_vi_inv(a2, true, OFFSET);
|
|
78 |
test_cp_inv(a1, a2, OFFSET);
|
|
79 |
test_2ci_inv(a1, a2, OFFSET);
|
|
80 |
test_2vi_inv(a1, a2, true, true, OFFSET);
|
|
81 |
test_ci_scl(a1);
|
|
82 |
test_vi_scl(a2, true);
|
|
83 |
test_cp_scl(a1, a2);
|
|
84 |
test_2ci_scl(a1, a2);
|
|
85 |
test_2vi_scl(a1, a2, true, true);
|
|
86 |
test_cp_alndst(a1, a2);
|
|
87 |
test_cp_alnsrc(a1, a2);
|
|
88 |
test_2ci_aln(a1, a2);
|
|
89 |
test_2vi_aln(a1, a2, true, true);
|
|
90 |
test_cp_unalndst(a1, a2);
|
|
91 |
test_cp_unalnsrc(a1, a2);
|
|
92 |
test_2ci_unaln(a1, a2);
|
|
93 |
test_2vi_unaln(a1, a2, true, true);
|
|
94 |
}
|
|
95 |
// Initialize
|
|
96 |
for (int i=0; i<ARRLEN; i++) {
|
|
97 |
a1[i] = false;
|
|
98 |
a2[i] = false;
|
|
99 |
}
|
|
100 |
// Test and verify results
|
|
101 |
System.out.println("Verification");
|
|
102 |
int errn = 0;
|
|
103 |
{
|
|
104 |
test_ci(a1);
|
|
105 |
for (int i=0; i<ARRLEN; i++) {
|
|
106 |
errn += verify("test_ci: a1", i, a1[i], false);
|
|
107 |
}
|
|
108 |
test_vi(a2, true);
|
|
109 |
for (int i=0; i<ARRLEN; i++) {
|
|
110 |
errn += verify("test_vi: a2", i, a2[i], true);
|
|
111 |
}
|
|
112 |
test_cp(a1, a2);
|
|
113 |
for (int i=0; i<ARRLEN; i++) {
|
|
114 |
errn += verify("test_cp: a1", i, a1[i], true);
|
|
115 |
}
|
|
116 |
test_2ci(a1, a2);
|
|
117 |
for (int i=0; i<ARRLEN; i++) {
|
|
118 |
errn += verify("test_2ci: a1", i, a1[i], false);
|
|
119 |
errn += verify("test_2ci: a2", i, a2[i], false);
|
|
120 |
}
|
|
121 |
test_2vi(a1, a2, true, true);
|
|
122 |
for (int i=0; i<ARRLEN; i++) {
|
|
123 |
errn += verify("test_2vi: a1", i, a1[i], true);
|
|
124 |
errn += verify("test_2vi: a2", i, a2[i], true);
|
|
125 |
}
|
|
126 |
// Reset for negative stride
|
|
127 |
for (int i=0; i<ARRLEN; i++) {
|
|
128 |
a1[i] = false;
|
|
129 |
a2[i] = false;
|
|
130 |
}
|
|
131 |
test_ci_neg(a1);
|
|
132 |
for (int i=0; i<ARRLEN; i++) {
|
|
133 |
errn += verify("test_ci_neg: a1", i, a1[i], false);
|
|
134 |
}
|
|
135 |
test_vi_neg(a2, true);
|
|
136 |
for (int i=0; i<ARRLEN; i++) {
|
|
137 |
errn += verify("test_vi_neg: a2", i, a2[i], true);
|
|
138 |
}
|
|
139 |
test_cp_neg(a1, a2);
|
|
140 |
for (int i=0; i<ARRLEN; i++) {
|
|
141 |
errn += verify("test_cp_neg: a1", i, a1[i], true);
|
|
142 |
}
|
|
143 |
test_2ci_neg(a1, a2);
|
|
144 |
for (int i=0; i<ARRLEN; i++) {
|
|
145 |
errn += verify("test_2ci_neg: a1", i, a1[i], false);
|
|
146 |
errn += verify("test_2ci_neg: a2", i, a2[i], false);
|
|
147 |
}
|
|
148 |
test_2vi_neg(a1, a2, true, true);
|
|
149 |
for (int i=0; i<ARRLEN; i++) {
|
|
150 |
errn += verify("test_2vi_neg: a1", i, a1[i], true);
|
|
151 |
errn += verify("test_2vi_neg: a2", i, a2[i], true);
|
|
152 |
}
|
|
153 |
// Reset for opposite stride
|
|
154 |
for (int i=0; i<ARRLEN; i++) {
|
|
155 |
a1[i] = false;
|
|
156 |
a2[i] = false;
|
|
157 |
}
|
|
158 |
test_ci_oppos(a1);
|
|
159 |
for (int i=0; i<ARRLEN; i++) {
|
|
160 |
errn += verify("test_ci_oppos: a1", i, a1[i], false);
|
|
161 |
}
|
|
162 |
test_vi_oppos(a2, true);
|
|
163 |
for (int i=0; i<ARRLEN; i++) {
|
|
164 |
errn += verify("test_vi_oppos: a2", i, a2[i], true);
|
|
165 |
}
|
|
166 |
test_cp_oppos(a1, a2);
|
|
167 |
for (int i=0; i<ARRLEN; i++) {
|
|
168 |
errn += verify("test_cp_oppos: a1", i, a1[i], true);
|
|
169 |
}
|
|
170 |
test_2ci_oppos(a1, a2);
|
|
171 |
for (int i=0; i<ARRLEN; i++) {
|
|
172 |
errn += verify("test_2ci_oppos: a1", i, a1[i], false);
|
|
173 |
errn += verify("test_2ci_oppos: a2", i, a2[i], false);
|
|
174 |
}
|
|
175 |
test_2vi_oppos(a1, a2, true, true);
|
|
176 |
for (int i=0; i<ARRLEN; i++) {
|
|
177 |
errn += verify("test_2vi_oppos: a1", i, a1[i], true);
|
|
178 |
errn += verify("test_2vi_oppos: a2", i, a2[i], true);
|
|
179 |
}
|
|
180 |
// Reset for indexing with offset
|
|
181 |
for (int i=0; i<ARRLEN; i++) {
|
|
182 |
a1[i] = false;
|
|
183 |
a2[i] = false;
|
|
184 |
}
|
|
185 |
test_ci_off(a1);
|
|
186 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
187 |
errn += verify("test_ci_off: a1", i, a1[i], false);
|
|
188 |
}
|
|
189 |
test_vi_off(a2, true);
|
|
190 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
191 |
errn += verify("test_vi_off: a2", i, a2[i], true);
|
|
192 |
}
|
|
193 |
test_cp_off(a1, a2);
|
|
194 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
195 |
errn += verify("test_cp_off: a1", i, a1[i], true);
|
|
196 |
}
|
|
197 |
test_2ci_off(a1, a2);
|
|
198 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
199 |
errn += verify("test_2ci_off: a1", i, a1[i], false);
|
|
200 |
errn += verify("test_2ci_off: a2", i, a2[i], false);
|
|
201 |
}
|
|
202 |
test_2vi_off(a1, a2, true, true);
|
|
203 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
204 |
errn += verify("test_2vi_off: a1", i, a1[i], true);
|
|
205 |
errn += verify("test_2vi_off: a2", i, a2[i], true);
|
|
206 |
}
|
|
207 |
for (int i=0; i<OFFSET; i++) {
|
|
208 |
errn += verify("test_2vi_off: a1", i, a1[i], false);
|
|
209 |
errn += verify("test_2vi_off: a2", i, a2[i], false);
|
|
210 |
}
|
|
211 |
// Reset for indexing with invariant offset
|
|
212 |
for (int i=0; i<ARRLEN; i++) {
|
|
213 |
a1[i] = false;
|
|
214 |
a2[i] = false;
|
|
215 |
}
|
|
216 |
test_ci_inv(a1, OFFSET);
|
|
217 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
218 |
errn += verify("test_ci_inv: a1", i, a1[i], false);
|
|
219 |
}
|
|
220 |
test_vi_inv(a2, true, OFFSET);
|
|
221 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
222 |
errn += verify("test_vi_inv: a2", i, a2[i], true);
|
|
223 |
}
|
|
224 |
test_cp_inv(a1, a2, OFFSET);
|
|
225 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
226 |
errn += verify("test_cp_inv: a1", i, a1[i], true);
|
|
227 |
}
|
|
228 |
test_2ci_inv(a1, a2, OFFSET);
|
|
229 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
230 |
errn += verify("test_2ci_inv: a1", i, a1[i], false);
|
|
231 |
errn += verify("test_2ci_inv: a2", i, a2[i], false);
|
|
232 |
}
|
|
233 |
test_2vi_inv(a1, a2, true, true, OFFSET);
|
|
234 |
for (int i=OFFSET; i<ARRLEN; i++) {
|
|
235 |
errn += verify("test_2vi_inv: a1", i, a1[i], true);
|
|
236 |
errn += verify("test_2vi_inv: a2", i, a2[i], true);
|
|
237 |
}
|
|
238 |
for (int i=0; i<OFFSET; i++) {
|
|
239 |
errn += verify("test_2vi_inv: a1", i, a1[i], false);
|
|
240 |
errn += verify("test_2vi_inv: a2", i, a2[i], false);
|
|
241 |
}
|
|
242 |
// Reset for indexing with scale
|
|
243 |
for (int i=0; i<ARRLEN; i++) {
|
|
244 |
a1[i] = true;
|
|
245 |
a2[i] = false;
|
|
246 |
}
|
|
247 |
test_ci_scl(a1);
|
|
248 |
for (int i=0; i<ARRLEN; i++) {
|
|
249 |
boolean val = (i%SCALE != 0);
|
|
250 |
errn += verify("test_ci_scl: a1", i, a1[i], val);
|
|
251 |
}
|
|
252 |
test_vi_scl(a2, true);
|
|
253 |
for (int i=0; i<ARRLEN; i++) {
|
|
254 |
boolean val = (i%SCALE == 0);
|
|
255 |
errn += verify("test_vi_scl: a2", i, a2[i], val);
|
|
256 |
}
|
|
257 |
test_cp_scl(a1, a2);
|
|
258 |
for (int i=0; i<ARRLEN; i++) {
|
|
259 |
errn += verify("test_cp_scl: a1", i, a1[i], true);
|
|
260 |
}
|
|
261 |
test_2ci_scl(a1, a2);
|
|
262 |
for (int i=0; i<ARRLEN; i++) {
|
|
263 |
if (i%SCALE != 0) {
|
|
264 |
errn += verify("test_2ci_scl: a1", i, a1[i], true);
|
|
265 |
} else if (i*SCALE < ARRLEN) {
|
|
266 |
errn += verify("test_2ci_scl: a1", i*SCALE, a1[i*SCALE], false);
|
|
267 |
}
|
|
268 |
if (i%SCALE != 0) {
|
|
269 |
errn += verify("test_2ci_scl: a2", i, a2[i], false);
|
|
270 |
} else if (i*SCALE < ARRLEN) {
|
|
271 |
errn += verify("test_2ci_scl: a2", i*SCALE, a2[i*SCALE], false);
|
|
272 |
}
|
|
273 |
}
|
|
274 |
test_2vi_scl(a1, a2, false, true);
|
|
275 |
for (int i=0; i<ARRLEN; i++) {
|
|
276 |
if (i%SCALE != 0) {
|
|
277 |
errn += verify("test_2vi_scl: a1", i, a1[i], true);
|
|
278 |
} else if (i*SCALE < ARRLEN) {
|
|
279 |
errn += verify("test_2vi_scl: a1", i*SCALE, a1[i*SCALE], false);
|
|
280 |
}
|
|
281 |
if (i%SCALE != 0) {
|
|
282 |
errn += verify("test_2vi_scl: a2", i, a2[i], false);
|
|
283 |
} else if (i*SCALE < ARRLEN) {
|
|
284 |
errn += verify("test_2vi_scl: a2", i*SCALE, a2[i*SCALE], true);
|
|
285 |
}
|
|
286 |
}
|
|
287 |
// Reset for 2 arrays with relative aligned offset
|
|
288 |
for (int i=0; i<ARRLEN; i++) {
|
|
289 |
a1[i] = false;
|
|
290 |
a2[i] = false;
|
|
291 |
}
|
|
292 |
test_vi(a2, true);
|
|
293 |
test_cp_alndst(a1, a2);
|
|
294 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
295 |
errn += verify("test_cp_alndst: a1", i, a1[i], false);
|
|
296 |
}
|
|
297 |
for (int i=ALIGN_OFF; i<ARRLEN; i++) {
|
|
298 |
errn += verify("test_cp_alndst: a1", i, a1[i], true);
|
|
299 |
}
|
|
300 |
test_vi(a2, false);
|
|
301 |
test_cp_alnsrc(a1, a2);
|
|
302 |
for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
|
|
303 |
errn += verify("test_cp_alnsrc: a1", i, a1[i], false);
|
|
304 |
}
|
|
305 |
for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
|
|
306 |
errn += verify("test_cp_alnsrc: a1", i, a1[i], true);
|
|
307 |
}
|
|
308 |
for (int i=0; i<ARRLEN; i++) {
|
|
309 |
a1[i] = false;
|
|
310 |
a2[i] = false;
|
|
311 |
}
|
|
312 |
test_2ci_aln(a1, a2);
|
|
313 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
314 |
errn += verify("test_2ci_aln: a1", i, a1[i], false);
|
|
315 |
}
|
|
316 |
for (int i=ALIGN_OFF; i<ARRLEN; i++) {
|
|
317 |
errn += verify("test_2ci_aln: a1", i, a1[i], false);
|
|
318 |
}
|
|
319 |
for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
|
|
320 |
errn += verify("test_2ci_aln: a2", i, a2[i], false);
|
|
321 |
}
|
|
322 |
for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
|
|
323 |
errn += verify("test_2ci_aln: a2", i, a2[i], false);
|
|
324 |
}
|
|
325 |
for (int i=0; i<ARRLEN; i++) {
|
|
326 |
a1[i] = false;
|
|
327 |
a2[i] = false;
|
|
328 |
}
|
|
329 |
test_2vi_aln(a1, a2, true, true);
|
|
330 |
for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
|
|
331 |
errn += verify("test_2vi_aln: a1", i, a1[i], true);
|
|
332 |
}
|
|
333 |
for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
|
|
334 |
errn += verify("test_2vi_aln: a1", i, a1[i], false);
|
|
335 |
}
|
|
336 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
337 |
errn += verify("test_2vi_aln: a2", i, a2[i], false);
|
|
338 |
}
|
|
339 |
for (int i=ALIGN_OFF; i<ARRLEN; i++) {
|
|
340 |
errn += verify("test_2vi_aln: a2", i, a2[i], true);
|
|
341 |
}
|
|
342 |
|
|
343 |
// Reset for 2 arrays with relative unaligned offset
|
|
344 |
for (int i=0; i<ARRLEN; i++) {
|
|
345 |
a1[i] = false;
|
|
346 |
a2[i] = false;
|
|
347 |
}
|
|
348 |
test_vi(a2, true);
|
|
349 |
test_cp_unalndst(a1, a2);
|
|
350 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
351 |
errn += verify("test_cp_unalndst: a1", i, a1[i], false);
|
|
352 |
}
|
|
353 |
for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
|
|
354 |
errn += verify("test_cp_unalndst: a1", i, a1[i], true);
|
|
355 |
}
|
|
356 |
test_vi(a2, false);
|
|
357 |
test_cp_unalnsrc(a1, a2);
|
|
358 |
for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
|
|
359 |
errn += verify("test_cp_unalnsrc: a1", i, a1[i], false);
|
|
360 |
}
|
|
361 |
for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
|
|
362 |
errn += verify("test_cp_unalnsrc: a1", i, a1[i], true);
|
|
363 |
}
|
|
364 |
for (int i=0; i<ARRLEN; i++) {
|
|
365 |
a1[i] = false;
|
|
366 |
a2[i] = false;
|
|
367 |
}
|
|
368 |
test_2ci_unaln(a1, a2);
|
|
369 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
370 |
errn += verify("test_2ci_unaln: a1", i, a1[i], false);
|
|
371 |
}
|
|
372 |
for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
|
|
373 |
errn += verify("test_2ci_unaln: a1", i, a1[i], false);
|
|
374 |
}
|
|
375 |
for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
|
|
376 |
errn += verify("test_2ci_unaln: a2", i, a2[i], false);
|
|
377 |
}
|
|
378 |
for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
|
|
379 |
errn += verify("test_2ci_unaln: a2", i, a2[i], false);
|
|
380 |
}
|
|
381 |
for (int i=0; i<ARRLEN; i++) {
|
|
382 |
a1[i] = false;
|
|
383 |
a2[i] = false;
|
|
384 |
}
|
|
385 |
test_2vi_unaln(a1, a2, true, true);
|
|
386 |
for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
|
|
387 |
errn += verify("test_2vi_unaln: a1", i, a1[i], true);
|
|
388 |
}
|
|
389 |
for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
|
|
390 |
errn += verify("test_2vi_unaln: a1", i, a1[i], false);
|
|
391 |
}
|
|
392 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
393 |
errn += verify("test_2vi_unaln: a2", i, a2[i], false);
|
|
394 |
}
|
|
395 |
for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
|
|
396 |
errn += verify("test_2vi_unaln: a2", i, a2[i], true);
|
|
397 |
}
|
|
398 |
|
|
399 |
// Reset for aligned overlap initialization
|
|
400 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
401 |
a1[i] = (i > 0);
|
|
402 |
}
|
|
403 |
for (int i=ALIGN_OFF; i<ARRLEN; i++) {
|
|
404 |
a1[i] = false;
|
|
405 |
}
|
|
406 |
test_cp_alndst(a1, a1);
|
|
407 |
for (int i=0; i<ARRLEN; i++) {
|
|
408 |
boolean v = (i%ALIGN_OFF > 0);
|
|
409 |
errn += verify("test_cp_alndst_overlap: a1", i, a1[i], v);
|
|
410 |
}
|
|
411 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
412 |
a1[i+ALIGN_OFF] = false;
|
|
413 |
}
|
|
414 |
test_cp_alnsrc(a1, a1);
|
|
415 |
for (int i=0; i<ALIGN_OFF; i++) {
|
|
416 |
errn += verify("test_cp_alnsrc_overlap: a1", i, a1[i], false);
|
|
417 |
}
|
|
418 |
for (int i=ALIGN_OFF; i<ARRLEN; i++) {
|
|
419 |
boolean v = (i%ALIGN_OFF > 0);
|
|
420 |
errn += verify("test_cp_alnsrc_overlap: a1", i, a1[i], v);
|
|
421 |
}
|
|
422 |
for (int i=0; i<ARRLEN; i++) {
|
|
423 |
a1[i] = false;
|
|
424 |
}
|
|
425 |
test_2ci_aln(a1, a1);
|
|
426 |
for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
|
|
427 |
errn += verify("test_2ci_aln_overlap: a1", i, a1[i], false);
|
|
428 |
}
|
|
429 |
for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
|
|
430 |
errn += verify("test_2ci_aln_overlap: a1", i, a1[i], false);
|
|
431 |
}
|
|
432 |
for (int i=0; i<ARRLEN; i++) {
|
|
433 |
a1[i] = false;
|
|
434 |
}
|
|
435 |
test_2vi_aln(a1, a1, true, true);
|
|
436 |
for (int i=0; i<ARRLEN-ALIGN_OFF; i++) {
|
|
437 |
errn += verify("test_2vi_aln_overlap: a1", i, a1[i], true);
|
|
438 |
}
|
|
439 |
for (int i=ARRLEN-ALIGN_OFF; i<ARRLEN; i++) {
|
|
440 |
errn += verify("test_2vi_aln_overlap: a1", i, a1[i], true);
|
|
441 |
}
|
|
442 |
|
|
443 |
// Reset for unaligned overlap initialization
|
|
444 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
445 |
a1[i] = (i > 0);
|
|
446 |
}
|
|
447 |
for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
|
|
448 |
a1[i] = false;
|
|
449 |
}
|
|
450 |
test_cp_unalndst(a1, a1);
|
|
451 |
for (int i=0; i<ARRLEN; i++) {
|
|
452 |
boolean v = (i%UNALIGN_OFF > 0);
|
|
453 |
errn += verify("test_cp_unalndst_overlap: a1", i, a1[i], v);
|
|
454 |
}
|
|
455 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
456 |
a1[i+UNALIGN_OFF] = false;
|
|
457 |
}
|
|
458 |
test_cp_unalnsrc(a1, a1);
|
|
459 |
for (int i=0; i<UNALIGN_OFF; i++) {
|
|
460 |
errn += verify("test_cp_unalnsrc_overlap: a1", i, a1[i], false);
|
|
461 |
}
|
|
462 |
for (int i=UNALIGN_OFF; i<ARRLEN; i++) {
|
|
463 |
boolean v = (i%UNALIGN_OFF > 0);
|
|
464 |
errn += verify("test_cp_unalnsrc_overlap: a1", i, a1[i], v);
|
|
465 |
}
|
|
466 |
for (int i=0; i<ARRLEN; i++) {
|
|
467 |
a1[i] = false;
|
|
468 |
}
|
|
469 |
test_2ci_unaln(a1, a1);
|
|
470 |
for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
|
|
471 |
errn += verify("test_2ci_unaln_overlap: a1", i, a1[i], false);
|
|
472 |
}
|
|
473 |
for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
|
|
474 |
errn += verify("test_2ci_unaln_overlap: a1", i, a1[i], false);
|
|
475 |
}
|
|
476 |
for (int i=0; i<ARRLEN; i++) {
|
|
477 |
a1[i] = false;
|
|
478 |
}
|
|
479 |
test_2vi_unaln(a1, a1, true, true);
|
|
480 |
for (int i=0; i<ARRLEN-UNALIGN_OFF; i++) {
|
|
481 |
errn += verify("test_2vi_unaln_overlap: a1", i, a1[i], true);
|
|
482 |
}
|
|
483 |
for (int i=ARRLEN-UNALIGN_OFF; i<ARRLEN; i++) {
|
|
484 |
errn += verify("test_2vi_unaln_overlap: a1", i, a1[i], true);
|
|
485 |
}
|
|
486 |
|
|
487 |
}
|
|
488 |
|
|
489 |
if (errn > 0)
|
|
490 |
return errn;
|
|
491 |
|
|
492 |
System.out.println("Time");
|
|
493 |
long start, end;
|
|
494 |
start = System.currentTimeMillis();
|
|
495 |
for (int i=0; i<ITERS; i++) {
|
|
496 |
test_ci(a1);
|
|
497 |
}
|
|
498 |
end = System.currentTimeMillis();
|
|
499 |
System.out.println("test_ci: " + (end - start));
|
|
500 |
start = System.currentTimeMillis();
|
|
501 |
for (int i=0; i<ITERS; i++) {
|
|
502 |
test_vi(a2, true);
|
|
503 |
}
|
|
504 |
end = System.currentTimeMillis();
|
|
505 |
System.out.println("test_vi: " + (end - start));
|
|
506 |
start = System.currentTimeMillis();
|
|
507 |
for (int i=0; i<ITERS; i++) {
|
|
508 |
test_cp(a1, a2);
|
|
509 |
}
|
|
510 |
end = System.currentTimeMillis();
|
|
511 |
System.out.println("test_cp: " + (end - start));
|
|
512 |
start = System.currentTimeMillis();
|
|
513 |
for (int i=0; i<ITERS; i++) {
|
|
514 |
test_2ci(a1, a2);
|
|
515 |
}
|
|
516 |
end = System.currentTimeMillis();
|
|
517 |
System.out.println("test_2ci: " + (end - start));
|
|
518 |
start = System.currentTimeMillis();
|
|
519 |
for (int i=0; i<ITERS; i++) {
|
|
520 |
test_2vi(a1, a2, true, true);
|
|
521 |
}
|
|
522 |
end = System.currentTimeMillis();
|
|
523 |
System.out.println("test_2vi: " + (end - start));
|
|
524 |
|
|
525 |
start = System.currentTimeMillis();
|
|
526 |
for (int i=0; i<ITERS; i++) {
|
|
527 |
test_ci_neg(a1);
|
|
528 |
}
|
|
529 |
end = System.currentTimeMillis();
|
|
530 |
System.out.println("test_ci_neg: " + (end - start));
|
|
531 |
start = System.currentTimeMillis();
|
|
532 |
for (int i=0; i<ITERS; i++) {
|
|
533 |
test_vi_neg(a2, true);
|
|
534 |
}
|
|
535 |
end = System.currentTimeMillis();
|
|
536 |
System.out.println("test_vi_neg: " + (end - start));
|
|
537 |
start = System.currentTimeMillis();
|
|
538 |
for (int i=0; i<ITERS; i++) {
|
|
539 |
test_cp_neg(a1, a2);
|
|
540 |
}
|
|
541 |
end = System.currentTimeMillis();
|
|
542 |
System.out.println("test_cp_neg: " + (end - start));
|
|
543 |
start = System.currentTimeMillis();
|
|
544 |
for (int i=0; i<ITERS; i++) {
|
|
545 |
test_2ci_neg(a1, a2);
|
|
546 |
}
|
|
547 |
end = System.currentTimeMillis();
|
|
548 |
System.out.println("test_2ci_neg: " + (end - start));
|
|
549 |
start = System.currentTimeMillis();
|
|
550 |
for (int i=0; i<ITERS; i++) {
|
|
551 |
test_2vi_neg(a1, a2, true, true);
|
|
552 |
}
|
|
553 |
end = System.currentTimeMillis();
|
|
554 |
System.out.println("test_2vi_neg: " + (end - start));
|
|
555 |
|
|
556 |
start = System.currentTimeMillis();
|
|
557 |
for (int i=0; i<ITERS; i++) {
|
|
558 |
test_ci_oppos(a1);
|
|
559 |
}
|
|
560 |
end = System.currentTimeMillis();
|
|
561 |
System.out.println("test_ci_oppos: " + (end - start));
|
|
562 |
start = System.currentTimeMillis();
|
|
563 |
for (int i=0; i<ITERS; i++) {
|
|
564 |
test_vi_oppos(a2, true);
|
|
565 |
}
|
|
566 |
end = System.currentTimeMillis();
|
|
567 |
System.out.println("test_vi_oppos: " + (end - start));
|
|
568 |
start = System.currentTimeMillis();
|
|
569 |
for (int i=0; i<ITERS; i++) {
|
|
570 |
test_cp_oppos(a1, a2);
|
|
571 |
}
|
|
572 |
end = System.currentTimeMillis();
|
|
573 |
System.out.println("test_cp_oppos: " + (end - start));
|
|
574 |
start = System.currentTimeMillis();
|
|
575 |
for (int i=0; i<ITERS; i++) {
|
|
576 |
test_2ci_oppos(a1, a2);
|
|
577 |
}
|
|
578 |
end = System.currentTimeMillis();
|
|
579 |
System.out.println("test_2ci_oppos: " + (end - start));
|
|
580 |
start = System.currentTimeMillis();
|
|
581 |
for (int i=0; i<ITERS; i++) {
|
|
582 |
test_2vi_oppos(a1, a2, true, true);
|
|
583 |
}
|
|
584 |
end = System.currentTimeMillis();
|
|
585 |
System.out.println("test_2vi_oppos: " + (end - start));
|
|
586 |
|
|
587 |
start = System.currentTimeMillis();
|
|
588 |
for (int i=0; i<ITERS; i++) {
|
|
589 |
test_ci_off(a1);
|
|
590 |
}
|
|
591 |
end = System.currentTimeMillis();
|
|
592 |
System.out.println("test_ci_off: " + (end - start));
|
|
593 |
start = System.currentTimeMillis();
|
|
594 |
for (int i=0; i<ITERS; i++) {
|
|
595 |
test_vi_off(a2, true);
|
|
596 |
}
|
|
597 |
end = System.currentTimeMillis();
|
|
598 |
System.out.println("test_vi_off: " + (end - start));
|
|
599 |
start = System.currentTimeMillis();
|
|
600 |
for (int i=0; i<ITERS; i++) {
|
|
601 |
test_cp_off(a1, a2);
|
|
602 |
}
|
|
603 |
end = System.currentTimeMillis();
|
|
604 |
System.out.println("test_cp_off: " + (end - start));
|
|
605 |
start = System.currentTimeMillis();
|
|
606 |
for (int i=0; i<ITERS; i++) {
|
|
607 |
test_2ci_off(a1, a2);
|
|
608 |
}
|
|
609 |
end = System.currentTimeMillis();
|
|
610 |
System.out.println("test_2ci_off: " + (end - start));
|
|
611 |
start = System.currentTimeMillis();
|
|
612 |
for (int i=0; i<ITERS; i++) {
|
|
613 |
test_2vi_off(a1, a2, true, true);
|
|
614 |
}
|
|
615 |
end = System.currentTimeMillis();
|
|
616 |
System.out.println("test_2vi_off: " + (end - start));
|
|
617 |
|
|
618 |
start = System.currentTimeMillis();
|
|
619 |
for (int i=0; i<ITERS; i++) {
|
|
620 |
test_ci_inv(a1, OFFSET);
|
|
621 |
}
|
|
622 |
end = System.currentTimeMillis();
|
|
623 |
System.out.println("test_ci_inv: " + (end - start));
|
|
624 |
start = System.currentTimeMillis();
|
|
625 |
for (int i=0; i<ITERS; i++) {
|
|
626 |
test_vi_inv(a2, true, OFFSET);
|
|
627 |
}
|
|
628 |
end = System.currentTimeMillis();
|
|
629 |
System.out.println("test_vi_inv: " + (end - start));
|
|
630 |
start = System.currentTimeMillis();
|
|
631 |
for (int i=0; i<ITERS; i++) {
|
|
632 |
test_cp_inv(a1, a2, OFFSET);
|
|
633 |
}
|
|
634 |
end = System.currentTimeMillis();
|
|
635 |
System.out.println("test_cp_inv: " + (end - start));
|
|
636 |
start = System.currentTimeMillis();
|
|
637 |
for (int i=0; i<ITERS; i++) {
|
|
638 |
test_2ci_inv(a1, a2, OFFSET);
|
|
639 |
}
|
|
640 |
end = System.currentTimeMillis();
|
|
641 |
System.out.println("test_2ci_inv: " + (end - start));
|
|
642 |
start = System.currentTimeMillis();
|
|
643 |
for (int i=0; i<ITERS; i++) {
|
|
644 |
test_2vi_inv(a1, a2, true, true, OFFSET);
|
|
645 |
}
|
|
646 |
end = System.currentTimeMillis();
|
|
647 |
System.out.println("test_2vi_inv: " + (end - start));
|
|
648 |
|
|
649 |
start = System.currentTimeMillis();
|
|
650 |
for (int i=0; i<ITERS; i++) {
|
|
651 |
test_ci_scl(a1);
|
|
652 |
}
|
|
653 |
end = System.currentTimeMillis();
|
|
654 |
System.out.println("test_ci_scl: " + (end - start));
|
|
655 |
start = System.currentTimeMillis();
|
|
656 |
for (int i=0; i<ITERS; i++) {
|
|
657 |
test_vi_scl(a2, true);
|
|
658 |
}
|
|
659 |
end = System.currentTimeMillis();
|
|
660 |
System.out.println("test_vi_scl: " + (end - start));
|
|
661 |
start = System.currentTimeMillis();
|
|
662 |
for (int i=0; i<ITERS; i++) {
|
|
663 |
test_cp_scl(a1, a2);
|
|
664 |
}
|
|
665 |
end = System.currentTimeMillis();
|
|
666 |
System.out.println("test_cp_scl: " + (end - start));
|
|
667 |
start = System.currentTimeMillis();
|
|
668 |
for (int i=0; i<ITERS; i++) {
|
|
669 |
test_2ci_scl(a1, a2);
|
|
670 |
}
|
|
671 |
end = System.currentTimeMillis();
|
|
672 |
System.out.println("test_2ci_scl: " + (end - start));
|
|
673 |
start = System.currentTimeMillis();
|
|
674 |
for (int i=0; i<ITERS; i++) {
|
|
675 |
test_2vi_scl(a1, a2, true, true);
|
|
676 |
}
|
|
677 |
end = System.currentTimeMillis();
|
|
678 |
System.out.println("test_2vi_scl: " + (end - start));
|
|
679 |
|
|
680 |
start = System.currentTimeMillis();
|
|
681 |
for (int i=0; i<ITERS; i++) {
|
|
682 |
test_cp_alndst(a1, a2);
|
|
683 |
}
|
|
684 |
end = System.currentTimeMillis();
|
|
685 |
System.out.println("test_cp_alndst: " + (end - start));
|
|
686 |
start = System.currentTimeMillis();
|
|
687 |
for (int i=0; i<ITERS; i++) {
|
|
688 |
test_cp_alnsrc(a1, a2);
|
|
689 |
}
|
|
690 |
end = System.currentTimeMillis();
|
|
691 |
System.out.println("test_cp_alnsrc: " + (end - start));
|
|
692 |
start = System.currentTimeMillis();
|
|
693 |
for (int i=0; i<ITERS; i++) {
|
|
694 |
test_2ci_aln(a1, a2);
|
|
695 |
}
|
|
696 |
end = System.currentTimeMillis();
|
|
697 |
System.out.println("test_2ci_aln: " + (end - start));
|
|
698 |
start = System.currentTimeMillis();
|
|
699 |
for (int i=0; i<ITERS; i++) {
|
|
700 |
test_2vi_aln(a1, a2, true, true);
|
|
701 |
}
|
|
702 |
end = System.currentTimeMillis();
|
|
703 |
System.out.println("test_2vi_aln: " + (end - start));
|
|
704 |
|
|
705 |
start = System.currentTimeMillis();
|
|
706 |
for (int i=0; i<ITERS; i++) {
|
|
707 |
test_cp_unalndst(a1, a2);
|
|
708 |
}
|
|
709 |
end = System.currentTimeMillis();
|
|
710 |
System.out.println("test_cp_unalndst: " + (end - start));
|
|
711 |
start = System.currentTimeMillis();
|
|
712 |
for (int i=0; i<ITERS; i++) {
|
|
713 |
test_cp_unalnsrc(a1, a2);
|
|
714 |
}
|
|
715 |
end = System.currentTimeMillis();
|
|
716 |
System.out.println("test_cp_unalnsrc: " + (end - start));
|
|
717 |
start = System.currentTimeMillis();
|
|
718 |
for (int i=0; i<ITERS; i++) {
|
|
719 |
test_2ci_unaln(a1, a2);
|
|
720 |
}
|
|
721 |
end = System.currentTimeMillis();
|
|
722 |
System.out.println("test_2ci_unaln: " + (end - start));
|
|
723 |
start = System.currentTimeMillis();
|
|
724 |
for (int i=0; i<ITERS; i++) {
|
|
725 |
test_2vi_unaln(a1, a2, true, true);
|
|
726 |
}
|
|
727 |
end = System.currentTimeMillis();
|
|
728 |
System.out.println("test_2vi_unaln: " + (end - start));
|
|
729 |
|
|
730 |
return errn;
|
|
731 |
}
|
|
732 |
|
|
733 |
static void test_ci(boolean[] a) {
|
|
734 |
for (int i = 0; i < a.length; i+=1) {
|
|
735 |
a[i] = false;
|
|
736 |
}
|
|
737 |
}
|
|
738 |
static void test_vi(boolean[] a, boolean b) {
|
|
739 |
for (int i = 0; i < a.length; i+=1) {
|
|
740 |
a[i] = b;
|
|
741 |
}
|
|
742 |
}
|
|
743 |
static void test_cp(boolean[] a, boolean[] b) {
|
|
744 |
for (int i = 0; i < a.length; i+=1) {
|
|
745 |
a[i] = b[i];
|
|
746 |
}
|
|
747 |
}
|
|
748 |
static void test_2ci(boolean[] a, boolean[] b) {
|
|
749 |
for (int i = 0; i < a.length; i+=1) {
|
|
750 |
a[i] = false;
|
|
751 |
b[i] = false;
|
|
752 |
}
|
|
753 |
}
|
|
754 |
static void test_2vi(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
755 |
for (int i = 0; i < a.length; i+=1) {
|
|
756 |
a[i] = c;
|
|
757 |
b[i] = d;
|
|
758 |
}
|
|
759 |
}
|
|
760 |
static void test_ci_neg(boolean[] a) {
|
|
761 |
for (int i = a.length-1; i >= 0; i-=1) {
|
|
762 |
a[i] = false;
|
|
763 |
}
|
|
764 |
}
|
|
765 |
static void test_vi_neg(boolean[] a, boolean b) {
|
|
766 |
for (int i = a.length-1; i >= 0; i-=1) {
|
|
767 |
a[i] = b;
|
|
768 |
}
|
|
769 |
}
|
|
770 |
static void test_cp_neg(boolean[] a, boolean[] b) {
|
|
771 |
for (int i = a.length-1; i >= 0; i-=1) {
|
|
772 |
a[i] = b[i];
|
|
773 |
}
|
|
774 |
}
|
|
775 |
static void test_2ci_neg(boolean[] a, boolean[] b) {
|
|
776 |
for (int i = a.length-1; i >= 0; i-=1) {
|
|
777 |
a[i] = false;
|
|
778 |
b[i] = false;
|
|
779 |
}
|
|
780 |
}
|
|
781 |
static void test_2vi_neg(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
782 |
for (int i = a.length-1; i >= 0; i-=1) {
|
|
783 |
a[i] = c;
|
|
784 |
b[i] = d;
|
|
785 |
}
|
|
786 |
}
|
|
787 |
static void test_ci_oppos(boolean[] a) {
|
|
788 |
int limit = a.length-1;
|
|
789 |
for (int i = 0; i < a.length; i+=1) {
|
|
790 |
a[limit-i] = false;
|
|
791 |
}
|
|
792 |
}
|
|
793 |
static void test_vi_oppos(boolean[] a, boolean b) {
|
|
794 |
int limit = a.length-1;
|
|
795 |
for (int i = limit; i >= 0; i-=1) {
|
|
796 |
a[limit-i] = b;
|
|
797 |
}
|
|
798 |
}
|
|
799 |
static void test_cp_oppos(boolean[] a, boolean[] b) {
|
|
800 |
int limit = a.length-1;
|
|
801 |
for (int i = 0; i < a.length; i+=1) {
|
|
802 |
a[i] = b[limit-i];
|
|
803 |
}
|
|
804 |
}
|
|
805 |
static void test_2ci_oppos(boolean[] a, boolean[] b) {
|
|
806 |
int limit = a.length-1;
|
|
807 |
for (int i = 0; i < a.length; i+=1) {
|
|
808 |
a[limit-i] = false;
|
|
809 |
b[i] = false;
|
|
810 |
}
|
|
811 |
}
|
|
812 |
static void test_2vi_oppos(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
813 |
int limit = a.length-1;
|
|
814 |
for (int i = limit; i >= 0; i-=1) {
|
|
815 |
a[i] = c;
|
|
816 |
b[limit-i] = d;
|
|
817 |
}
|
|
818 |
}
|
|
819 |
static void test_ci_off(boolean[] a) {
|
|
820 |
for (int i = 0; i < a.length-OFFSET; i+=1) {
|
|
821 |
a[i+OFFSET] = false;
|
|
822 |
}
|
|
823 |
}
|
|
824 |
static void test_vi_off(boolean[] a, boolean b) {
|
|
825 |
for (int i = 0; i < a.length-OFFSET; i+=1) {
|
|
826 |
a[i+OFFSET] = b;
|
|
827 |
}
|
|
828 |
}
|
|
829 |
static void test_cp_off(boolean[] a, boolean[] b) {
|
|
830 |
for (int i = 0; i < a.length-OFFSET; i+=1) {
|
|
831 |
a[i+OFFSET] = b[i+OFFSET];
|
|
832 |
}
|
|
833 |
}
|
|
834 |
static void test_2ci_off(boolean[] a, boolean[] b) {
|
|
835 |
for (int i = 0; i < a.length-OFFSET; i+=1) {
|
|
836 |
a[i+OFFSET] = false;
|
|
837 |
b[i+OFFSET] = false;
|
|
838 |
}
|
|
839 |
}
|
|
840 |
static void test_2vi_off(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
841 |
for (int i = 0; i < a.length-OFFSET; i+=1) {
|
|
842 |
a[i+OFFSET] = c;
|
|
843 |
b[i+OFFSET] = d;
|
|
844 |
}
|
|
845 |
}
|
|
846 |
static void test_ci_inv(boolean[] a, int k) {
|
|
847 |
for (int i = 0; i < a.length-k; i+=1) {
|
|
848 |
a[i+k] = false;
|
|
849 |
}
|
|
850 |
}
|
|
851 |
static void test_vi_inv(boolean[] a, boolean b, int k) {
|
|
852 |
for (int i = 0; i < a.length-k; i+=1) {
|
|
853 |
a[i+k] = b;
|
|
854 |
}
|
|
855 |
}
|
|
856 |
static void test_cp_inv(boolean[] a, boolean[] b, int k) {
|
|
857 |
for (int i = 0; i < a.length-k; i+=1) {
|
|
858 |
a[i+k] = b[i+k];
|
|
859 |
}
|
|
860 |
}
|
|
861 |
static void test_2ci_inv(boolean[] a, boolean[] b, int k) {
|
|
862 |
for (int i = 0; i < a.length-k; i+=1) {
|
|
863 |
a[i+k] = false;
|
|
864 |
b[i+k] = false;
|
|
865 |
}
|
|
866 |
}
|
|
867 |
static void test_2vi_inv(boolean[] a, boolean[] b, boolean c, boolean d, int k) {
|
|
868 |
for (int i = 0; i < a.length-k; i+=1) {
|
|
869 |
a[i+k] = c;
|
|
870 |
b[i+k] = d;
|
|
871 |
}
|
|
872 |
}
|
|
873 |
static void test_ci_scl(boolean[] a) {
|
|
874 |
for (int i = 0; i*SCALE < a.length; i+=1) {
|
|
875 |
a[i*SCALE] = false;
|
|
876 |
}
|
|
877 |
}
|
|
878 |
static void test_vi_scl(boolean[] a, boolean b) {
|
|
879 |
for (int i = 0; i*SCALE < a.length; i+=1) {
|
|
880 |
a[i*SCALE] = b;
|
|
881 |
}
|
|
882 |
}
|
|
883 |
static void test_cp_scl(boolean[] a, boolean[] b) {
|
|
884 |
for (int i = 0; i*SCALE < a.length; i+=1) {
|
|
885 |
a[i*SCALE] = b[i*SCALE];
|
|
886 |
}
|
|
887 |
}
|
|
888 |
static void test_2ci_scl(boolean[] a, boolean[] b) {
|
|
889 |
for (int i = 0; i*SCALE < a.length; i+=1) {
|
|
890 |
a[i*SCALE] = false;
|
|
891 |
b[i*SCALE] = false;
|
|
892 |
}
|
|
893 |
}
|
|
894 |
static void test_2vi_scl(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
895 |
for (int i = 0; i*SCALE < a.length; i+=1) {
|
|
896 |
a[i*SCALE] = c;
|
|
897 |
b[i*SCALE] = d;
|
|
898 |
}
|
|
899 |
}
|
|
900 |
static void test_cp_alndst(boolean[] a, boolean[] b) {
|
|
901 |
for (int i = 0; i < a.length-ALIGN_OFF; i+=1) {
|
|
902 |
a[i+ALIGN_OFF] = b[i];
|
|
903 |
}
|
|
904 |
}
|
|
905 |
static void test_cp_alnsrc(boolean[] a, boolean[] b) {
|
|
906 |
for (int i = 0; i < a.length-ALIGN_OFF; i+=1) {
|
|
907 |
a[i] = b[i+ALIGN_OFF];
|
|
908 |
}
|
|
909 |
}
|
|
910 |
static void test_2ci_aln(boolean[] a, boolean[] b) {
|
|
911 |
for (int i = 0; i < a.length-ALIGN_OFF; i+=1) {
|
|
912 |
a[i+ALIGN_OFF] = false;
|
|
913 |
b[i] = false;
|
|
914 |
}
|
|
915 |
}
|
|
916 |
static void test_2vi_aln(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
917 |
for (int i = 0; i < a.length-ALIGN_OFF; i+=1) {
|
|
918 |
a[i] = c;
|
|
919 |
b[i+ALIGN_OFF] = d;
|
|
920 |
}
|
|
921 |
}
|
|
922 |
static void test_cp_unalndst(boolean[] a, boolean[] b) {
|
|
923 |
for (int i = 0; i < a.length-UNALIGN_OFF; i+=1) {
|
|
924 |
a[i+UNALIGN_OFF] = b[i];
|
|
925 |
}
|
|
926 |
}
|
|
927 |
static void test_cp_unalnsrc(boolean[] a, boolean[] b) {
|
|
928 |
for (int i = 0; i < a.length-UNALIGN_OFF; i+=1) {
|
|
929 |
a[i] = b[i+UNALIGN_OFF];
|
|
930 |
}
|
|
931 |
}
|
|
932 |
static void test_2ci_unaln(boolean[] a, boolean[] b) {
|
|
933 |
for (int i = 0; i < a.length-UNALIGN_OFF; i+=1) {
|
|
934 |
a[i+UNALIGN_OFF] = false;
|
|
935 |
b[i] = false;
|
|
936 |
}
|
|
937 |
}
|
|
938 |
static void test_2vi_unaln(boolean[] a, boolean[] b, boolean c, boolean d) {
|
|
939 |
for (int i = 0; i < a.length-UNALIGN_OFF; i+=1) {
|
|
940 |
a[i] = c;
|
|
941 |
b[i+UNALIGN_OFF] = d;
|
|
942 |
}
|
|
943 |
}
|
|
944 |
|
|
945 |
static int verify(String text, int i, boolean elem, boolean val) {
|
|
946 |
if (elem != val) {
|
|
947 |
System.err.println(text + "[" + i + "] = " + elem + " != " + val);
|
|
948 |
return 1;
|
|
949 |
}
|
|
950 |
return 0;
|
|
951 |
}
|
|
952 |
}
|