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