rev 52603 : 8213134: AArch64: vector shift failed with MaxVectorSize=8
Summary: add vshiftcnt instructions for vector64 and add vsra/vsrl instructions to AArch64 backend.
To detect shift failures, MaxVectorSize options are added to jtreg test cases.
Reviewed-by: duke

   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  * @test
  26  * @bug 6340864
  27  * @summary Implement vectorization optimizations in hotspot-server
  28  *
  29  * @run main/othervm/timeout=400 -Xbatch -Xmx128m compiler.c2.cr6340864.TestLongVect
  30  * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=8 compiler.c2.cr6340864.TestLongVect
  31  * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=16 compiler.c2.cr6340864.TestLongVect
  32  * @run main/othervm/timeout=400 -Xbatch -Xmx128m -XX:MaxVectorSize=32 compiler.c2.cr6340864.TestLongVect
  33  */
  34 
  35 package compiler.c2.cr6340864;
  36 
  37 public class TestLongVect {
  38   private static final int ARRLEN = 997;
  39   private static final int ITERS  = 11000;
  40   private static final long ADD_INIT = Long.MAX_VALUE-500;
  41   private static final long BIT_MASK = 0xEC80F731EC80F731L;
  42   private static final int VALUE = 31;
  43   private static final int SHIFT = 64;
  44 
  45   public static void main(String args[]) {
  46     System.out.println("Testing Long vectors");
  47     int errn = test();
  48     if (errn > 0) {
  49       System.err.println("FAILED: " + errn + " errors");
  50       System.exit(97);
  51     }
  52     System.out.println("PASSED");
  53   }
  54 
  55   static int test() {
  56     long[] a0 = new long[ARRLEN];
  57     long[] a1 = new long[ARRLEN];
  58     long[] a2 = new long[ARRLEN];
  59     long[] a3 = new long[ARRLEN];
  60     long[] a4 = new long[ARRLEN];
  61     // Initialize
  62     long gold_sum = 0;
  63     for (int i=0; i<ARRLEN; i++) {
  64       long val = (long)(ADD_INIT+i);
  65       gold_sum += val;
  66       a1[i] = val;
  67       a2[i] = (long)VALUE;
  68       a3[i] = (long)-VALUE;
  69       a4[i] = (long)BIT_MASK;
  70     }
  71     System.out.println("Warmup");
  72     for (int i=0; i<ITERS; i++) {
  73       test_sum(a1);
  74       test_addc(a0, a1);
  75       test_addv(a0, a1, (long)VALUE);
  76       test_adda(a0, a1, a2);
  77       test_subc(a0, a1);
  78       test_subv(a0, a1, (long)VALUE);
  79       test_suba(a0, a1, a2);
  80 
  81       test_mulc(a0, a1);
  82       test_mulv(a0, a1, (long)VALUE);
  83       test_mula(a0, a1, a2);
  84       test_divc(a0, a1);
  85       test_divv(a0, a1, (long)VALUE);
  86       test_diva(a0, a1, a2);
  87       test_mulc_n(a0, a1);
  88       test_mulv(a0, a1, (long)-VALUE);
  89       test_mula(a0, a1, a3);
  90       test_divc_n(a0, a1);
  91       test_divv(a0, a1, (long)-VALUE);
  92       test_diva(a0, a1, a3);
  93 
  94       test_andc(a0, a1);
  95       test_andv(a0, a1, (long)BIT_MASK);
  96       test_anda(a0, a1, a4);
  97       test_orc(a0, a1);
  98       test_orv(a0, a1, (long)BIT_MASK);
  99       test_ora(a0, a1, a4);
 100       test_xorc(a0, a1);
 101       test_xorv(a0, a1, (long)BIT_MASK);
 102       test_xora(a0, a1, a4);
 103 
 104       test_sllc(a0, a1);
 105       test_sllv(a0, a1, VALUE);
 106       test_srlc(a0, a1);
 107       test_srlv(a0, a1, VALUE);
 108       test_srac(a0, a1);
 109       test_srav(a0, a1, VALUE);
 110 
 111       test_sllc_n(a0, a1);
 112       test_sllv(a0, a1, -VALUE);
 113       test_srlc_n(a0, a1);
 114       test_srlv(a0, a1, -VALUE);
 115       test_srac_n(a0, a1);
 116       test_srav(a0, a1, -VALUE);
 117 
 118       test_sllc_o(a0, a1);
 119       test_sllv(a0, a1, SHIFT);
 120       test_srlc_o(a0, a1);
 121       test_srlv(a0, a1, SHIFT);
 122       test_srac_o(a0, a1);
 123       test_srav(a0, a1, SHIFT);
 124 
 125       test_sllc_on(a0, a1);
 126       test_sllv(a0, a1, -SHIFT);
 127       test_srlc_on(a0, a1);
 128       test_srlv(a0, a1, -SHIFT);
 129       test_srac_on(a0, a1);
 130       test_srav(a0, a1, -SHIFT);
 131 
 132       test_sllc_add(a0, a1);
 133       test_sllv_add(a0, a1, ADD_INIT);
 134       test_srlc_add(a0, a1);
 135       test_srlv_add(a0, a1, ADD_INIT);
 136       test_srac_add(a0, a1);
 137       test_srav_add(a0, a1, ADD_INIT);
 138 
 139       test_sllc_and(a0, a1);
 140       test_sllv_and(a0, a1, BIT_MASK);
 141       test_srlc_and(a0, a1);
 142       test_srlv_and(a0, a1, BIT_MASK);
 143       test_srac_and(a0, a1);
 144       test_srav_and(a0, a1, BIT_MASK);
 145     }
 146     // Test and verify results
 147     System.out.println("Verification");
 148     int errn = 0;
 149     {
 150       long sum = test_sum(a1);
 151       if (sum != gold_sum) {
 152         System.err.println("test_sum:  " + sum + " != " + gold_sum);
 153         errn++;
 154       }
 155 
 156       test_addc(a0, a1);
 157       for (int i=0; i<ARRLEN; i++) {
 158         errn += verify("test_addc: ", i, a0[i], (long)((long)(ADD_INIT+i)+VALUE));
 159       }
 160       test_addv(a0, a1, (long)VALUE);
 161       for (int i=0; i<ARRLEN; i++) {
 162         errn += verify("test_addv: ", i, a0[i], (long)((long)(ADD_INIT+i)+VALUE));
 163       }
 164       test_adda(a0, a1, a2);
 165       for (int i=0; i<ARRLEN; i++) {
 166         errn += verify("test_adda: ", i, a0[i], (long)((long)(ADD_INIT+i)+VALUE));
 167       }
 168 
 169       test_subc(a0, a1);
 170       for (int i=0; i<ARRLEN; i++) {
 171         errn += verify("test_subc: ", i, a0[i], (long)((long)(ADD_INIT+i)-VALUE));
 172       }
 173       test_subv(a0, a1, (long)VALUE);
 174       for (int i=0; i<ARRLEN; i++) {
 175         errn += verify("test_subv: ", i, a0[i], (long)((long)(ADD_INIT+i)-VALUE));
 176       }
 177       test_suba(a0, a1, a2);
 178       for (int i=0; i<ARRLEN; i++) {
 179         errn += verify("test_suba: ", i, a0[i], (long)((long)(ADD_INIT+i)-VALUE));
 180       }
 181 
 182       test_mulc(a0, a1);
 183       for (int i=0; i<ARRLEN; i++) {
 184         errn += verify("test_mulc: ", i, a0[i], (long)((long)(ADD_INIT+i)*VALUE));
 185       }
 186       test_mulv(a0, a1, (long)VALUE);
 187       for (int i=0; i<ARRLEN; i++) {
 188         errn += verify("test_mulv: ", i, a0[i], (long)((long)(ADD_INIT+i)*VALUE));
 189       }
 190       test_mula(a0, a1, a2);
 191       for (int i=0; i<ARRLEN; i++) {
 192         errn += verify("test_mula: ", i, a0[i], (long)((long)(ADD_INIT+i)*VALUE));
 193       }
 194 
 195       test_divc(a0, a1);
 196       for (int i=0; i<ARRLEN; i++) {
 197         errn += verify("test_divc: ", i, a0[i], (long)((long)(ADD_INIT+i)/VALUE));
 198       }
 199       test_divv(a0, a1, (long)VALUE);
 200       for (int i=0; i<ARRLEN; i++) {
 201         errn += verify("test_divv: ", i, a0[i], (long)((long)(ADD_INIT+i)/VALUE));
 202       }
 203       test_diva(a0, a1, a2);
 204       for (int i=0; i<ARRLEN; i++) {
 205         errn += verify("test_diva: ", i, a0[i], (long)((long)(ADD_INIT+i)/VALUE));
 206       }
 207 
 208       test_mulc_n(a0, a1);
 209       for (int i=0; i<ARRLEN; i++) {
 210         errn += verify("test_mulc_n: ", i, a0[i], (long)((long)(ADD_INIT+i)*(-VALUE)));
 211       }
 212       test_mulv(a0, a1, (long)-VALUE);
 213       for (int i=0; i<ARRLEN; i++) {
 214         errn += verify("test_mulv_n: ", i, a0[i], (long)((long)(ADD_INIT+i)*(-VALUE)));
 215       }
 216       test_mula(a0, a1, a3);
 217       for (int i=0; i<ARRLEN; i++) {
 218         errn += verify("test_mula_n: ", i, a0[i], (long)((long)(ADD_INIT+i)*(-VALUE)));
 219       }
 220 
 221       test_divc_n(a0, a1);
 222       for (int i=0; i<ARRLEN; i++) {
 223         errn += verify("test_divc_n: ", i, a0[i], (long)((long)(ADD_INIT+i)/(-VALUE)));
 224       }
 225       test_divv(a0, a1, (long)-VALUE);
 226       for (int i=0; i<ARRLEN; i++) {
 227         errn += verify("test_divv_n: ", i, a0[i], (long)((long)(ADD_INIT+i)/(-VALUE)));
 228       }
 229       test_diva(a0, a1, a3);
 230       for (int i=0; i<ARRLEN; i++) {
 231         errn += verify("test_diva_n: ", i, a0[i], (long)((long)(ADD_INIT+i)/(-VALUE)));
 232       }
 233 
 234       test_andc(a0, a1);
 235       for (int i=0; i<ARRLEN; i++) {
 236         errn += verify("test_andc: ", i, a0[i], (long)((long)(ADD_INIT+i)&BIT_MASK));
 237       }
 238       test_andv(a0, a1, (long)BIT_MASK);
 239       for (int i=0; i<ARRLEN; i++) {
 240         errn += verify("test_andv: ", i, a0[i], (long)((long)(ADD_INIT+i)&BIT_MASK));
 241       }
 242       test_anda(a0, a1, a4);
 243       for (int i=0; i<ARRLEN; i++) {
 244         errn += verify("test_anda: ", i, a0[i], (long)((long)(ADD_INIT+i)&BIT_MASK));
 245       }
 246 
 247       test_orc(a0, a1);
 248       for (int i=0; i<ARRLEN; i++) {
 249         errn += verify("test_orc: ", i, a0[i], (long)((long)(ADD_INIT+i)|BIT_MASK));
 250       }
 251       test_orv(a0, a1, (long)BIT_MASK);
 252       for (int i=0; i<ARRLEN; i++) {
 253         errn += verify("test_orv: ", i, a0[i], (long)((long)(ADD_INIT+i)|BIT_MASK));
 254       }
 255       test_ora(a0, a1, a4);
 256       for (int i=0; i<ARRLEN; i++) {
 257         errn += verify("test_ora: ", i, a0[i], (long)((long)(ADD_INIT+i)|BIT_MASK));
 258       }
 259 
 260       test_xorc(a0, a1);
 261       for (int i=0; i<ARRLEN; i++) {
 262         errn += verify("test_xorc: ", i, a0[i], (long)((long)(ADD_INIT+i)^BIT_MASK));
 263       }
 264       test_xorv(a0, a1, (long)BIT_MASK);
 265       for (int i=0; i<ARRLEN; i++) {
 266         errn += verify("test_xorv: ", i, a0[i], (long)((long)(ADD_INIT+i)^BIT_MASK));
 267       }
 268       test_xora(a0, a1, a4);
 269       for (int i=0; i<ARRLEN; i++) {
 270         errn += verify("test_xora: ", i, a0[i], (long)((long)(ADD_INIT+i)^BIT_MASK));
 271       }
 272 
 273       test_sllc(a0, a1);
 274       for (int i=0; i<ARRLEN; i++) {
 275         errn += verify("test_sllc: ", i, a0[i], (long)((long)(ADD_INIT+i)<<VALUE));
 276       }
 277       test_sllv(a0, a1, VALUE);
 278       for (int i=0; i<ARRLEN; i++) {
 279         errn += verify("test_sllv: ", i, a0[i], (long)((long)(ADD_INIT+i)<<VALUE));
 280       }
 281 
 282       test_srlc(a0, a1);
 283       for (int i=0; i<ARRLEN; i++) {
 284         errn += verify("test_srlc: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>VALUE));
 285       }
 286       test_srlv(a0, a1, VALUE);
 287       for (int i=0; i<ARRLEN; i++) {
 288         errn += verify("test_srlv: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>VALUE));
 289       }
 290 
 291       test_srac(a0, a1);
 292       for (int i=0; i<ARRLEN; i++) {
 293         errn += verify("test_srac: ", i, a0[i], (long)((long)(ADD_INIT+i)>>VALUE));
 294       }
 295       test_srav(a0, a1, VALUE);
 296       for (int i=0; i<ARRLEN; i++) {
 297         errn += verify("test_srav: ", i, a0[i], (long)((long)(ADD_INIT+i)>>VALUE));
 298       }
 299 
 300       test_sllc_n(a0, a1);
 301       for (int i=0; i<ARRLEN; i++) {
 302         errn += verify("test_sllc_n: ", i, a0[i], (long)((long)(ADD_INIT+i)<<(-VALUE)));
 303       }
 304       test_sllv(a0, a1, -VALUE);
 305       for (int i=0; i<ARRLEN; i++) {
 306         errn += verify("test_sllv_n: ", i, a0[i], (long)((long)(ADD_INIT+i)<<(-VALUE)));
 307       }
 308 
 309       test_srlc_n(a0, a1);
 310       for (int i=0; i<ARRLEN; i++) {
 311         errn += verify("test_srlc_n: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>(-VALUE)));
 312       }
 313       test_srlv(a0, a1, -VALUE);
 314       for (int i=0; i<ARRLEN; i++) {
 315         errn += verify("test_srlv_n: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>(-VALUE)));
 316       }
 317 
 318       test_srac_n(a0, a1);
 319       for (int i=0; i<ARRLEN; i++) {
 320         errn += verify("test_srac_n: ", i, a0[i], (long)((long)(ADD_INIT+i)>>(-VALUE)));
 321       }
 322       test_srav(a0, a1, -VALUE);
 323       for (int i=0; i<ARRLEN; i++) {
 324         errn += verify("test_srav_n: ", i, a0[i], (long)((long)(ADD_INIT+i)>>(-VALUE)));
 325       }
 326 
 327       test_sllc_o(a0, a1);
 328       for (int i=0; i<ARRLEN; i++) {
 329         errn += verify("test_sllc_o: ", i, a0[i], (long)((long)(ADD_INIT+i)<<SHIFT));
 330       }
 331       test_sllv(a0, a1, SHIFT);
 332       for (int i=0; i<ARRLEN; i++) {
 333         errn += verify("test_sllv_o: ", i, a0[i], (long)((long)(ADD_INIT+i)<<SHIFT));
 334       }
 335 
 336       test_srlc_o(a0, a1);
 337       for (int i=0; i<ARRLEN; i++) {
 338         errn += verify("test_srlc_o: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>SHIFT));
 339       }
 340       test_srlv(a0, a1, SHIFT);
 341       for (int i=0; i<ARRLEN; i++) {
 342         errn += verify("test_srlv_o: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>SHIFT));
 343       }
 344 
 345       test_srac_o(a0, a1);
 346       for (int i=0; i<ARRLEN; i++) {
 347         errn += verify("test_srac_o: ", i, a0[i], (long)((long)(ADD_INIT+i)>>SHIFT));
 348       }
 349       test_srav(a0, a1, SHIFT);
 350       for (int i=0; i<ARRLEN; i++) {
 351         errn += verify("test_srav_o: ", i, a0[i], (long)((long)(ADD_INIT+i)>>SHIFT));
 352       }
 353 
 354       test_sllc_on(a0, a1);
 355       for (int i=0; i<ARRLEN; i++) {
 356         errn += verify("test_sllc_on: ", i, a0[i], (long)((long)(ADD_INIT+i)<<(-SHIFT)));
 357       }
 358       test_sllv(a0, a1, -SHIFT);
 359       for (int i=0; i<ARRLEN; i++) {
 360         errn += verify("test_sllv_on: ", i, a0[i], (long)((long)(ADD_INIT+i)<<(-SHIFT)));
 361       }
 362 
 363       test_srlc_on(a0, a1);
 364       for (int i=0; i<ARRLEN; i++) {
 365         errn += verify("test_srlc_on: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>(-SHIFT)));
 366       }
 367       test_srlv(a0, a1, -SHIFT);
 368       for (int i=0; i<ARRLEN; i++) {
 369         errn += verify("test_srlv_on: ", i, a0[i], (long)((long)(ADD_INIT+i)>>>(-SHIFT)));
 370       }
 371 
 372       test_srac_on(a0, a1);
 373       for (int i=0; i<ARRLEN; i++) {
 374         errn += verify("test_srac_on: ", i, a0[i], (long)((long)(ADD_INIT+i)>>(-SHIFT)));
 375       }
 376       test_srav(a0, a1, -SHIFT);
 377       for (int i=0; i<ARRLEN; i++) {
 378         errn += verify("test_srav_on: ", i, a0[i], (long)((long)(ADD_INIT+i)>>(-SHIFT)));
 379       }
 380 
 381       test_sllc_add(a0, a1);
 382       for (int i=0; i<ARRLEN; i++) {
 383         errn += verify("test_sllc_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)<<VALUE));
 384       }
 385       test_sllv_add(a0, a1, ADD_INIT);
 386       for (int i=0; i<ARRLEN; i++) {
 387         errn += verify("test_sllv_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)<<VALUE));
 388       }
 389 
 390       test_srlc_add(a0, a1);
 391       for (int i=0; i<ARRLEN; i++) {
 392         errn += verify("test_srlc_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)>>>VALUE));
 393       }
 394       test_srlv_add(a0, a1, ADD_INIT);
 395       for (int i=0; i<ARRLEN; i++) {
 396         errn += verify("test_srlv_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)>>>VALUE));
 397       }
 398 
 399       test_srac_add(a0, a1);
 400       for (int i=0; i<ARRLEN; i++) {
 401         errn += verify("test_srac_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)>>VALUE));
 402       }
 403       test_srav_add(a0, a1, ADD_INIT);
 404       for (int i=0; i<ARRLEN; i++) {
 405         errn += verify("test_srav_add: ", i, a0[i], (long)(((long)(ADD_INIT+i) + ADD_INIT)>>VALUE));
 406       }
 407 
 408       test_sllc_and(a0, a1);
 409       for (int i=0; i<ARRLEN; i++) {
 410         errn += verify("test_sllc_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)<<VALUE));
 411       }
 412       test_sllv_and(a0, a1, BIT_MASK);
 413       for (int i=0; i<ARRLEN; i++) {
 414         errn += verify("test_sllv_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)<<VALUE));
 415       }
 416 
 417       test_srlc_and(a0, a1);
 418       for (int i=0; i<ARRLEN; i++) {
 419         errn += verify("test_srlc_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)>>>VALUE));
 420       }
 421       test_srlv_and(a0, a1, BIT_MASK);
 422       for (int i=0; i<ARRLEN; i++) {
 423         errn += verify("test_srlv_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)>>>VALUE));
 424       }
 425 
 426       test_srac_and(a0, a1);
 427       for (int i=0; i<ARRLEN; i++) {
 428         errn += verify("test_srac_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)>>VALUE));
 429       }
 430       test_srav_and(a0, a1, BIT_MASK);
 431       for (int i=0; i<ARRLEN; i++) {
 432         errn += verify("test_srav_and: ", i, a0[i], (long)(((long)(ADD_INIT+i) & BIT_MASK)>>VALUE));
 433       }
 434 
 435     }
 436 
 437     if (errn > 0)
 438       return errn;
 439 
 440     System.out.println("Time");
 441     long start, end;
 442 
 443     start = System.currentTimeMillis();
 444     for (int i=0; i<ITERS; i++) {
 445       test_sum(a1);
 446     }
 447     end = System.currentTimeMillis();
 448     System.out.println("test_sum: " + (end - start));
 449 
 450     start = System.currentTimeMillis();
 451     for (int i=0; i<ITERS; i++) {
 452       test_addc(a0, a1);
 453     }
 454     end = System.currentTimeMillis();
 455     System.out.println("test_addc: " + (end - start));
 456     start = System.currentTimeMillis();
 457     for (int i=0; i<ITERS; i++) {
 458       test_addv(a0, a1, (long)VALUE);
 459     }
 460     end = System.currentTimeMillis();
 461     System.out.println("test_addv: " + (end - start));
 462     start = System.currentTimeMillis();
 463     for (int i=0; i<ITERS; i++) {
 464       test_adda(a0, a1, a2);
 465     }
 466     end = System.currentTimeMillis();
 467     System.out.println("test_adda: " + (end - start));
 468 
 469     start = System.currentTimeMillis();
 470     for (int i=0; i<ITERS; i++) {
 471       test_subc(a0, a1);
 472     }
 473     end = System.currentTimeMillis();
 474     System.out.println("test_subc: " + (end - start));
 475     start = System.currentTimeMillis();
 476     for (int i=0; i<ITERS; i++) {
 477       test_subv(a0, a1, (long)VALUE);
 478     }
 479     end = System.currentTimeMillis();
 480     System.out.println("test_subv: " + (end - start));
 481     start = System.currentTimeMillis();
 482     for (int i=0; i<ITERS; i++) {
 483       test_suba(a0, a1, a2);
 484     }
 485     end = System.currentTimeMillis();
 486     System.out.println("test_suba: " + (end - start));
 487 
 488     start = System.currentTimeMillis();
 489     for (int i=0; i<ITERS; i++) {
 490       test_mulc(a0, a1);
 491     }
 492     end = System.currentTimeMillis();
 493     System.out.println("test_mulc: " + (end - start));
 494     start = System.currentTimeMillis();
 495     for (int i=0; i<ITERS; i++) {
 496       test_mulv(a0, a1, (long)VALUE);
 497     }
 498     end = System.currentTimeMillis();
 499     System.out.println("test_mulv: " + (end - start));
 500     start = System.currentTimeMillis();
 501     for (int i=0; i<ITERS; i++) {
 502       test_mula(a0, a1, a2);
 503     }
 504     end = System.currentTimeMillis();
 505     System.out.println("test_mula: " + (end - start));
 506 
 507     start = System.currentTimeMillis();
 508     for (int i=0; i<ITERS; i++) {
 509       test_divc(a0, a1);
 510     }
 511     end = System.currentTimeMillis();
 512     System.out.println("test_divc: " + (end - start));
 513     start = System.currentTimeMillis();
 514     for (int i=0; i<ITERS; i++) {
 515       test_divv(a0, a1, (long)VALUE);
 516     }
 517     end = System.currentTimeMillis();
 518     System.out.println("test_divv: " + (end - start));
 519     start = System.currentTimeMillis();
 520     for (int i=0; i<ITERS; i++) {
 521       test_diva(a0, a1, a2);
 522     }
 523     end = System.currentTimeMillis();
 524     System.out.println("test_diva: " + (end - start));
 525 
 526     start = System.currentTimeMillis();
 527     for (int i=0; i<ITERS; i++) {
 528       test_mulc_n(a0, a1);
 529     }
 530     end = System.currentTimeMillis();
 531     System.out.println("test_mulc_n: " + (end - start));
 532     start = System.currentTimeMillis();
 533     for (int i=0; i<ITERS; i++) {
 534       test_mulv(a0, a1, (long)-VALUE);
 535     }
 536     end = System.currentTimeMillis();
 537     System.out.println("test_mulv_n: " + (end - start));
 538     start = System.currentTimeMillis();
 539     for (int i=0; i<ITERS; i++) {
 540       test_mula(a0, a1, a3);
 541     }
 542     end = System.currentTimeMillis();
 543     System.out.println("test_mula_n: " + (end - start));
 544 
 545     start = System.currentTimeMillis();
 546     for (int i=0; i<ITERS; i++) {
 547       test_divc_n(a0, a1);
 548     }
 549     end = System.currentTimeMillis();
 550     System.out.println("test_divc_n: " + (end - start));
 551     start = System.currentTimeMillis();
 552     for (int i=0; i<ITERS; i++) {
 553       test_divv(a0, a1, (long)-VALUE);
 554     }
 555     end = System.currentTimeMillis();
 556     System.out.println("test_divv_n: " + (end - start));
 557     start = System.currentTimeMillis();
 558     for (int i=0; i<ITERS; i++) {
 559       test_diva(a0, a1, a3);
 560     }
 561     end = System.currentTimeMillis();
 562     System.out.println("test_diva_n: " + (end - start));
 563 
 564     start = System.currentTimeMillis();
 565     for (int i=0; i<ITERS; i++) {
 566       test_andc(a0, a1);
 567     }
 568     end = System.currentTimeMillis();
 569     System.out.println("test_andc: " + (end - start));
 570     start = System.currentTimeMillis();
 571     for (int i=0; i<ITERS; i++) {
 572       test_andv(a0, a1, (long)BIT_MASK);
 573     }
 574     end = System.currentTimeMillis();
 575     System.out.println("test_andv: " + (end - start));
 576     start = System.currentTimeMillis();
 577     for (int i=0; i<ITERS; i++) {
 578       test_anda(a0, a1, a4);
 579     }
 580     end = System.currentTimeMillis();
 581     System.out.println("test_anda: " + (end - start));
 582 
 583     start = System.currentTimeMillis();
 584     for (int i=0; i<ITERS; i++) {
 585       test_orc(a0, a1);
 586     }
 587     end = System.currentTimeMillis();
 588     System.out.println("test_orc: " + (end - start));
 589     start = System.currentTimeMillis();
 590     for (int i=0; i<ITERS; i++) {
 591       test_orv(a0, a1, (long)BIT_MASK);
 592     }
 593     end = System.currentTimeMillis();
 594     System.out.println("test_orv: " + (end - start));
 595     start = System.currentTimeMillis();
 596     for (int i=0; i<ITERS; i++) {
 597       test_ora(a0, a1, a4);
 598     }
 599     end = System.currentTimeMillis();
 600     System.out.println("test_ora: " + (end - start));
 601 
 602     start = System.currentTimeMillis();
 603     for (int i=0; i<ITERS; i++) {
 604       test_xorc(a0, a1);
 605     }
 606     end = System.currentTimeMillis();
 607     System.out.println("test_xorc: " + (end - start));
 608     start = System.currentTimeMillis();
 609     for (int i=0; i<ITERS; i++) {
 610       test_xorv(a0, a1, (long)BIT_MASK);
 611     }
 612     end = System.currentTimeMillis();
 613     System.out.println("test_xorv: " + (end - start));
 614     start = System.currentTimeMillis();
 615     for (int i=0; i<ITERS; i++) {
 616       test_xora(a0, a1, a4);
 617     }
 618     end = System.currentTimeMillis();
 619     System.out.println("test_xora: " + (end - start));
 620 
 621     start = System.currentTimeMillis();
 622     for (int i=0; i<ITERS; i++) {
 623       test_sllc(a0, a1);
 624     }
 625     end = System.currentTimeMillis();
 626     System.out.println("test_sllc: " + (end - start));
 627     start = System.currentTimeMillis();
 628     for (int i=0; i<ITERS; i++) {
 629       test_sllv(a0, a1, VALUE);
 630     }
 631     end = System.currentTimeMillis();
 632     System.out.println("test_sllv: " + (end - start));
 633 
 634     start = System.currentTimeMillis();
 635     for (int i=0; i<ITERS; i++) {
 636       test_srlc(a0, a1);
 637     }
 638     end = System.currentTimeMillis();
 639     System.out.println("test_srlc: " + (end - start));
 640     start = System.currentTimeMillis();
 641     for (int i=0; i<ITERS; i++) {
 642       test_srlv(a0, a1, VALUE);
 643     }
 644     end = System.currentTimeMillis();
 645     System.out.println("test_srlv: " + (end - start));
 646 
 647     start = System.currentTimeMillis();
 648     for (int i=0; i<ITERS; i++) {
 649       test_srac(a0, a1);
 650     }
 651     end = System.currentTimeMillis();
 652     System.out.println("test_srac: " + (end - start));
 653     start = System.currentTimeMillis();
 654     for (int i=0; i<ITERS; i++) {
 655       test_srav(a0, a1, VALUE);
 656     }
 657     end = System.currentTimeMillis();
 658     System.out.println("test_srav: " + (end - start));
 659 
 660     start = System.currentTimeMillis();
 661     for (int i=0; i<ITERS; i++) {
 662       test_sllc_n(a0, a1);
 663     }
 664     end = System.currentTimeMillis();
 665     System.out.println("test_sllc_n: " + (end - start));
 666     start = System.currentTimeMillis();
 667     for (int i=0; i<ITERS; i++) {
 668       test_sllv(a0, a1, -VALUE);
 669     }
 670     end = System.currentTimeMillis();
 671     System.out.println("test_sllv_n: " + (end - start));
 672 
 673     start = System.currentTimeMillis();
 674     for (int i=0; i<ITERS; i++) {
 675       test_srlc_n(a0, a1);
 676     }
 677     end = System.currentTimeMillis();
 678     System.out.println("test_srlc_n: " + (end - start));
 679     start = System.currentTimeMillis();
 680     for (int i=0; i<ITERS; i++) {
 681       test_srlv(a0, a1, -VALUE);
 682     }
 683     end = System.currentTimeMillis();
 684     System.out.println("test_srlv_n: " + (end - start));
 685 
 686     start = System.currentTimeMillis();
 687     for (int i=0; i<ITERS; i++) {
 688       test_srac_n(a0, a1);
 689     }
 690     end = System.currentTimeMillis();
 691     System.out.println("test_srac_n: " + (end - start));
 692     start = System.currentTimeMillis();
 693     for (int i=0; i<ITERS; i++) {
 694       test_srav(a0, a1, -VALUE);
 695     }
 696     end = System.currentTimeMillis();
 697     System.out.println("test_srav_n: " + (end - start));
 698 
 699     start = System.currentTimeMillis();
 700     for (int i=0; i<ITERS; i++) {
 701       test_sllc_o(a0, a1);
 702     }
 703     end = System.currentTimeMillis();
 704     System.out.println("test_sllc_o: " + (end - start));
 705     start = System.currentTimeMillis();
 706     for (int i=0; i<ITERS; i++) {
 707       test_sllv(a0, a1, SHIFT);
 708     }
 709     end = System.currentTimeMillis();
 710     System.out.println("test_sllv_o: " + (end - start));
 711 
 712     start = System.currentTimeMillis();
 713     for (int i=0; i<ITERS; i++) {
 714       test_srlc_o(a0, a1);
 715     }
 716     end = System.currentTimeMillis();
 717     System.out.println("test_srlc_o: " + (end - start));
 718     start = System.currentTimeMillis();
 719     for (int i=0; i<ITERS; i++) {
 720       test_srlv(a0, a1, SHIFT);
 721     }
 722     end = System.currentTimeMillis();
 723     System.out.println("test_srlv_o: " + (end - start));
 724 
 725     start = System.currentTimeMillis();
 726     for (int i=0; i<ITERS; i++) {
 727       test_srac_o(a0, a1);
 728     }
 729     end = System.currentTimeMillis();
 730     System.out.println("test_srac_o: " + (end - start));
 731     start = System.currentTimeMillis();
 732     for (int i=0; i<ITERS; i++) {
 733       test_srav(a0, a1, SHIFT);
 734     }
 735     end = System.currentTimeMillis();
 736     System.out.println("test_srav_o: " + (end - start));
 737 
 738     start = System.currentTimeMillis();
 739     for (int i=0; i<ITERS; i++) {
 740       test_sllc_on(a0, a1);
 741     }
 742     end = System.currentTimeMillis();
 743     System.out.println("test_sllc_on: " + (end - start));
 744     start = System.currentTimeMillis();
 745     for (int i=0; i<ITERS; i++) {
 746       test_sllv(a0, a1, -SHIFT);
 747     }
 748     end = System.currentTimeMillis();
 749     System.out.println("test_sllv_on: " + (end - start));
 750 
 751     start = System.currentTimeMillis();
 752     for (int i=0; i<ITERS; i++) {
 753       test_srlc_on(a0, a1);
 754     }
 755     end = System.currentTimeMillis();
 756     System.out.println("test_srlc_on: " + (end - start));
 757     start = System.currentTimeMillis();
 758     for (int i=0; i<ITERS; i++) {
 759       test_srlv(a0, a1, -SHIFT);
 760     }
 761     end = System.currentTimeMillis();
 762     System.out.println("test_srlv_on: " + (end - start));
 763 
 764     start = System.currentTimeMillis();
 765     for (int i=0; i<ITERS; i++) {
 766       test_srac_on(a0, a1);
 767     }
 768     end = System.currentTimeMillis();
 769     System.out.println("test_srac_on: " + (end - start));
 770     start = System.currentTimeMillis();
 771     for (int i=0; i<ITERS; i++) {
 772       test_srav(a0, a1, -SHIFT);
 773     }
 774     end = System.currentTimeMillis();
 775     System.out.println("test_srav_on: " + (end - start));
 776 
 777     start = System.currentTimeMillis();
 778     for (int i=0; i<ITERS; i++) {
 779       test_sllc_add(a0, a1);
 780     }
 781     end = System.currentTimeMillis();
 782     System.out.println("test_sllc_add: " + (end - start));
 783     start = System.currentTimeMillis();
 784     for (int i=0; i<ITERS; i++) {
 785       test_sllv_add(a0, a1, ADD_INIT);
 786     }
 787     end = System.currentTimeMillis();
 788     System.out.println("test_sllv_add: " + (end - start));
 789 
 790     start = System.currentTimeMillis();
 791     for (int i=0; i<ITERS; i++) {
 792       test_srlc_add(a0, a1);
 793     }
 794     end = System.currentTimeMillis();
 795     System.out.println("test_srlc_add: " + (end - start));
 796     start = System.currentTimeMillis();
 797     for (int i=0; i<ITERS; i++) {
 798       test_srlv_add(a0, a1, ADD_INIT);
 799     }
 800     end = System.currentTimeMillis();
 801     System.out.println("test_srlv_add: " + (end - start));
 802 
 803     start = System.currentTimeMillis();
 804     for (int i=0; i<ITERS; i++) {
 805       test_srac_add(a0, a1);
 806     }
 807     end = System.currentTimeMillis();
 808     System.out.println("test_srac_add: " + (end - start));
 809     start = System.currentTimeMillis();
 810     for (int i=0; i<ITERS; i++) {
 811       test_srav_add(a0, a1, ADD_INIT);
 812     }
 813     end = System.currentTimeMillis();
 814     System.out.println("test_srav_add: " + (end - start));
 815 
 816     start = System.currentTimeMillis();
 817     for (int i=0; i<ITERS; i++) {
 818       test_sllc_and(a0, a1);
 819     }
 820     end = System.currentTimeMillis();
 821     System.out.println("test_sllc_and: " + (end - start));
 822     start = System.currentTimeMillis();
 823     for (int i=0; i<ITERS; i++) {
 824       test_sllv_and(a0, a1, BIT_MASK);
 825     }
 826     end = System.currentTimeMillis();
 827     System.out.println("test_sllv_and: " + (end - start));
 828 
 829     start = System.currentTimeMillis();
 830     for (int i=0; i<ITERS; i++) {
 831       test_srlc_and(a0, a1);
 832     }
 833     end = System.currentTimeMillis();
 834     System.out.println("test_srlc_and: " + (end - start));
 835     start = System.currentTimeMillis();
 836     for (int i=0; i<ITERS; i++) {
 837       test_srlv_and(a0, a1, BIT_MASK);
 838     }
 839     end = System.currentTimeMillis();
 840     System.out.println("test_srlv_and: " + (end - start));
 841 
 842     start = System.currentTimeMillis();
 843     for (int i=0; i<ITERS; i++) {
 844       test_srac_and(a0, a1);
 845     }
 846     end = System.currentTimeMillis();
 847     System.out.println("test_srac_and: " + (end - start));
 848     start = System.currentTimeMillis();
 849     for (int i=0; i<ITERS; i++) {
 850       test_srav_and(a0, a1, BIT_MASK);
 851     }
 852     end = System.currentTimeMillis();
 853     System.out.println("test_srav_and: " + (end - start));
 854 
 855     return errn;
 856   }
 857 
 858   static long test_sum(long[] a1) {
 859     long sum = 0;
 860     for (int i = 0; i < a1.length; i+=1) {
 861       sum += a1[i];
 862     }
 863     return sum;
 864   }
 865 
 866   static void test_addc(long[] a0, long[] a1) {
 867     for (int i = 0; i < a0.length; i+=1) {
 868       a0[i] = (long)(a1[i]+VALUE);
 869     }
 870   }
 871   static void test_addv(long[] a0, long[] a1, long b) {
 872     for (int i = 0; i < a0.length; i+=1) {
 873       a0[i] = (long)(a1[i]+b);
 874     }
 875   }
 876   static void test_adda(long[] a0, long[] a1, long[] a2) {
 877     for (int i = 0; i < a0.length; i+=1) {
 878       a0[i] = (long)(a1[i]+a2[i]);
 879     }
 880   }
 881 
 882   static void test_subc(long[] a0, long[] a1) {
 883     for (int i = 0; i < a0.length; i+=1) {
 884       a0[i] = (long)(a1[i]-VALUE);
 885     }
 886   }
 887   static void test_subv(long[] a0, long[] a1, long b) {
 888     for (int i = 0; i < a0.length; i+=1) {
 889       a0[i] = (long)(a1[i]-b);
 890     }
 891   }
 892   static void test_suba(long[] a0, long[] a1, long[] a2) {
 893     for (int i = 0; i < a0.length; i+=1) {
 894       a0[i] = (long)(a1[i]-a2[i]);
 895     }
 896   }
 897 
 898   static void test_mulc(long[] a0, long[] a1) {
 899     for (int i = 0; i < a0.length; i+=1) {
 900       a0[i] = (long)(a1[i]*VALUE);
 901     }
 902   }
 903   static void test_mulc_n(long[] a0, long[] a1) {
 904     for (int i = 0; i < a0.length; i+=1) {
 905       a0[i] = (long)(a1[i]*(-VALUE));
 906     }
 907   }
 908   static void test_mulv(long[] a0, long[] a1, long b) {
 909     for (int i = 0; i < a0.length; i+=1) {
 910       a0[i] = (long)(a1[i]*b);
 911     }
 912   }
 913   static void test_mula(long[] a0, long[] a1, long[] a2) {
 914     for (int i = 0; i < a0.length; i+=1) {
 915       a0[i] = (long)(a1[i]*a2[i]);
 916     }
 917   }
 918 
 919   static void test_divc(long[] a0, long[] a1) {
 920     for (int i = 0; i < a0.length; i+=1) {
 921       a0[i] = (long)(a1[i]/VALUE);
 922     }
 923   }
 924   static void test_divc_n(long[] a0, long[] a1) {
 925     for (int i = 0; i < a0.length; i+=1) {
 926       a0[i] = (long)(a1[i]/(-VALUE));
 927     }
 928   }
 929   static void test_divv(long[] a0, long[] a1, long b) {
 930     for (int i = 0; i < a0.length; i+=1) {
 931       a0[i] = (long)(a1[i]/b);
 932     }
 933   }
 934   static void test_diva(long[] a0, long[] a1, long[] a2) {
 935     for (int i = 0; i < a0.length; i+=1) {
 936       a0[i] = (long)(a1[i]/a2[i]);
 937     }
 938   }
 939 
 940   static void test_andc(long[] a0, long[] a1) {
 941     for (int i = 0; i < a0.length; i+=1) {
 942       a0[i] = (long)(a1[i]&BIT_MASK);
 943     }
 944   }
 945   static void test_andv(long[] a0, long[] a1, long b) {
 946     for (int i = 0; i < a0.length; i+=1) {
 947       a0[i] = (long)(a1[i]&b);
 948     }
 949   }
 950   static void test_anda(long[] a0, long[] a1, long[] a2) {
 951     for (int i = 0; i < a0.length; i+=1) {
 952       a0[i] = (long)(a1[i]&a2[i]);
 953     }
 954   }
 955 
 956   static void test_orc(long[] a0, long[] a1) {
 957     for (int i = 0; i < a0.length; i+=1) {
 958       a0[i] = (long)(a1[i]|BIT_MASK);
 959     }
 960   }
 961   static void test_orv(long[] a0, long[] a1, long b) {
 962     for (int i = 0; i < a0.length; i+=1) {
 963       a0[i] = (long)(a1[i]|b);
 964     }
 965   }
 966   static void test_ora(long[] a0, long[] a1, long[] a2) {
 967     for (int i = 0; i < a0.length; i+=1) {
 968       a0[i] = (long)(a1[i]|a2[i]);
 969     }
 970   }
 971 
 972   static void test_xorc(long[] a0, long[] a1) {
 973     for (int i = 0; i < a0.length; i+=1) {
 974       a0[i] = (long)(a1[i]^BIT_MASK);
 975     }
 976   }
 977   static void test_xorv(long[] a0, long[] a1, long b) {
 978     for (int i = 0; i < a0.length; i+=1) {
 979       a0[i] = (long)(a1[i]^b);
 980     }
 981   }
 982   static void test_xora(long[] a0, long[] a1, long[] a2) {
 983     for (int i = 0; i < a0.length; i+=1) {
 984       a0[i] = (long)(a1[i]^a2[i]);
 985     }
 986   }
 987 
 988   static void test_sllc(long[] a0, long[] a1) {
 989     for (int i = 0; i < a0.length; i+=1) {
 990       a0[i] = (long)(a1[i]<<VALUE);
 991     }
 992   }
 993   static void test_sllc_n(long[] a0, long[] a1) {
 994     for (int i = 0; i < a0.length; i+=1) {
 995       a0[i] = (long)(a1[i]<<(-VALUE));
 996     }
 997   }
 998   static void test_sllc_o(long[] a0, long[] a1) {
 999     for (int i = 0; i < a0.length; i+=1) {
1000       a0[i] = (long)(a1[i]<<SHIFT);
1001     }
1002   }
1003   static void test_sllc_on(long[] a0, long[] a1) {
1004     for (int i = 0; i < a0.length; i+=1) {
1005       a0[i] = (long)(a1[i]<<(-SHIFT));
1006     }
1007   }
1008   static void test_sllv(long[] a0, long[] a1, int b) {
1009     for (int i = 0; i < a0.length; i+=1) {
1010       a0[i] = (long)(a1[i]<<b);
1011     }
1012   }
1013   static void test_sllc_add(long[] a0, long[] a1) {
1014     for (int i = 0; i < a0.length; i+=1) {
1015       a0[i] = (long)((a1[i] + ADD_INIT)<<VALUE);
1016     }
1017   }
1018   static void test_sllv_add(long[] a0, long[] a1, long b) {
1019     for (int i = 0; i < a0.length; i+=1) {
1020       a0[i] = (long)((a1[i] + b)<<VALUE);
1021     }
1022   }
1023   static void test_sllc_and(long[] a0, long[] a1) {
1024     for (int i = 0; i < a0.length; i+=1) {
1025       a0[i] = (long)((a1[i] & BIT_MASK)<<VALUE);
1026     }
1027   }
1028   static void test_sllv_and(long[] a0, long[] a1, long b) {
1029     for (int i = 0; i < a0.length; i+=1) {
1030       a0[i] = (long)((a1[i] & b)<<VALUE);
1031     }
1032   }
1033 
1034   static void test_srlc(long[] a0, long[] a1) {
1035     for (int i = 0; i < a0.length; i+=1) {
1036       a0[i] = (long)(a1[i]>>>VALUE);
1037     }
1038   }
1039   static void test_srlc_n(long[] a0, long[] a1) {
1040     for (int i = 0; i < a0.length; i+=1) {
1041       a0[i] = (long)(a1[i]>>>(-VALUE));
1042     }
1043   }
1044   static void test_srlc_o(long[] a0, long[] a1) {
1045     for (int i = 0; i < a0.length; i+=1) {
1046       a0[i] = (long)(a1[i]>>>SHIFT);
1047     }
1048   }
1049   static void test_srlc_on(long[] a0, long[] a1) {
1050     for (int i = 0; i < a0.length; i+=1) {
1051       a0[i] = (long)(a1[i]>>>(-SHIFT));
1052     }
1053   }
1054   static void test_srlv(long[] a0, long[] a1, int b) {
1055     for (int i = 0; i < a0.length; i+=1) {
1056       a0[i] = (long)(a1[i]>>>b);
1057     }
1058   }
1059   static void test_srlc_add(long[] a0, long[] a1) {
1060     for (int i = 0; i < a0.length; i+=1) {
1061       a0[i] = (long)((a1[i] + ADD_INIT)>>>VALUE);
1062     }
1063   }
1064   static void test_srlv_add(long[] a0, long[] a1, long b) {
1065     for (int i = 0; i < a0.length; i+=1) {
1066       a0[i] = (long)((a1[i] + b)>>>VALUE);
1067     }
1068   }
1069   static void test_srlc_and(long[] a0, long[] a1) {
1070     for (int i = 0; i < a0.length; i+=1) {
1071       a0[i] = (long)((a1[i] & BIT_MASK)>>>VALUE);
1072     }
1073   }
1074   static void test_srlv_and(long[] a0, long[] a1, long b) {
1075     for (int i = 0; i < a0.length; i+=1) {
1076       a0[i] = (long)((a1[i] & b)>>>VALUE);
1077     }
1078   }
1079 
1080   static void test_srac(long[] a0, long[] a1) {
1081     for (int i = 0; i < a0.length; i+=1) {
1082       a0[i] = (long)(a1[i]>>VALUE);
1083     }
1084   }
1085   static void test_srac_n(long[] a0, long[] a1) {
1086     for (int i = 0; i < a0.length; i+=1) {
1087       a0[i] = (long)(a1[i]>>(-VALUE));
1088     }
1089   }
1090   static void test_srac_o(long[] a0, long[] a1) {
1091     for (int i = 0; i < a0.length; i+=1) {
1092       a0[i] = (long)(a1[i]>>SHIFT);
1093     }
1094   }
1095   static void test_srac_on(long[] a0, long[] a1) {
1096     for (int i = 0; i < a0.length; i+=1) {
1097       a0[i] = (long)(a1[i]>>(-SHIFT));
1098     }
1099   }
1100   static void test_srav(long[] a0, long[] a1, int b) {
1101     for (int i = 0; i < a0.length; i+=1) {
1102       a0[i] = (long)(a1[i]>>b);
1103     }
1104   }
1105   static void test_srac_add(long[] a0, long[] a1) {
1106     for (int i = 0; i < a0.length; i+=1) {
1107       a0[i] = (long)((a1[i] + ADD_INIT)>>VALUE);
1108     }
1109   }
1110   static void test_srav_add(long[] a0, long[] a1, long b) {
1111     for (int i = 0; i < a0.length; i+=1) {
1112       a0[i] = (long)((a1[i] + b)>>VALUE);
1113     }
1114   }
1115   static void test_srac_and(long[] a0, long[] a1) {
1116     for (int i = 0; i < a0.length; i+=1) {
1117       a0[i] = (long)((a1[i] & BIT_MASK)>>VALUE);
1118     }
1119   }
1120   static void test_srav_and(long[] a0, long[] a1, long b) {
1121     for (int i = 0; i < a0.length; i+=1) {
1122       a0[i] = (long)((a1[i] & b)>>VALUE);
1123     }
1124   }
1125 
1126   static int verify(String text, int i, long elem, long val) {
1127     if (elem != val) {
1128       System.err.println(text + "[" + i + "] = " + elem + " != " + val);
1129       return 1;
1130     }
1131     return 0;
1132   }
1133 }
--- EOF ---