hotspot/test/compiler/7200264/TestIntVect.java
author kvn
Tue, 25 Sep 2012 15:48:17 -0700
changeset 13894 068a8efe7203
permissions -rw-r--r--
7200264: 7192963 changes disabled shift vectors Summary: Replaced is_vector_use() call with explicit check for vector shift's count. Reviewed-by: twisti, roland, dlong, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13894
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     1
/*
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     4
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     8
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    13
 * accompanied this code).
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    14
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    18
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    21
 * questions.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    22
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    23
 */
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    24
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    25
/**
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    26
 * @test
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    27
 * @bug 7200264
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    28
 * @summary 7192963 changes disabled shift vectors
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    29
 *
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    30
 * @run shell Test7200264.sh
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    31
 */
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    32
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    33
/*
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    34
 * Copy of test/compiler/6340864/TestIntVect.java without performance tests.
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    35
 */
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    36
public class TestIntVect {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    37
  private static final int ARRLEN = 997;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    38
  private static final int ITERS  = 11000;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    39
  private static final int ADD_INIT = Integer.MAX_VALUE-500;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    40
  private static final int BIT_MASK = 0xEC80F731;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    41
  private static final int VALUE = 15;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    42
  private static final int SHIFT = 32;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    43
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    44
  public static void main(String args[]) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    45
    System.out.println("Testing Integer vectors");
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    46
    int errn = test();
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    47
    if (errn > 0) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    48
      System.err.println("FAILED: " + errn + " errors");
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    49
      System.exit(97);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    50
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    51
    System.out.println("PASSED");
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    52
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    53
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    54
  static int test() {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    55
    int[] a0 = new int[ARRLEN];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    56
    int[] a1 = new int[ARRLEN];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    57
    int[] a2 = new int[ARRLEN];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    58
    int[] a3 = new int[ARRLEN];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    59
    int[] a4 = new int[ARRLEN];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    60
    long[] p2 = new long[ARRLEN/2];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    61
    // Initialize
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    62
    int gold_sum = 0;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    63
    for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    64
      int val = (int)(ADD_INIT+i);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    65
      gold_sum += val;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    66
      a1[i] = val;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    67
      a2[i] = (int)VALUE;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    68
      a3[i] = (int)-VALUE;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    69
      a4[i] = (int)BIT_MASK;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    70
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    71
    System.out.println("Warmup");
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    72
    for (int i=0; i<ITERS; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    73
      test_sum(a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    74
      test_addc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    75
      test_addv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    76
      test_adda(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    77
      test_subc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    78
      test_subv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    79
      test_suba(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    80
      test_mulc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    81
      test_mulv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    82
      test_mula(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    83
      test_divc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    84
      test_divv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    85
      test_diva(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    86
      test_mulc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    87
      test_mulv(a0, a1, (int)-VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    88
      test_mula(a0, a1, a3);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    89
      test_divc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    90
      test_divv(a0, a1, (int)-VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    91
      test_diva(a0, a1, a3);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    92
      test_andc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    93
      test_andv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    94
      test_anda(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    95
      test_orc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    96
      test_orv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    97
      test_ora(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    98
      test_xorc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
    99
      test_xorv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   100
      test_xora(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   101
      test_sllc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   102
      test_sllv(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   103
      test_srlc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   104
      test_srlv(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   105
      test_srac(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   106
      test_srav(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   107
      test_sllc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   108
      test_sllv(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   109
      test_srlc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   110
      test_srlv(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   111
      test_srac_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   112
      test_srav(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   113
      test_sllc_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   114
      test_sllv(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   115
      test_srlc_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   116
      test_srlv(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   117
      test_srac_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   118
      test_srav(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   119
      test_sllc_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   120
      test_sllv(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   121
      test_srlc_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   122
      test_srlv(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   123
      test_srac_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   124
      test_srav(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   125
      test_pack2(p2, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   126
      test_unpack2(a0, p2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   127
      test_pack2_swap(p2, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   128
      test_unpack2_swap(a0, p2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   129
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   130
    // Test and verify results
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   131
    System.out.println("Verification");
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   132
    int errn = 0;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   133
    {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   134
      int sum = test_sum(a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   135
      if (sum != gold_sum) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   136
        System.err.println("test_sum:  " + sum + " != " + gold_sum);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   137
        errn++;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   138
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   139
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   140
      test_addc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   141
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   142
        errn += verify("test_addc: ", i, a0[i], (int)((int)(ADD_INIT+i)+VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   143
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   144
      test_addv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   145
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   146
        errn += verify("test_addv: ", i, a0[i], (int)((int)(ADD_INIT+i)+VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   147
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   148
      test_adda(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   149
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   150
        errn += verify("test_adda: ", i, a0[i], (int)((int)(ADD_INIT+i)+VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   151
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   152
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   153
      test_subc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   154
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   155
        errn += verify("test_subc: ", i, a0[i], (int)((int)(ADD_INIT+i)-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   156
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   157
      test_subv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   158
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   159
        errn += verify("test_subv: ", i, a0[i], (int)((int)(ADD_INIT+i)-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   160
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   161
      test_suba(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   162
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   163
        errn += verify("test_suba: ", i, a0[i], (int)((int)(ADD_INIT+i)-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   164
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   165
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   166
      test_mulc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   167
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   168
        errn += verify("test_mulc: ", i, a0[i], (int)((int)(ADD_INIT+i)*VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   169
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   170
      test_mulv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   171
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   172
        errn += verify("test_mulv: ", i, a0[i], (int)((int)(ADD_INIT+i)*VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   173
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   174
      test_mula(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   175
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   176
        errn += verify("test_mula: ", i, a0[i], (int)((int)(ADD_INIT+i)*VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   177
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   178
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   179
      test_divc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   180
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   181
        errn += verify("test_divc: ", i, a0[i], (int)((int)(ADD_INIT+i)/VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   182
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   183
      test_divv(a0, a1, (int)VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   184
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   185
        errn += verify("test_divv: ", i, a0[i], (int)((int)(ADD_INIT+i)/VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   186
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   187
      test_diva(a0, a1, a2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   188
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   189
        errn += verify("test_diva: ", i, a0[i], (int)((int)(ADD_INIT+i)/VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   190
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   191
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   192
      test_mulc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   193
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   194
        errn += verify("test_mulc_n: ", i, a0[i], (int)((int)(ADD_INIT+i)*(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   195
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   196
      test_mulv(a0, a1, (int)-VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   197
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   198
        errn += verify("test_mulv_n: ", i, a0[i], (int)((int)(ADD_INIT+i)*(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   199
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   200
      test_mula(a0, a1, a3);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   201
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   202
        errn += verify("test_mula_n: ", i, a0[i], (int)((int)(ADD_INIT+i)*(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   203
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   204
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   205
      test_divc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   206
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   207
        errn += verify("test_divc_n: ", i, a0[i], (int)((int)(ADD_INIT+i)/(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   208
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   209
      test_divv(a0, a1, (int)-VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   210
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   211
        errn += verify("test_divv_n: ", i, a0[i], (int)((int)(ADD_INIT+i)/(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   212
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   213
      test_diva(a0, a1, a3);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   214
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   215
        errn += verify("test_diva_n: ", i, a0[i], (int)((int)(ADD_INIT+i)/(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   216
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   217
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   218
      test_andc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   219
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   220
        errn += verify("test_andc: ", i, a0[i], (int)((int)(ADD_INIT+i)&BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   221
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   222
      test_andv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   223
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   224
        errn += verify("test_andv: ", i, a0[i], (int)((int)(ADD_INIT+i)&BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   225
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   226
      test_anda(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   227
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   228
        errn += verify("test_anda: ", i, a0[i], (int)((int)(ADD_INIT+i)&BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   229
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   230
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   231
      test_orc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   232
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   233
        errn += verify("test_orc: ", i, a0[i], (int)((int)(ADD_INIT+i)|BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   234
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   235
      test_orv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   236
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   237
        errn += verify("test_orv: ", i, a0[i], (int)((int)(ADD_INIT+i)|BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   238
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   239
      test_ora(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   240
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   241
        errn += verify("test_ora: ", i, a0[i], (int)((int)(ADD_INIT+i)|BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   242
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   243
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   244
      test_xorc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   245
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   246
        errn += verify("test_xorc: ", i, a0[i], (int)((int)(ADD_INIT+i)^BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   247
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   248
      test_xorv(a0, a1, (int)BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   249
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   250
        errn += verify("test_xorv: ", i, a0[i], (int)((int)(ADD_INIT+i)^BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   251
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   252
      test_xora(a0, a1, a4);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   253
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   254
        errn += verify("test_xora: ", i, a0[i], (int)((int)(ADD_INIT+i)^BIT_MASK));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   255
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   256
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   257
      test_sllc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   258
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   259
        errn += verify("test_sllc: ", i, a0[i], (int)((int)(ADD_INIT+i)<<VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   260
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   261
      test_sllv(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   262
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   263
        errn += verify("test_sllv: ", i, a0[i], (int)((int)(ADD_INIT+i)<<VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   264
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   265
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   266
      test_srlc(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   267
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   268
        errn += verify("test_srlc: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   269
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   270
      test_srlv(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   271
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   272
        errn += verify("test_srlv: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   273
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   274
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   275
      test_srac(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   276
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   277
        errn += verify("test_srac: ", i, a0[i], (int)((int)(ADD_INIT+i)>>VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   278
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   279
      test_srav(a0, a1, VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   280
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   281
        errn += verify("test_srav: ", i, a0[i], (int)((int)(ADD_INIT+i)>>VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   282
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   283
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   284
      test_sllc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   285
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   286
        errn += verify("test_sllc_n: ", i, a0[i], (int)((int)(ADD_INIT+i)<<(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   287
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   288
      test_sllv(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   289
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   290
        errn += verify("test_sllv_n: ", i, a0[i], (int)((int)(ADD_INIT+i)<<(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   291
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   292
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   293
      test_srlc_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   294
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   295
        errn += verify("test_srlc_n: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   296
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   297
      test_srlv(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   298
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   299
        errn += verify("test_srlv_n: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   300
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   301
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   302
      test_srac_n(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   303
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   304
        errn += verify("test_srac_n: ", i, a0[i], (int)((int)(ADD_INIT+i)>>(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   305
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   306
      test_srav(a0, a1, -VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   307
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   308
        errn += verify("test_srav_n: ", i, a0[i], (int)((int)(ADD_INIT+i)>>(-VALUE)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   309
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   310
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   311
      test_sllc_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   312
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   313
        errn += verify("test_sllc_o: ", i, a0[i], (int)((int)(ADD_INIT+i)<<SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   314
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   315
      test_sllv(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   316
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   317
        errn += verify("test_sllv_o: ", i, a0[i], (int)((int)(ADD_INIT+i)<<SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   318
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   319
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   320
      test_srlc_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   321
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   322
        errn += verify("test_srlc_o: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   323
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   324
      test_srlv(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   325
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   326
        errn += verify("test_srlv_o: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   327
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   328
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   329
      test_srac_o(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   330
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   331
        errn += verify("test_srac_o: ", i, a0[i], (int)((int)(ADD_INIT+i)>>SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   332
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   333
      test_srav(a0, a1, SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   334
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   335
        errn += verify("test_srav_o: ", i, a0[i], (int)((int)(ADD_INIT+i)>>SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   336
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   337
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   338
      test_sllc_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   339
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   340
        errn += verify("test_sllc_on: ", i, a0[i], (int)((int)(ADD_INIT+i)<<(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   341
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   342
      test_sllv(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   343
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   344
        errn += verify("test_sllv_on: ", i, a0[i], (int)((int)(ADD_INIT+i)<<(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   345
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   346
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   347
      test_srlc_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   348
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   349
        errn += verify("test_srlc_on: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   350
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   351
      test_srlv(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   352
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   353
        errn += verify("test_srlv_on: ", i, a0[i], (int)((int)(ADD_INIT+i)>>>(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   354
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   355
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   356
      test_srac_on(a0, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   357
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   358
        errn += verify("test_srac_on: ", i, a0[i], (int)((int)(ADD_INIT+i)>>(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   359
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   360
      test_srav(a0, a1, -SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   361
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   362
        errn += verify("test_srav_on: ", i, a0[i], (int)((int)(ADD_INIT+i)>>(-SHIFT)));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   363
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   364
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   365
      test_pack2(p2, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   366
      for (int i=0; i<ARRLEN/2; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   367
        errn += verify("test_pack2: ", i, p2[i], ((long)(ADD_INIT+2*i) & 0xFFFFFFFFl) | ((long)(ADD_INIT+2*i+1) << 32));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   368
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   369
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   370
        a0[i] = -1;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   371
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   372
      test_unpack2(a0, p2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   373
      for (int i=0; i<(ARRLEN&(-2)); i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   374
        errn += verify("test_unpack2: ", i, a0[i], (ADD_INIT+i));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   375
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   376
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   377
      test_pack2_swap(p2, a1);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   378
      for (int i=0; i<ARRLEN/2; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   379
        errn += verify("test_pack2_swap: ", i, p2[i], ((long)(ADD_INIT+2*i+1) & 0xFFFFFFFFl) | ((long)(ADD_INIT+2*i) << 32));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   380
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   381
      for (int i=0; i<ARRLEN; i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   382
        a0[i] = -1;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   383
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   384
      test_unpack2_swap(a0, p2);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   385
      for (int i=0; i<(ARRLEN&(-2)); i++) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   386
        errn += verify("test_unpack2_swap: ", i, a0[i], (ADD_INIT+i));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   387
      }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   388
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   389
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   390
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   391
    return errn;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   392
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   393
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   394
  static int test_sum(int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   395
    int sum = 0;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   396
    for (int i = 0; i < a1.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   397
      sum += a1[i];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   398
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   399
    return sum;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   400
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   401
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   402
  static void test_addc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   403
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   404
      a0[i] = (int)(a1[i]+VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   405
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   406
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   407
  static void test_addv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   408
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   409
      a0[i] = (int)(a1[i]+b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   410
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   411
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   412
  static void test_adda(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   413
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   414
      a0[i] = (int)(a1[i]+a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   415
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   416
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   417
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   418
  static void test_subc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   419
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   420
      a0[i] = (int)(a1[i]-VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   421
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   422
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   423
  static void test_subv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   424
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   425
      a0[i] = (int)(a1[i]-b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   426
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   427
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   428
  static void test_suba(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   429
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   430
      a0[i] = (int)(a1[i]-a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   431
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   432
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   433
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   434
  static void test_mulc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   435
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   436
      a0[i] = (int)(a1[i]*VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   437
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   438
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   439
  static void test_mulc_n(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   440
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   441
      a0[i] = (int)(a1[i]*(-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   442
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   443
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   444
  static void test_mulv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   445
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   446
      a0[i] = (int)(a1[i]*b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   447
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   448
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   449
  static void test_mula(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   450
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   451
      a0[i] = (int)(a1[i]*a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   452
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   453
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   454
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   455
  static void test_divc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   456
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   457
      a0[i] = (int)(a1[i]/VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   458
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   459
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   460
  static void test_divc_n(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   461
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   462
      a0[i] = (int)(a1[i]/(-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   463
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   464
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   465
  static void test_divv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   466
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   467
      a0[i] = (int)(a1[i]/b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   468
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   469
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   470
  static void test_diva(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   471
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   472
      a0[i] = (int)(a1[i]/a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   473
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   474
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   475
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   476
  static void test_andc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   477
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   478
      a0[i] = (int)(a1[i]&BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   479
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   480
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   481
  static void test_andv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   482
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   483
      a0[i] = (int)(a1[i]&b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   484
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   485
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   486
  static void test_anda(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   487
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   488
      a0[i] = (int)(a1[i]&a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   489
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   490
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   491
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   492
  static void test_orc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   493
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   494
      a0[i] = (int)(a1[i]|BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   495
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   496
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   497
  static void test_orv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   498
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   499
      a0[i] = (int)(a1[i]|b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   500
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   501
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   502
  static void test_ora(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   503
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   504
      a0[i] = (int)(a1[i]|a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   505
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   506
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   507
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   508
  static void test_xorc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   509
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   510
      a0[i] = (int)(a1[i]^BIT_MASK);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   511
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   512
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   513
  static void test_xorv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   514
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   515
      a0[i] = (int)(a1[i]^b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   516
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   517
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   518
  static void test_xora(int[] a0, int[] a1, int[] a2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   519
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   520
      a0[i] = (int)(a1[i]^a2[i]);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   521
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   522
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   523
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   524
  static void test_sllc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   525
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   526
      a0[i] = (int)(a1[i]<<VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   527
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   528
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   529
  static void test_sllc_n(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   530
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   531
      a0[i] = (int)(a1[i]<<(-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   532
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   533
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   534
  static void test_sllc_o(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   535
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   536
      a0[i] = (int)(a1[i]<<SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   537
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   538
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   539
  static void test_sllc_on(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   540
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   541
      a0[i] = (int)(a1[i]<<(-SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   542
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   543
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   544
  static void test_sllv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   545
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   546
      a0[i] = (int)(a1[i]<<b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   547
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   548
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   549
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   550
  static void test_srlc(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   551
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   552
      a0[i] = (int)(a1[i]>>>VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   553
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   554
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   555
  static void test_srlc_n(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   556
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   557
      a0[i] = (int)(a1[i]>>>(-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   558
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   559
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   560
  static void test_srlc_o(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   561
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   562
      a0[i] = (int)(a1[i]>>>SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   563
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   564
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   565
  static void test_srlc_on(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   566
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   567
      a0[i] = (int)(a1[i]>>>(-SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   568
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   569
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   570
  static void test_srlv(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   571
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   572
      a0[i] = (int)(a1[i]>>>b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   573
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   574
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   575
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   576
  static void test_srac(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   577
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   578
      a0[i] = (int)(a1[i]>>VALUE);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   579
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   580
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   581
  static void test_srac_n(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   582
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   583
      a0[i] = (int)(a1[i]>>(-VALUE));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   584
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   585
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   586
  static void test_srac_o(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   587
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   588
      a0[i] = (int)(a1[i]>>SHIFT);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   589
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   590
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   591
  static void test_srac_on(int[] a0, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   592
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   593
      a0[i] = (int)(a1[i]>>(-SHIFT));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   594
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   595
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   596
  static void test_srav(int[] a0, int[] a1, int b) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   597
    for (int i = 0; i < a0.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   598
      a0[i] = (int)(a1[i]>>b);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   599
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   600
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   601
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   602
  static void test_pack2(long[] p2, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   603
    if (p2.length*2 > a1.length) return;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   604
    for (int i = 0; i < p2.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   605
      long l0 = (long)a1[i*2+0];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   606
      long l1 = (long)a1[i*2+1];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   607
      p2[i] = (l1 << 32) | (l0 & 0xFFFFFFFFl);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   608
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   609
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   610
  static void test_unpack2(int[] a0, long[] p2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   611
    if (p2.length*2 > a0.length) return;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   612
    for (int i = 0; i < p2.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   613
      long l = p2[i];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   614
      a0[i*2+0] = (int)(l & 0xFFFFFFFFl);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   615
      a0[i*2+1] = (int)(l >> 32);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   616
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   617
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   618
  static void test_pack2_swap(long[] p2, int[] a1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   619
    if (p2.length*2 > a1.length) return;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   620
    for (int i = 0; i < p2.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   621
      long l0 = (long)a1[i*2+0];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   622
      long l1 = (long)a1[i*2+1];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   623
      p2[i] = (l0 << 32) | (l1 & 0xFFFFFFFFl);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   624
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   625
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   626
  static void test_unpack2_swap(int[] a0, long[] p2) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   627
    if (p2.length*2 > a0.length) return;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   628
    for (int i = 0; i < p2.length; i+=1) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   629
      long l = p2[i];
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   630
      a0[i*2+0] = (int)(l >> 32);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   631
      a0[i*2+1] = (int)(l & 0xFFFFFFFFl);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   632
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   633
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   634
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   635
  static int verify(String text, int i, int elem, int val) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   636
    if (elem != val) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   637
      System.err.println(text + "[" + i + "] = " + elem + " != " + val);
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   638
      return 1;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   639
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   640
    return 0;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   641
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   642
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   643
  static int verify(String text, int i, long elem, long val) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   644
    if (elem != val) {
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   645
      System.err.println(text + "[" + i + "] = " + Long.toHexString(elem) + " != " + Long.toHexString(val));
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   646
      return 1;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   647
    }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   648
    return 0;
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   649
  }
068a8efe7203 7200264: 7192963 changes disabled shift vectors
kvn
parents:
diff changeset
   650
}