1 /*
  2  * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
  3  * Copyright (c) 2025, Red Hat, Inc. All rights reserved.
  4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5  *
  6  * This code is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 only, as
  8  * published by the Free Software Foundation.
  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #ifndef CPU_AARCH64_STUBDECLARATIONS_HPP
 27 #define CPU_AARCH64_STUBDECLARATIONS_HPP
 28 
 29 #define STUBGEN_PREUNIVERSE_BLOBS_ARCH_DO(do_stub,                      \
 30                                           do_arch_blob,                 \
 31                                           do_arch_entry,                \
 32                                           do_arch_entry_init)           \
 33   do_arch_blob(preuniverse, 0)                                          \
 34 
 35 
 36 #define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub,                          \
 37                                       do_arch_blob,                     \
 38                                       do_arch_entry,                    \
 39                                       do_arch_entry_init)               \
 40   do_arch_blob(initial, 10000)                                          \
 41 
 42 
 43 #define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub,                     \
 44                                            do_arch_blob,                \
 45                                            do_arch_entry,               \
 46                                            do_arch_entry_init)          \
 47   do_arch_blob(continuation, 2000)                                      \
 48 
 49 
 50 #define STUBGEN_COMPILER_BLOBS_ARCH_DO(do_stub,                         \
 51                                        do_arch_blob,                    \
 52                                        do_arch_entry,                   \
 53                                        do_arch_entry_init)              \
 54   do_arch_blob(compiler, 70000)                                         \
 55   do_stub(compiler, vector_iota_indices)                                \
 56   do_arch_entry(aarch64, compiler, vector_iota_indices,                 \
 57                 vector_iota_indices, vector_iota_indices)               \
 58   do_stub(compiler, large_array_equals)                                 \
 59   do_arch_entry(aarch64, compiler, large_array_equals,                  \
 60                 large_array_equals, large_array_equals)                 \
 61   do_stub(compiler, large_arrays_hashcode_boolean)                      \
 62   do_arch_entry(aarch64, compiler, large_arrays_hashcode_boolean,       \
 63                 large_arrays_hashcode_boolean,                          \
 64                 large_arrays_hashcode_boolean)                          \
 65   do_stub(compiler, large_arrays_hashcode_byte)                         \
 66   do_arch_entry(aarch64, compiler, large_arrays_hashcode_byte,          \
 67                 large_arrays_hashcode_byte,                             \
 68                 large_arrays_hashcode_byte)                             \
 69   do_stub(compiler, large_arrays_hashcode_char)                         \
 70   do_arch_entry(aarch64, compiler, large_arrays_hashcode_char,          \
 71                 large_arrays_hashcode_char,                             \
 72                 large_arrays_hashcode_char)                             \
 73   do_stub(compiler, large_arrays_hashcode_short)                        \
 74   do_arch_entry(aarch64, compiler, large_arrays_hashcode_short,         \
 75                 large_arrays_hashcode_short,                            \
 76                 large_arrays_hashcode_short)                            \
 77   do_stub(compiler, large_arrays_hashcode_int)                          \
 78   do_arch_entry(aarch64, compiler, large_arrays_hashcode_int,           \
 79                 large_arrays_hashcode_int,                              \
 80                 large_arrays_hashcode_int)                              \
 81   do_stub(compiler, large_byte_array_inflate)                           \
 82   do_arch_entry(aarch64, compiler, large_byte_array_inflate,            \
 83                 large_byte_array_inflate, large_byte_array_inflate)     \
 84   do_stub(compiler, count_positives)                                    \
 85   do_arch_entry(aarch64, compiler, count_positives, count_positives,    \
 86                 count_positives)                                        \
 87   do_stub(compiler, count_positives_long)                               \
 88   do_arch_entry(aarch64, compiler, count_positives_long,                \
 89                 count_positives_long, count_positives_long)             \
 90   do_stub(compiler, compare_long_string_LL)                             \
 91   do_arch_entry(aarch64, compiler, compare_long_string_LL,              \
 92                 compare_long_string_LL, compare_long_string_LL)         \
 93   do_stub(compiler, compare_long_string_UU)                             \
 94   do_arch_entry(aarch64, compiler, compare_long_string_UU,              \
 95                 compare_long_string_UU, compare_long_string_UU)         \
 96   do_stub(compiler, compare_long_string_LU)                             \
 97   do_arch_entry(aarch64, compiler, compare_long_string_LU,              \
 98                 compare_long_string_LU, compare_long_string_LU)         \
 99   do_stub(compiler, compare_long_string_UL)                             \
100   do_arch_entry(aarch64, compiler, compare_long_string_UL,              \
101                 compare_long_string_UL, compare_long_string_UL)         \
102   do_stub(compiler, string_indexof_linear_ll)                           \
103   do_arch_entry(aarch64, compiler, string_indexof_linear_ll,            \
104                 string_indexof_linear_ll, string_indexof_linear_ll)     \
105   do_stub(compiler, string_indexof_linear_uu)                           \
106   do_arch_entry(aarch64, compiler, string_indexof_linear_uu,            \
107                 string_indexof_linear_uu, string_indexof_linear_uu)     \
108   do_stub(compiler, string_indexof_linear_ul)                           \
109   do_arch_entry(aarch64, compiler, string_indexof_linear_ul,            \
110                 string_indexof_linear_ul, string_indexof_linear_ul)     \
111   /* this uses the entry for ghash_processBlocks */                     \
112   do_stub(compiler, ghash_processBlocks_wide)                           \
113 
114 
115 #define STUBGEN_FINAL_BLOBS_ARCH_DO(do_stub,                            \
116                                     do_arch_blob,                       \
117                                     do_arch_entry,                      \
118                                     do_arch_entry_init)                 \
119   do_arch_blob(final, 20000 ZGC_ONLY(+85000))                           \
120   do_stub(final, copy_byte_f)                                           \
121   do_arch_entry(aarch64, final, copy_byte_f, copy_byte_f,               \
122                 copy_byte_f)                                            \
123   do_stub(final, copy_byte_b)                                           \
124   do_arch_entry(aarch64, final, copy_byte_b, copy_byte_b,               \
125                   copy_byte_b)                                          \
126   do_stub(final, copy_oop_f)                                            \
127   do_arch_entry(aarch64, final, copy_oop_f, copy_oop_f, copy_oop_f)     \
128   do_stub(final, copy_oop_b)                                            \
129   do_arch_entry(aarch64, final, copy_oop_b, copy_oop_b, copy_oop_b)     \
130   do_stub(final, copy_oop_uninit_f)                                     \
131   do_arch_entry(aarch64, final, copy_oop_uninit_f, copy_oop_uninit_f,   \
132                 copy_oop_uninit_f)                                      \
133   do_stub(final, copy_oop_uninit_b)                                     \
134   do_arch_entry(aarch64, final, copy_oop_uninit_b, copy_oop_uninit_b,   \
135                 copy_oop_uninit_b)                                      \
136   do_stub(final, zero_blocks)                                           \
137   do_arch_entry(aarch64, final, zero_blocks, zero_blocks,               \
138                 zero_blocks)                                            \
139   do_stub(final, spin_wait)                                             \
140   do_arch_entry_init(aarch64, final, spin_wait, spin_wait,              \
141                      spin_wait, empty_spin_wait)                        \
142   /* stub only -- entries are not stored in StubRoutines::aarch64 */    \
143   /* n.b. these are not the same as the generic atomic stubs */         \
144   do_stub(final, atomic_entry_points)                                   \
145 
146 
147 #endif // CPU_AARCH64_STUBDECLARATIONS_HPP