test/compiler/7184394/TestAESMain.java

Thu, 11 Apr 2013 21:45:21 -0700

author
amurillo
date
Thu, 11 Apr 2013 21:45:21 -0700
changeset 4915
5201379fe487
parent 4363
2c7f594145dc
child 6312
04d32e7fad07
permissions
-rw-r--r--

Added tag hs25-b28 for changeset 6d88a566d369

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

mercurial