hotspot/test/compiler/6340864/TestDoubleVect.java
author jlaskey
Tue, 23 Jul 2013 12:00:29 -0300 (2013-07-23)
changeset 19089 51cfdcf21d35
parent 13485 6c7faa516fc6
permissions -rw-r--r--
8021130: Comments need to be tokens Reviewed-by: lagergren, attila Contributed-by: james.laskey@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13485
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     1
/*
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     4
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     8
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    13
 * accompanied this code).
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    14
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    18
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    21
 * questions.
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    22
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    23
 */
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    24
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    25
/**
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    26
 * @test
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    27
 * @bug 6340864
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    28
 * @summary Implement vectorization optimizations in hotspot-server
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    29
 *
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    30
 * @run main/othervm/timeout=400 -Xbatch -Xmx64m TestDoubleVect
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    31
 */
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    32
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    33
public class TestDoubleVect {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    34
  private static final int ARRLEN = 997;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    35
  private static final int ITERS  = 11000;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    36
  private static final double ADD_INIT = -7500.;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    37
  private static final double VALUE = 15.;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    38
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    39
  public static void main(String args[]) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    40
    System.out.println("Testing Double vectors");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    41
    int errn = test();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    42
    if (errn > 0) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    43
      System.err.println("FAILED: " + errn + " errors");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    44
      System.exit(97);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    45
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    46
    System.out.println("PASSED");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    47
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    48
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    49
  static int test() {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    50
    double[] a0 = new double[ARRLEN];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    51
    double[] a1 = new double[ARRLEN];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    52
    double[] a2 = new double[ARRLEN];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    53
    double[] a3 = new double[ARRLEN];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    54
    // Initialize
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    55
    double gold_sum = 0;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    56
    for (int i=0; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    57
      double val = ADD_INIT+(double)i;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    58
      gold_sum += val;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    59
      a1[i] = val;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    60
      a2[i] = VALUE;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    61
      a3[i] = -VALUE;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    62
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    63
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    64
    System.out.println("Warmup");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    65
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    66
      test_sum(a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    67
      test_addc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    68
      test_addv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    69
      test_adda(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    70
      test_subc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    71
      test_subv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    72
      test_suba(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    73
      test_mulc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    74
      test_mulv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    75
      test_mula(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    76
      test_divc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    77
      test_divv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    78
      test_diva(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    79
      test_mulc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    80
      test_mulv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    81
      test_mula(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    82
      test_divc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    83
      test_divv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    84
      test_diva(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    85
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    86
    // Test and verify results
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    87
    System.out.println("Verification");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    88
    int errn = 0;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    89
    {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    90
      double sum = test_sum(a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    91
      if (sum != gold_sum) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    92
        System.err.println("test_sum:  " + sum + " != " + gold_sum);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    93
        errn++;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    94
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    95
      // Overwrite with NaN values
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    96
      a1[0] = Double.NaN;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    97
      a1[1] = Double.POSITIVE_INFINITY;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    98
      a1[2] = Double.NEGATIVE_INFINITY;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
    99
      a1[3] = Double.MAX_VALUE;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   100
      a1[4] = Double.MIN_VALUE;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   101
      a1[5] = Double.MIN_NORMAL;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   102
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   103
      a2[6] = a1[0];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   104
      a2[7] = a1[1];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   105
      a2[8] = a1[2];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   106
      a2[9] = a1[3];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   107
      a2[10] = a1[4];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   108
      a2[11] = a1[5];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   109
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   110
      a3[6] = -a2[6];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   111
      a3[7] = -a2[7];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   112
      a3[8] = -a2[8];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   113
      a3[9] = -a2[9];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   114
      a3[10] = -a2[10];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   115
      a3[11] = -a2[11];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   116
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   117
      test_addc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   118
      errn += verify("test_addc: ", 0, a0[0], (Double.NaN+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   119
      errn += verify("test_addc: ", 1, a0[1], (Double.POSITIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   120
      errn += verify("test_addc: ", 2, a0[2], (Double.NEGATIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   121
      errn += verify("test_addc: ", 3, a0[3], (Double.MAX_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   122
      errn += verify("test_addc: ", 4, a0[4], (Double.MIN_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   123
      errn += verify("test_addc: ", 5, a0[5], (Double.MIN_NORMAL+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   124
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   125
        errn += verify("test_addc: ", i, a0[i], ((ADD_INIT+i)+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   126
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   127
      test_addv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   128
      errn += verify("test_addv: ", 0, a0[0], (Double.NaN+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   129
      errn += verify("test_addv: ", 1, a0[1], (Double.POSITIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   130
      errn += verify("test_addv: ", 2, a0[2], (Double.NEGATIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   131
      errn += verify("test_addv: ", 3, a0[3], (Double.MAX_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   132
      errn += verify("test_addv: ", 4, a0[4], (Double.MIN_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   133
      errn += verify("test_addv: ", 5, a0[5], (Double.MIN_NORMAL+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   134
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   135
        errn += verify("test_addv: ", i, a0[i], ((ADD_INIT+i)+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   136
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   137
      test_adda(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   138
      errn += verify("test_adda: ", 0, a0[0], (Double.NaN+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   139
      errn += verify("test_adda: ", 1, a0[1], (Double.POSITIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   140
      errn += verify("test_adda: ", 2, a0[2], (Double.NEGATIVE_INFINITY+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   141
      errn += verify("test_adda: ", 3, a0[3], (Double.MAX_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   142
      errn += verify("test_adda: ", 4, a0[4], (Double.MIN_VALUE+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   143
      errn += verify("test_adda: ", 5, a0[5], (Double.MIN_NORMAL+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   144
      errn += verify("test_adda: ", 6, a0[6], ((ADD_INIT+6)+Double.NaN));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   145
      errn += verify("test_adda: ", 7, a0[7], ((ADD_INIT+7)+Double.POSITIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   146
      errn += verify("test_adda: ", 8, a0[8], ((ADD_INIT+8)+Double.NEGATIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   147
      errn += verify("test_adda: ", 9, a0[9], ((ADD_INIT+9)+Double.MAX_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   148
      errn += verify("test_adda: ", 10, a0[10], ((ADD_INIT+10)+Double.MIN_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   149
      errn += verify("test_adda: ", 11, a0[11], ((ADD_INIT+11)+Double.MIN_NORMAL));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   150
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   151
        errn += verify("test_adda: ", i, a0[i], ((ADD_INIT+i)+VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   152
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   153
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   154
      test_subc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   155
      errn += verify("test_subc: ", 0, a0[0], (Double.NaN-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   156
      errn += verify("test_subc: ", 1, a0[1], (Double.POSITIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   157
      errn += verify("test_subc: ", 2, a0[2], (Double.NEGATIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   158
      errn += verify("test_subc: ", 3, a0[3], (Double.MAX_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   159
      errn += verify("test_subc: ", 4, a0[4], (Double.MIN_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   160
      errn += verify("test_subc: ", 5, a0[5], (Double.MIN_NORMAL-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   161
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   162
        errn += verify("test_subc: ", i, a0[i], ((ADD_INIT+i)-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   163
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   164
      test_subv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   165
      errn += verify("test_subv: ", 0, a0[0], (Double.NaN-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   166
      errn += verify("test_subv: ", 1, a0[1], (Double.POSITIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   167
      errn += verify("test_subv: ", 2, a0[2], (Double.NEGATIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   168
      errn += verify("test_subv: ", 3, a0[3], (Double.MAX_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   169
      errn += verify("test_subv: ", 4, a0[4], (Double.MIN_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   170
      errn += verify("test_subv: ", 5, a0[5], (Double.MIN_NORMAL-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   171
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   172
        errn += verify("test_subv: ", i, a0[i], ((ADD_INIT+i)-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   173
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   174
      test_suba(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   175
      errn += verify("test_suba: ", 0, a0[0], (Double.NaN-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   176
      errn += verify("test_suba: ", 1, a0[1], (Double.POSITIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   177
      errn += verify("test_suba: ", 2, a0[2], (Double.NEGATIVE_INFINITY-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   178
      errn += verify("test_suba: ", 3, a0[3], (Double.MAX_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   179
      errn += verify("test_suba: ", 4, a0[4], (Double.MIN_VALUE-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   180
      errn += verify("test_suba: ", 5, a0[5], (Double.MIN_NORMAL-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   181
      errn += verify("test_suba: ", 6, a0[6], ((ADD_INIT+6)-Double.NaN));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   182
      errn += verify("test_suba: ", 7, a0[7], ((ADD_INIT+7)-Double.POSITIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   183
      errn += verify("test_suba: ", 8, a0[8], ((ADD_INIT+8)-Double.NEGATIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   184
      errn += verify("test_suba: ", 9, a0[9], ((ADD_INIT+9)-Double.MAX_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   185
      errn += verify("test_suba: ", 10, a0[10], ((ADD_INIT+10)-Double.MIN_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   186
      errn += verify("test_suba: ", 11, a0[11], ((ADD_INIT+11)-Double.MIN_NORMAL));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   187
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   188
        errn += verify("test_suba: ", i, a0[i], ((ADD_INIT+i)-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   189
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   190
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   191
      test_mulc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   192
      errn += verify("test_mulc: ", 0, a0[0], (Double.NaN*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   193
      errn += verify("test_mulc: ", 1, a0[1], (Double.POSITIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   194
      errn += verify("test_mulc: ", 2, a0[2], (Double.NEGATIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   195
      errn += verify("test_mulc: ", 3, a0[3], (Double.MAX_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   196
      errn += verify("test_mulc: ", 4, a0[4], (Double.MIN_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   197
      errn += verify("test_mulc: ", 5, a0[5], (Double.MIN_NORMAL*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   198
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   199
        errn += verify("test_mulc: ", i, a0[i], ((ADD_INIT+i)*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   200
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   201
      test_mulv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   202
      errn += verify("test_mulv: ", 0, a0[0], (Double.NaN*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   203
      errn += verify("test_mulv: ", 1, a0[1], (Double.POSITIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   204
      errn += verify("test_mulv: ", 2, a0[2], (Double.NEGATIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   205
      errn += verify("test_mulv: ", 3, a0[3], (Double.MAX_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   206
      errn += verify("test_mulv: ", 4, a0[4], (Double.MIN_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   207
      errn += verify("test_mulv: ", 5, a0[5], (Double.MIN_NORMAL*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   208
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   209
        errn += verify("test_mulv: ", i, a0[i], ((ADD_INIT+i)*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   210
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   211
      test_mula(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   212
      errn += verify("test_mula: ", 0, a0[0], (Double.NaN*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   213
      errn += verify("test_mula: ", 1, a0[1], (Double.POSITIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   214
      errn += verify("test_mula: ", 2, a0[2], (Double.NEGATIVE_INFINITY*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   215
      errn += verify("test_mula: ", 3, a0[3], (Double.MAX_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   216
      errn += verify("test_mula: ", 4, a0[4], (Double.MIN_VALUE*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   217
      errn += verify("test_mula: ", 5, a0[5], (Double.MIN_NORMAL*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   218
      errn += verify("test_mula: ", 6, a0[6], ((ADD_INIT+6)*Double.NaN));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   219
      errn += verify("test_mula: ", 7, a0[7], ((ADD_INIT+7)*Double.POSITIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   220
      errn += verify("test_mula: ", 8, a0[8], ((ADD_INIT+8)*Double.NEGATIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   221
      errn += verify("test_mula: ", 9, a0[9], ((ADD_INIT+9)*Double.MAX_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   222
      errn += verify("test_mula: ", 10, a0[10], ((ADD_INIT+10)*Double.MIN_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   223
      errn += verify("test_mula: ", 11, a0[11], ((ADD_INIT+11)*Double.MIN_NORMAL));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   224
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   225
        errn += verify("test_mula: ", i, a0[i], ((ADD_INIT+i)*VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   226
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   227
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   228
      test_divc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   229
      errn += verify("test_divc: ", 0, a0[0], (Double.NaN/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   230
      errn += verify("test_divc: ", 1, a0[1], (Double.POSITIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   231
      errn += verify("test_divc: ", 2, a0[2], (Double.NEGATIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   232
      errn += verify("test_divc: ", 3, a0[3], (Double.MAX_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   233
      errn += verify("test_divc: ", 4, a0[4], (Double.MIN_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   234
      errn += verify("test_divc: ", 5, a0[5], (Double.MIN_NORMAL/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   235
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   236
        errn += verify("test_divc: ", i, a0[i], ((ADD_INIT+i)/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   237
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   238
      test_divv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   239
      errn += verify("test_divv: ", 0, a0[0], (Double.NaN/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   240
      errn += verify("test_divv: ", 1, a0[1], (Double.POSITIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   241
      errn += verify("test_divv: ", 2, a0[2], (Double.NEGATIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   242
      errn += verify("test_divv: ", 3, a0[3], (Double.MAX_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   243
      errn += verify("test_divv: ", 4, a0[4], (Double.MIN_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   244
      errn += verify("test_divv: ", 5, a0[5], (Double.MIN_NORMAL/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   245
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   246
        errn += verify("test_divv: ", i, a0[i], ((ADD_INIT+i)/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   247
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   248
      test_diva(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   249
      errn += verify("test_diva: ", 0, a0[0], (Double.NaN/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   250
      errn += verify("test_diva: ", 1, a0[1], (Double.POSITIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   251
      errn += verify("test_diva: ", 2, a0[2], (Double.NEGATIVE_INFINITY/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   252
      errn += verify("test_diva: ", 3, a0[3], (Double.MAX_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   253
      errn += verify("test_diva: ", 4, a0[4], (Double.MIN_VALUE/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   254
      errn += verify("test_diva: ", 5, a0[5], (Double.MIN_NORMAL/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   255
      errn += verify("test_diva: ", 6, a0[6], ((ADD_INIT+6)/Double.NaN));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   256
      errn += verify("test_diva: ", 7, a0[7], ((ADD_INIT+7)/Double.POSITIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   257
      errn += verify("test_diva: ", 8, a0[8], ((ADD_INIT+8)/Double.NEGATIVE_INFINITY));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   258
      errn += verify("test_diva: ", 9, a0[9], ((ADD_INIT+9)/Double.MAX_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   259
      errn += verify("test_diva: ", 10, a0[10], ((ADD_INIT+10)/Double.MIN_VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   260
      errn += verify("test_diva: ", 11, a0[11], ((ADD_INIT+11)/Double.MIN_NORMAL));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   261
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   262
        errn += verify("test_diva: ", i, a0[i], ((ADD_INIT+i)/VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   263
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   264
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   265
      test_mulc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   266
      errn += verify("test_mulc_n: ", 0, a0[0], (Double.NaN*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   267
      errn += verify("test_mulc_n: ", 1, a0[1], (Double.POSITIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   268
      errn += verify("test_mulc_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   269
      errn += verify("test_mulc_n: ", 3, a0[3], (Double.MAX_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   270
      errn += verify("test_mulc_n: ", 4, a0[4], (Double.MIN_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   271
      errn += verify("test_mulc_n: ", 5, a0[5], (Double.MIN_NORMAL*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   272
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   273
        errn += verify("test_mulc_n: ", i, a0[i], ((ADD_INIT+i)*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   274
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   275
      test_mulv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   276
      errn += verify("test_mulv_n: ", 0, a0[0], (Double.NaN*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   277
      errn += verify("test_mulv_n: ", 1, a0[1], (Double.POSITIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   278
      errn += verify("test_mulv_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   279
      errn += verify("test_mulv_n: ", 3, a0[3], (Double.MAX_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   280
      errn += verify("test_mulv_n: ", 4, a0[4], (Double.MIN_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   281
      errn += verify("test_mulv_n: ", 5, a0[5], (Double.MIN_NORMAL*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   282
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   283
        errn += verify("test_mulv_n: ", i, a0[i], ((ADD_INIT+i)*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   284
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   285
      test_mula(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   286
      errn += verify("test_mula_n: ", 0, a0[0], (Double.NaN*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   287
      errn += verify("test_mula_n: ", 1, a0[1], (Double.POSITIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   288
      errn += verify("test_mula_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   289
      errn += verify("test_mula_n: ", 3, a0[3], (Double.MAX_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   290
      errn += verify("test_mula_n: ", 4, a0[4], (Double.MIN_VALUE*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   291
      errn += verify("test_mula_n: ", 5, a0[5], (Double.MIN_NORMAL*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   292
      errn += verify("test_mula_n: ", 6, a0[6], ((ADD_INIT+6)*(-Double.NaN)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   293
      errn += verify("test_mula_n: ", 7, a0[7], ((ADD_INIT+7)*(-Double.POSITIVE_INFINITY)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   294
      errn += verify("test_mula_n: ", 8, a0[8], ((ADD_INIT+8)*(-Double.NEGATIVE_INFINITY)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   295
      errn += verify("test_mula_n: ", 9, a0[9], ((ADD_INIT+9)*(-Double.MAX_VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   296
      errn += verify("test_mula_n: ", 10, a0[10], ((ADD_INIT+10)*(-Double.MIN_VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   297
      errn += verify("test_mula_n: ", 11, a0[11], ((ADD_INIT+11)*(-Double.MIN_NORMAL)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   298
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   299
        errn += verify("test_mula_n: ", i, a0[i], ((ADD_INIT+i)*(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   300
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   301
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   302
      test_divc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   303
      errn += verify("test_divc_n: ", 0, a0[0], (Double.NaN/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   304
      errn += verify("test_divc_n: ", 1, a0[1], (Double.POSITIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   305
      errn += verify("test_divc_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   306
      errn += verify("test_divc_n: ", 3, a0[3], (Double.MAX_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   307
      errn += verify("test_divc_n: ", 4, a0[4], (Double.MIN_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   308
      errn += verify("test_divc_n: ", 5, a0[5], (Double.MIN_NORMAL/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   309
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   310
        errn += verify("test_divc_n: ", i, a0[i], ((ADD_INIT+i)/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   311
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   312
      test_divv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   313
      errn += verify("test_divv_n: ", 0, a0[0], (Double.NaN/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   314
      errn += verify("test_divv_n: ", 1, a0[1], (Double.POSITIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   315
      errn += verify("test_divv_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   316
      errn += verify("test_divv_n: ", 3, a0[3], (Double.MAX_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   317
      errn += verify("test_divv_n: ", 4, a0[4], (Double.MIN_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   318
      errn += verify("test_divv_n: ", 5, a0[5], (Double.MIN_NORMAL/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   319
      for (int i=6; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   320
        errn += verify("test_divv_n: ", i, a0[i], ((ADD_INIT+i)/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   321
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   322
      test_diva(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   323
      errn += verify("test_diva_n: ", 0, a0[0], (Double.NaN/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   324
      errn += verify("test_diva_n: ", 1, a0[1], (Double.POSITIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   325
      errn += verify("test_diva_n: ", 2, a0[2], (Double.NEGATIVE_INFINITY/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   326
      errn += verify("test_diva_n: ", 3, a0[3], (Double.MAX_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   327
      errn += verify("test_diva_n: ", 4, a0[4], (Double.MIN_VALUE/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   328
      errn += verify("test_diva_n: ", 5, a0[5], (Double.MIN_NORMAL/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   329
      errn += verify("test_diva_n: ", 6, a0[6], ((ADD_INIT+6)/(-Double.NaN)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   330
      errn += verify("test_diva_n: ", 7, a0[7], ((ADD_INIT+7)/(-Double.POSITIVE_INFINITY)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   331
      errn += verify("test_diva_n: ", 8, a0[8], ((ADD_INIT+8)/(-Double.NEGATIVE_INFINITY)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   332
      errn += verify("test_diva_n: ", 9, a0[9], ((ADD_INIT+9)/(-Double.MAX_VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   333
      errn += verify("test_diva_n: ", 10, a0[10], ((ADD_INIT+10)/(-Double.MIN_VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   334
      errn += verify("test_diva_n: ", 11, a0[11], ((ADD_INIT+11)/(-Double.MIN_NORMAL)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   335
      for (int i=12; i<ARRLEN; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   336
        errn += verify("test_diva_n: ", i, a0[i], ((ADD_INIT+i)/(-VALUE)));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   337
      }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   338
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   339
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   340
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   341
    if (errn > 0)
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   342
      return errn;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   343
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   344
    System.out.println("Time");
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   345
    long start, end;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   346
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   347
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   348
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   349
      test_sum(a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   350
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   351
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   352
    System.out.println("test_sum: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   353
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   354
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   355
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   356
      test_addc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   357
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   358
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   359
    System.out.println("test_addc: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   360
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   361
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   362
      test_addv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   363
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   364
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   365
    System.out.println("test_addv: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   366
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   367
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   368
      test_adda(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   369
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   370
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   371
    System.out.println("test_adda: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   372
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   373
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   374
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   375
      test_subc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   376
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   377
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   378
    System.out.println("test_subc: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   379
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   380
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   381
      test_subv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   382
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   383
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   384
    System.out.println("test_subv: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   385
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   386
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   387
      test_suba(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   388
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   389
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   390
    System.out.println("test_suba: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   391
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   392
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   393
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   394
      test_mulc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   395
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   396
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   397
    System.out.println("test_mulc: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   398
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   399
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   400
      test_mulv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   401
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   402
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   403
    System.out.println("test_mulv: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   404
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   405
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   406
      test_mula(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   407
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   408
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   409
    System.out.println("test_mula: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   410
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   411
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   412
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   413
      test_divc(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   414
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   415
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   416
    System.out.println("test_divc: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   417
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   418
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   419
      test_divv(a0, a1, VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   420
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   421
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   422
    System.out.println("test_divv: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   423
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   424
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   425
      test_diva(a0, a1, a2);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   426
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   427
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   428
    System.out.println("test_diva: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   429
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   430
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   431
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   432
      test_mulc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   433
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   434
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   435
    System.out.println("test_mulc_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   436
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   437
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   438
      test_mulv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   439
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   440
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   441
    System.out.println("test_mulv_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   442
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   443
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   444
      test_mula(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   445
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   446
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   447
    System.out.println("test_mula_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   448
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   449
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   450
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   451
      test_divc_n(a0, a1);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   452
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   453
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   454
    System.out.println("test_divc_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   455
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   456
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   457
      test_divv(a0, a1, -VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   458
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   459
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   460
    System.out.println("test_divv_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   461
    start = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   462
    for (int i=0; i<ITERS; i++) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   463
      test_diva(a0, a1, a3);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   464
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   465
    end = System.currentTimeMillis();
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   466
    System.out.println("test_diva_n: " + (end - start));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   467
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   468
    return errn;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   469
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   470
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   471
  static double test_sum(double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   472
    double sum = 0;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   473
    for (int i = 0; i < a1.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   474
      sum += a1[i];
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   475
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   476
    return sum;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   477
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   478
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   479
  static void test_addc(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   480
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   481
      a0[i] = (a1[i]+VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   482
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   483
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   484
  static void test_addv(double[] a0, double[] a1, double b) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   485
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   486
      a0[i] = (a1[i]+b);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   487
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   488
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   489
  static void test_adda(double[] a0, double[] a1, double[] a2) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   490
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   491
      a0[i] = (a1[i]+a2[i]);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   492
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   493
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   494
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   495
  static void test_subc(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   496
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   497
      a0[i] = (a1[i]-VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   498
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   499
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   500
  static void test_subv(double[] a0, double[] a1, double b) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   501
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   502
      a0[i] = (a1[i]-b);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   503
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   504
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   505
  static void test_suba(double[] a0, double[] a1, double[] a2) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   506
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   507
      a0[i] = (a1[i]-a2[i]);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   508
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   509
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   510
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   511
  static void test_mulc(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   512
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   513
      a0[i] = (a1[i]*VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   514
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   515
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   516
  static void test_mulc_n(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   517
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   518
      a0[i] = (a1[i]*(-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   519
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   520
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   521
  static void test_mulv(double[] a0, double[] a1, double b) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   522
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   523
      a0[i] = (a1[i]*b);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   524
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   525
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   526
  static void test_mula(double[] a0, double[] a1, double[] a2) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   527
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   528
      a0[i] = (a1[i]*a2[i]);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   529
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   530
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   531
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   532
  static void test_divc(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   533
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   534
      a0[i] = (a1[i]/VALUE);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   535
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   536
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   537
  static void test_divc_n(double[] a0, double[] a1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   538
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   539
      a0[i] = (a1[i]/(-VALUE));
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   540
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   541
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   542
  static void test_divv(double[] a0, double[] a1, double b) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   543
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   544
      a0[i] = (a1[i]/b);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   545
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   546
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   547
  static void test_diva(double[] a0, double[] a1, double[] a2) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   548
    for (int i = 0; i < a0.length; i+=1) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   549
      a0[i] = (a1[i]/a2[i]);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   550
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   551
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   552
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   553
  static int verify(String text, int i, double elem, double val) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   554
    if (elem != val && !(Double.isNaN(elem) && Double.isNaN(val))) {
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   555
      System.err.println(text + "[" + i + "] = " + elem + " != " + val);
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   556
      return 1;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   557
    }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   558
    return 0;
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   559
  }
6c7faa516fc6 6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
diff changeset
   560
}