5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 @test
26 @bug 7088419
27 @run main CRCTest
28 @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32
29 */
30
31 import java.nio.ByteBuffer;
32 import java.util.zip.CRC32;
33 import java.util.zip.Checksum;
34
35 public class CRCTest {
36
37 public static void main(String[] args) throws Exception {
38
39 byte[] b = initializedBytes(4096 * 4096);
40
41 {
42 CRC32 crc1 = new CRC32();
43 CRC32 crc2 = new CRC32();
44 CRC32 crc3 = new CRC32();
45 CRC32 crc4 = new CRC32();
46
47 crc1.update(b, 0, b.length);
48 updateSerial(crc2, b, 0, b.length);
49 updateDirect(crc3, b, 0, b.length);
50 updateSerialSlow(crc4, b, 0, b.length);
|
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 7088419
27 * @summary Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32 and java.util.zip.Adler32
28 *
29 * @run main compiler.codegen.CRCTest
30 */
31
32 package compiler.codegen;
33
34 import java.nio.ByteBuffer;
35 import java.util.zip.CRC32;
36 import java.util.zip.Checksum;
37
38 public class CRCTest {
39
40 public static void main(String[] args) throws Exception {
41
42 byte[] b = initializedBytes(4096 * 4096);
43
44 {
45 CRC32 crc1 = new CRC32();
46 CRC32 crc2 = new CRC32();
47 CRC32 crc3 = new CRC32();
48 CRC32 crc4 = new CRC32();
49
50 crc1.update(b, 0, b.length);
51 updateSerial(crc2, b, 0, b.length);
52 updateDirect(crc3, b, 0, b.length);
53 updateSerialSlow(crc4, b, 0, b.length);
|