author | vdeshpande |
Wed, 06 Apr 2016 10:29:26 -0700 | |
changeset 38018 | 1dc6c6f21231 |
parent 36555 | 4f37fd7a5a09 |
child 38135 | e06e2d071465 |
permissions | -rw-r--r-- |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
1 |
/* |
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
2 |
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
4 |
* |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
8 |
* |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
13 |
* accompanied this code). |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
14 |
* |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
18 |
* |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
21 |
* questions. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
22 |
* |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
23 |
*/ |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
24 |
|
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
25 |
#ifndef CPU_X86_VM_STUBROUTINES_X86_HPP |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
26 |
#define CPU_X86_VM_STUBROUTINES_X86_HPP |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
27 |
|
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
28 |
// This file holds the platform specific parts of the StubRoutines |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
29 |
// definition. See stubRoutines.hpp for a description on how to |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
30 |
// extend it. |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
31 |
|
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
32 |
private: |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
33 |
static address _verify_mxcsr_entry; |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
34 |
// shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
35 |
static address _key_shuffle_mask_addr; |
35154 | 36 |
|
37 |
//shuffle mask for big-endian 128-bit integers |
|
38 |
static address _counter_shuffle_mask_addr; |
|
39 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
40 |
// masks and table for CRC32 |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
41 |
static uint64_t _crc_by128_masks[]; |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
42 |
static juint _crc_table[]; |
33066 | 43 |
// table for CRC32C |
44 |
static juint* _crc32c_table; |
|
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
45 |
// swap mask for ghash |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
46 |
static address _ghash_long_swap_mask_addr; |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
47 |
static address _ghash_byte_swap_mask_addr; |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
48 |
|
36555 | 49 |
// upper word mask for sha1 |
50 |
static address _upper_word_mask_addr; |
|
51 |
// byte flip mask for sha1 |
|
52 |
static address _shuffle_byte_flip_mask_addr; |
|
53 |
||
54 |
//k256 table for sha256 |
|
55 |
static juint _k256[]; |
|
56 |
static address _k256_adr; |
|
57 |
// byte flip mask for sha256 |
|
58 |
static address _pshuffle_byte_flip_mask_addr; |
|
59 |
||
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
60 |
//tables common for LIBM sin and cos |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
61 |
static juint _ONEHALF[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
62 |
static address _ONEHALF_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
63 |
static juint _P_2[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
64 |
static address _P_2_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
65 |
static juint _SC_4[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
66 |
static address _SC_4_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
67 |
static juint _Ctable[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
68 |
static address _Ctable_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
69 |
static juint _SC_2[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
70 |
static address _SC_2_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
71 |
static juint _SC_3[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
72 |
static address _SC_3_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
73 |
static juint _SC_1[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
74 |
static address _SC_1_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
75 |
static juint _PI_INV_TABLE[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
76 |
static address _PI_INV_TABLE_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
77 |
static juint _PI_4[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
78 |
static address _PI_4_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
79 |
static juint _PI32INV[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
80 |
static address _PI32INV_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
81 |
static juint _SIGN_MASK[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
82 |
static address _SIGN_MASK_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
83 |
static juint _P_1[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
84 |
static address _P_1_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
85 |
static juint _P_3[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
86 |
static address _P_3_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
87 |
static juint _NEG_ZERO[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
88 |
static address _NEG_ZERO_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
89 |
|
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
90 |
//tables common for LIBM sincos and tancot |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
91 |
static juint _L_2il0floatpacket_0[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
92 |
static address _L_2il0floatpacket_0_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
93 |
static juint _Pi4Inv[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
94 |
static address _Pi4Inv_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
95 |
static juint _Pi4x3[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
96 |
static address _Pi4x3_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
97 |
static juint _Pi4x4[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
98 |
static address _Pi4x4_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
99 |
static juint _ones[]; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
100 |
static address _ones_adr; |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
101 |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
102 |
public: |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
103 |
static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
104 |
static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } |
35154 | 105 |
static address counter_shuffle_mask_addr() { return _counter_shuffle_mask_addr; } |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
106 |
static address crc_by128_masks_addr() { return (address)_crc_by128_masks; } |
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
107 |
static address ghash_long_swap_mask_addr() { return _ghash_long_swap_mask_addr; } |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
18507
diff
changeset
|
108 |
static address ghash_byte_swap_mask_addr() { return _ghash_byte_swap_mask_addr; } |
36555 | 109 |
static address upper_word_mask_addr() { return _upper_word_mask_addr; } |
110 |
static address shuffle_byte_flip_mask_addr() { return _shuffle_byte_flip_mask_addr; } |
|
111 |
static address k256_addr() { return _k256_adr; } |
|
112 |
static address pshuffle_byte_flip_mask_addr() { return _pshuffle_byte_flip_mask_addr; } |
|
33066 | 113 |
static void generate_CRC32C_table(bool is_pclmulqdq_supported); |
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
114 |
static address _ONEHALF_addr() { return _ONEHALF_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
115 |
static address _P_2_addr() { return _P_2_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
116 |
static address _SC_4_addr() { return _SC_4_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
117 |
static address _Ctable_addr() { return _Ctable_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
118 |
static address _SC_2_addr() { return _SC_2_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
119 |
static address _SC_3_addr() { return _SC_3_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
120 |
static address _SC_1_addr() { return _SC_1_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
121 |
static address _PI_INV_TABLE_addr() { return _PI_INV_TABLE_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
122 |
static address _PI_4_addr() { return _PI_4_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
123 |
static address _PI32INV_addr() { return _PI32INV_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
124 |
static address _SIGN_MASK_addr() { return _SIGN_MASK_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
125 |
static address _P_1_addr() { return _P_1_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
126 |
static address _P_3_addr() { return _P_3_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
127 |
static address _NEG_ZERO_addr() { return _NEG_ZERO_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
128 |
static address _L_2il0floatpacket_0_addr() { return _L_2il0floatpacket_0_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
129 |
static address _Pi4Inv_addr() { return _Pi4Inv_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
130 |
static address _Pi4x3_addr() { return _Pi4x3_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
131 |
static address _Pi4x4_addr() { return _Pi4x4_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
132 |
static address _ones_addr() { return _ones_adr; } |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
36555
diff
changeset
|
133 |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff
changeset
|
134 |
#endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP |