src/hotspot/cpu/x86/stubRoutines_x86.hpp
author zgu
Mon, 09 Sep 2019 11:43:16 -0400
changeset 59284 88502b1cf76f
parent 58977 c6a789f495fe
permissions -rw-r--r--
8230765: Implement nmethod barrier for x86_32 platforms Reviewed-by: rkennke, eosterlund
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
     1
/*
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52990
diff changeset
     2
 * Copyright (c) 2013, 2019, 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
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52990
diff changeset
    25
#ifndef CPU_X86_STUBROUTINES_X86_HPP
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52990
diff changeset
    26
#define CPU_X86_STUBROUTINES_X86_HPP
18507
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
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    32
static bool returns_to_call_stub(address return_pc) { return return_pc == _call_stub_return_address; }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    33
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    34
enum platform_dependent_constants {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    35
  code_size1 = 20000 LP64_ONLY(+10000),         // simply increase if too small (assembler will crash if too small)
54893
3e1ecfd3ea18 8223770: code_size2 still too small in some compressed oops configurations
rschmelter
parents: 54804
diff changeset
    36
  code_size2 = 35300 LP64_ONLY(+11400)          // simply increase if too small (assembler will crash if too small)
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    37
};
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    38
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    39
class x86 {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    40
 friend class StubGenerator;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    41
 friend class VMStructs;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    42
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    43
#ifdef _LP64
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    44
 private:
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    45
  static address _get_previous_fp_entry;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    46
  static address _get_previous_sp_entry;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    47
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    48
  static address _f2i_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    49
  static address _f2l_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    50
  static address _d2i_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    51
  static address _d2l_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    52
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    53
  static address _float_sign_mask;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    54
  static address _float_sign_flip;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    55
  static address _double_sign_mask;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    56
  static address _double_sign_flip;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    57
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    58
 public:
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    59
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    60
  static address get_previous_fp_entry() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    61
    return _get_previous_fp_entry;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    62
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    63
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    64
  static address get_previous_sp_entry() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    65
    return _get_previous_sp_entry;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    66
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    67
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    68
  static address f2i_fixup() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    69
    return _f2i_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    70
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    71
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    72
  static address f2l_fixup() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    73
    return _f2l_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    74
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    75
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    76
  static address d2i_fixup() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    77
    return _d2i_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    78
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    79
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    80
  static address d2l_fixup() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    81
    return _d2l_fixup;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    82
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    83
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    84
  static address float_sign_mask() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    85
    return _float_sign_mask;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    86
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    87
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    88
  static address float_sign_flip() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    89
    return _float_sign_flip;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    90
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    91
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    92
  static address double_sign_mask() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    93
    return _double_sign_mask;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    94
  }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    95
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    96
  static address double_sign_flip() {
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    97
    return _double_sign_flip;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
    98
  }
54750
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
    99
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   100
#else // !LP64
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   101
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   102
 private:
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   103
  static address _verify_fpu_cntrl_wrd_entry;
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   104
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   105
 public:
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   106
  static address verify_fpu_cntrl_wrd_entry() { return _verify_fpu_cntrl_wrd_entry; }
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   107
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   108
#endif // !LP64
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   109
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   110
 private:
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   111
  static address _verify_mxcsr_entry;
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   112
  // 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
   113
  static address _key_shuffle_mask_addr;
35154
a9b3c1984a01 8143925: Enhancing CounterMode.crypt() for AES
kvn
parents: 33066
diff changeset
   114
a9b3c1984a01 8143925: Enhancing CounterMode.crypt() for AES
kvn
parents: 33066
diff changeset
   115
  //shuffle mask for big-endian 128-bit integers
a9b3c1984a01 8143925: Enhancing CounterMode.crypt() for AES
kvn
parents: 33066
diff changeset
   116
  static address _counter_shuffle_mask_addr;
a9b3c1984a01 8143925: Enhancing CounterMode.crypt() for AES
kvn
parents: 33066
diff changeset
   117
59284
88502b1cf76f 8230765: Implement nmethod barrier for x86_32 platforms
zgu
parents: 58977
diff changeset
   118
  static address _method_entry_barrier;
88502b1cf76f 8230765: Implement nmethod barrier for x86_32 platforms
zgu
parents: 58977
diff changeset
   119
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   120
  // masks and table for CRC32
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   121
  static uint64_t _crc_by128_masks[];
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   122
  static juint    _crc_table[];
33066
d98eab8215c4 8134553: CRC32C implementations for x86/x64 targets
kvn
parents: 31404
diff changeset
   123
  // table for CRC32C
d98eab8215c4 8134553: CRC32C implementations for x86/x64 targets
kvn
parents: 31404
diff changeset
   124
  static juint* _crc32c_table;
31404
63e8fcd70bfc 8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents: 18507
diff changeset
   125
  // swap mask for ghash
63e8fcd70bfc 8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents: 18507
diff changeset
   126
  static address _ghash_long_swap_mask_addr;
63e8fcd70bfc 8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents: 18507
diff changeset
   127
  static address _ghash_byte_swap_mask_addr;
52990
1ed8de9045a7 8214074: Ghash optimization using AVX instructions
ascarpino
parents: 52142
diff changeset
   128
  static address _ghash_poly_addr;
1ed8de9045a7 8214074: Ghash optimization using AVX instructions
ascarpino
parents: 52142
diff changeset
   129
  static address _ghash_shuffmask_addr;
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   130
36555
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   131
  // upper word mask for sha1
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   132
  static address _upper_word_mask_addr;
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   133
  // byte flip mask for sha1
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   134
  static address _shuffle_byte_flip_mask_addr;
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   135
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   136
  //k256 table for sha256
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   137
  static juint _k256[];
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   138
  static address _k256_adr;
54750
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   139
  static address _vector_short_to_byte_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   140
  static address _vector_float_sign_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   141
  static address _vector_float_sign_flip;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   142
  static address _vector_double_sign_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   143
  static address _vector_double_sign_flip;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   144
  static address _vector_byte_perm_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   145
  static address _vector_long_sign_mask;
38135
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   146
#ifdef _LP64
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   147
  static juint _k256_W[];
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   148
  static address _k256_W_adr;
42039
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   149
  static julong _k512_W[];
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   150
  static address _k512_W_addr;
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   151
  // byte flip mask for sha512
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   152
  static address _pshuffle_byte_flip_mask_addr_sha512;
58977
c6a789f495fe 8233741: AES Countermode (AES-CTR) optimization using AVX512 + VAES instructions
kvn
parents: 54893
diff changeset
   153
  static address _counter_mask_addr;
50860
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   154
  // Masks for base64
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   155
  static address _base64_charset;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   156
  static address _bswap_mask;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   157
  static address _gather_mask;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   158
  static address _right_shift_mask;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   159
  static address _left_shift_mask;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   160
  static address _and_mask;
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   161
  static address _url_charset;
38135
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   162
#endif
36555
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   163
  // byte flip mask for sha256
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   164
  static address _pshuffle_byte_flip_mask_addr;
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   165
38018
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   166
  //tables common for LIBM sin and cos
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   167
  static juint _ONEHALF[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   168
  static address _ONEHALF_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   169
  static juint _P_2[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   170
  static address _P_2_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   171
  static juint _SC_4[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   172
  static address _SC_4_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   173
  static juint _Ctable[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   174
  static address _Ctable_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   175
  static juint _SC_2[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   176
  static address _SC_2_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   177
  static juint _SC_3[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   178
  static address _SC_3_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   179
  static juint _SC_1[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   180
  static address _SC_1_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   181
  static juint _PI_INV_TABLE[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   182
  static address _PI_INV_TABLE_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   183
  static juint _PI_4[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   184
  static address _PI_4_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   185
  static juint _PI32INV[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   186
  static address _PI32INV_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   187
  static juint _SIGN_MASK[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   188
  static address _SIGN_MASK_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   189
  static juint _P_1[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   190
  static address _P_1_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   191
  static juint _P_3[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   192
  static address _P_3_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   193
  static juint _NEG_ZERO[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   194
  static address _NEG_ZERO_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   195
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   196
  //tables common for LIBM sincos and tancot
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   197
  static juint _L_2il0floatpacket_0[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   198
  static address _L_2il0floatpacket_0_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   199
  static juint _Pi4Inv[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   200
  static address _Pi4Inv_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   201
  static juint _Pi4x3[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   202
  static address _Pi4x3_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   203
  static juint _Pi4x4[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   204
  static address _Pi4x4_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   205
  static juint _ones[];
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   206
  static address _ones_adr;
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   207
18507
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   208
 public:
61bfc8995bb3 7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
diff changeset
   209
  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
   210
  static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; }
35154
a9b3c1984a01 8143925: Enhancing CounterMode.crypt() for AES
kvn
parents: 33066
diff changeset
   211
  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
   212
  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
   213
  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
   214
  static address ghash_byte_swap_mask_addr() { return _ghash_byte_swap_mask_addr; }
52990
1ed8de9045a7 8214074: Ghash optimization using AVX instructions
ascarpino
parents: 52142
diff changeset
   215
  static address ghash_shufflemask_addr() { return _ghash_shuffmask_addr; }
1ed8de9045a7 8214074: Ghash optimization using AVX instructions
ascarpino
parents: 52142
diff changeset
   216
  static address ghash_polynomial_addr() { return _ghash_poly_addr; }
36555
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   217
  static address upper_word_mask_addr() { return _upper_word_mask_addr; }
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   218
  static address shuffle_byte_flip_mask_addr() { return _shuffle_byte_flip_mask_addr; }
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   219
  static address k256_addr()      { return _k256_adr; }
59284
88502b1cf76f 8230765: Implement nmethod barrier for x86_32 platforms
zgu
parents: 58977
diff changeset
   220
  static address method_entry_barrier() { return _method_entry_barrier; }
54750
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   221
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   222
  static address vector_short_to_byte_mask() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   223
    return _vector_short_to_byte_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   224
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   225
  static address vector_float_sign_mask() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   226
    return _vector_float_sign_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   227
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   228
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   229
  static address vector_float_sign_flip() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   230
    return _vector_float_sign_flip;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   231
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   232
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   233
  static address vector_double_sign_mask() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   234
    return _vector_double_sign_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   235
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   236
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   237
  static address vector_double_sign_flip() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   238
    return _vector_double_sign_flip;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   239
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   240
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   241
  static address vector_byte_perm_mask() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   242
    return _vector_byte_perm_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   243
  }
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   244
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   245
  static address vector_long_sign_mask() {
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   246
    return _vector_long_sign_mask;
1851a532ddfe 8222074: Enhance auto vectorization for x86
sviswanathan
parents: 53951
diff changeset
   247
  }
38135
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   248
#ifdef _LP64
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   249
  static address k256_W_addr()    { return _k256_W_adr; }
42039
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   250
  static address k512_W_addr()    { return _k512_W_addr; }
db627462f2c9 8165381: Update for x86 SHA512 using AVX2
kvn
parents: 40010
diff changeset
   251
  static address pshuffle_byte_flip_mask_addr_sha512() { return _pshuffle_byte_flip_mask_addr_sha512; }
50860
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   252
  static address base64_charset_addr() { return _base64_charset; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   253
  static address base64url_charset_addr() { return _url_charset; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   254
  static address base64_bswap_mask_addr() { return _bswap_mask; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   255
  static address base64_gather_mask_addr() { return _gather_mask; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   256
  static address base64_right_shift_mask_addr() { return _right_shift_mask; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   257
  static address base64_left_shift_mask_addr() { return _left_shift_mask; }
480a96a43b62 8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents: 47216
diff changeset
   258
  static address base64_and_mask_addr() { return _and_mask; }
58977
c6a789f495fe 8233741: AES Countermode (AES-CTR) optimization using AVX512 + VAES instructions
kvn
parents: 54893
diff changeset
   259
  static address counter_mask_addr() { return _counter_mask_addr; }
38135
e06e2d071465 8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents: 38018
diff changeset
   260
#endif
36555
4f37fd7a5a09 8150767: Enables SHA Extensions on x86
vdeshpande
parents: 35154
diff changeset
   261
  static address pshuffle_byte_flip_mask_addr() { return _pshuffle_byte_flip_mask_addr; }
33066
d98eab8215c4 8134553: CRC32C implementations for x86/x64 targets
kvn
parents: 31404
diff changeset
   262
  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
   263
  static address _ONEHALF_addr()      { return _ONEHALF_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   264
  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
   265
  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
   266
  static address _Ctable_addr()      { return _Ctable_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   267
  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
   268
  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
   269
  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
   270
  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
   271
  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
   272
  static address _PI32INV_addr()      { return _PI32INV_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   273
  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
   274
  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
   275
  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
   276
  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
   277
  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
   278
  static address _Pi4Inv_addr()      { return _Pi4Inv_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   279
  static address _Pi4x3_addr()      { return _Pi4x3_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   280
  static address _Pi4x4_addr()      { return _Pi4x4_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   281
  static address _ones_addr()      { return _ones_adr; }
1dc6c6f21231 8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents: 36555
diff changeset
   282
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   283
};
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38135
diff changeset
   284
53244
9807daeb47c4 8216167: Update include guards to reflect correct directories
coleenp
parents: 52990
diff changeset
   285
#endif // CPU_X86_STUBROUTINES_X86_HPP