20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef CPU_X86_C2_MACROASSEMBLER_X86_HPP
26 #define CPU_X86_C2_MACROASSEMBLER_X86_HPP
27
28 // C2_MacroAssembler contains high-level macros for C2
29
30 public:
31 Assembler::AvxVectorLen vector_length_encoding(int vlen_in_bytes);
32
33 // special instructions for EVEX
34 void setvectmask(Register dst, Register src, KRegister mask);
35 void restorevectmask(KRegister mask);
36
37 // Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file.
38 // See full desription in macroAssembler_x86.cpp.
39 void fast_lock(Register obj, Register box, Register tmp,
40 Register scr, Register cx1, Register cx2,
41 BiasedLockingCounters* counters,
42 RTMLockingCounters* rtm_counters,
43 RTMLockingCounters* stack_rtm_counters,
44 Metadata* method_data,
45 bool use_rtm, bool profile_rtm);
46 void fast_unlock(Register obj, Register box, Register tmp, bool use_rtm);
47
48 #if INCLUDE_RTM_OPT
49 void rtm_counters_update(Register abort_status, Register rtm_counters);
50 void branch_on_random_using_rdtsc(Register tmp, Register scr, int count, Label& brLabel);
51 void rtm_abort_ratio_calculation(Register tmp, Register rtm_counters_reg,
52 RTMLockingCounters* rtm_counters,
53 Metadata* method_data);
54 void rtm_profiling(Register abort_status_Reg, Register rtm_counters_Reg,
55 RTMLockingCounters* rtm_counters, Metadata* method_data, bool profile_rtm);
56 void rtm_retry_lock_on_abort(Register retry_count, Register abort_status, Label& retryLabel);
57 void rtm_retry_lock_on_busy(Register retry_count, Register box, Register tmp, Register scr, Label& retryLabel);
58 void rtm_stack_locking(Register obj, Register tmp, Register scr,
59 Register retry_on_abort_count,
60 RTMLockingCounters* stack_rtm_counters,
61 Metadata* method_data, bool profile_rtm,
62 Label& DONE_LABEL, Label& IsInflated);
63 void rtm_inflated_locking(Register obj, Register box, Register tmp,
64 Register scr, Register retry_on_busy_count,
65 Register retry_on_abort_count,
66 RTMLockingCounters* rtm_counters,
67 Metadata* method_data, bool profile_rtm,
261 Address::ScaleFactor scale2, Register index, int ae);
262 // Compare strings.
263 void string_compare(Register str1, Register str2,
264 Register cnt1, Register cnt2, Register result,
265 XMMRegister vec1, int ae, KRegister mask = knoreg);
266
267 // Search for Non-ASCII character (Negative byte value) in a byte array,
268 // return true if it has any and false otherwise.
269 void has_negatives(Register ary1, Register len,
270 Register result, Register tmp1,
271 XMMRegister vec1, XMMRegister vec2, KRegister mask1 = knoreg, KRegister mask2 = knoreg);
272
273 // Compare char[] or byte[] arrays.
274 void arrays_equals(bool is_array_equ, Register ary1, Register ary2,
275 Register limit, Register result, Register chr,
276 XMMRegister vec1, XMMRegister vec2, bool is_char, KRegister mask = knoreg);
277
278 void rearrange_bytes(XMMRegister dst, XMMRegister shuffle, XMMRegister src, XMMRegister xtmp1,
279 XMMRegister xtmp2, XMMRegister xtmp3, Register rtmp, KRegister ktmp, int vlen_enc);
280
281 #endif // CPU_X86_C2_MACROASSEMBLER_X86_HPP
|
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef CPU_X86_C2_MACROASSEMBLER_X86_HPP
26 #define CPU_X86_C2_MACROASSEMBLER_X86_HPP
27
28 // C2_MacroAssembler contains high-level macros for C2
29
30 public:
31 Assembler::AvxVectorLen vector_length_encoding(int vlen_in_bytes);
32
33 // special instructions for EVEX
34 void setvectmask(Register dst, Register src, KRegister mask);
35 void restorevectmask(KRegister mask);
36
37 // Code used by cmpFastLock and cmpFastUnlock mach instructions in .ad file.
38 // See full desription in macroAssembler_x86.cpp.
39 void fast_lock(Register obj, Register box, Register tmp,
40 Register scr, Register cx1, Register cx2, Register thread,
41 BiasedLockingCounters* counters,
42 RTMLockingCounters* rtm_counters,
43 RTMLockingCounters* stack_rtm_counters,
44 Metadata* method_data,
45 bool use_rtm, bool profile_rtm);
46 void fast_unlock(Register obj, Register box, Register tmp, bool use_rtm);
47
48 void fast_lock_lightweight(Register obj, Register box, Register rax_reg,
49 Register t, Register thread);
50 void fast_unlock_lightweight(Register obj, Register reg_rax, Register t, Register thread);
51
52 #if INCLUDE_RTM_OPT
53 void rtm_counters_update(Register abort_status, Register rtm_counters);
54 void branch_on_random_using_rdtsc(Register tmp, Register scr, int count, Label& brLabel);
55 void rtm_abort_ratio_calculation(Register tmp, Register rtm_counters_reg,
56 RTMLockingCounters* rtm_counters,
57 Metadata* method_data);
58 void rtm_profiling(Register abort_status_Reg, Register rtm_counters_Reg,
59 RTMLockingCounters* rtm_counters, Metadata* method_data, bool profile_rtm);
60 void rtm_retry_lock_on_abort(Register retry_count, Register abort_status, Label& retryLabel);
61 void rtm_retry_lock_on_busy(Register retry_count, Register box, Register tmp, Register scr, Label& retryLabel);
62 void rtm_stack_locking(Register obj, Register tmp, Register scr,
63 Register retry_on_abort_count,
64 RTMLockingCounters* stack_rtm_counters,
65 Metadata* method_data, bool profile_rtm,
66 Label& DONE_LABEL, Label& IsInflated);
67 void rtm_inflated_locking(Register obj, Register box, Register tmp,
68 Register scr, Register retry_on_busy_count,
69 Register retry_on_abort_count,
70 RTMLockingCounters* rtm_counters,
71 Metadata* method_data, bool profile_rtm,
265 Address::ScaleFactor scale2, Register index, int ae);
266 // Compare strings.
267 void string_compare(Register str1, Register str2,
268 Register cnt1, Register cnt2, Register result,
269 XMMRegister vec1, int ae, KRegister mask = knoreg);
270
271 // Search for Non-ASCII character (Negative byte value) in a byte array,
272 // return true if it has any and false otherwise.
273 void has_negatives(Register ary1, Register len,
274 Register result, Register tmp1,
275 XMMRegister vec1, XMMRegister vec2, KRegister mask1 = knoreg, KRegister mask2 = knoreg);
276
277 // Compare char[] or byte[] arrays.
278 void arrays_equals(bool is_array_equ, Register ary1, Register ary2,
279 Register limit, Register result, Register chr,
280 XMMRegister vec1, XMMRegister vec2, bool is_char, KRegister mask = knoreg);
281
282 void rearrange_bytes(XMMRegister dst, XMMRegister shuffle, XMMRegister src, XMMRegister xtmp1,
283 XMMRegister xtmp2, XMMRegister xtmp3, Register rtmp, KRegister ktmp, int vlen_enc);
284
285 void load_nklass_compact_c2(Register dst, Register obj, Register index, Address::ScaleFactor scale, int disp);
286
287 #endif // CPU_X86_C2_MACROASSEMBLER_X86_HPP
|