hotspot/test/compiler/7184394/TestAESMain.java
author simonis
Wed, 10 Jul 2013 09:14:25 -0700
changeset 22818 34cd99df9940
parent 14834 f29c91f2f22b
child 22505 4523090c9674
permissions -rw-r--r--
8019922: PPC64 (part 8): Implement Linux/PPC64 support in HotSpot makefiles Summary: HotSpot make changes to build the HotSpot on Linux/PPC64 Reviewed-by: dholmes, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14132
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     1
/*
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     4
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     7
 * published by the Free Software Foundation.
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     8
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    13
 * accompanied this code).
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    14
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    18
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    21
 * questions.
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    22
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    23
 */
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    24
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    25
/**
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    26
 * @test
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    27
 * @bug 7184394
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    28
 * @summary add intrinsics to use AES instructions
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    29
 *
14834
f29c91f2f22b 8004835: Improve AES intrinsics on x86
kvn
parents: 14132
diff changeset
    30
 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
f29c91f2f22b 8004835: Improve AES intrinsics on x86
kvn
parents: 14132
diff changeset
    31
 * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
14132
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    32
 *
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    33
 * @author Tom Deneau
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    34
 */
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    35
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    36
public class TestAESMain {
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    37
  public static void main(String[] args) {
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    38
    int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000);
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    39
    System.out.println(iters + " iterations");
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    40
    TestAESEncode etest = new TestAESEncode();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    41
    etest.prepare();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    42
    long start = System.nanoTime();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    43
    for (int i=0; i<iters; i++) {
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    44
      etest.run();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    45
    }
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    46
    long end = System.nanoTime();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    47
    System.out.println("TestAESEncode runtime was " + (double)((end - start)/1000000000.0) + " ms");
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    48
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    49
    TestAESDecode dtest = new TestAESDecode();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    50
    dtest.prepare();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    51
    start = System.nanoTime();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    52
    for (int i=0; i<iters; i++) {
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    53
      dtest.run();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    54
    }
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    55
    end = System.nanoTime();
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    56
    System.out.println("TestAESDecode runtime was " + (double)((end - start)/1000000000.0) + " ms");
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    57
  }
3c1437abcefd 7184394: add intrinsics to use AES instructions
kvn
parents:
diff changeset
    58
}