author | katleman |
Wed, 12 Dec 2012 13:21:39 -0800 | |
changeset 14708 | e56b4a0c1da8 |
parent 13886 | 8d82c4dfa722 |
child 14631 | 526804361522 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
11637
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
2 |
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5542
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5542
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5542
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP |
26 |
#define CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP |
|
27 |
||
28 |
#include "asm/assembler.inline.hpp" |
|
29 |
#include "asm/codeBuffer.hpp" |
|
30 |
#include "code/codeCache.hpp" |
|
31 |
#include "runtime/handles.inline.hpp" |
|
32 |
||
1 | 33 |
inline void MacroAssembler::pd_patch_instruction(address branch, address target) { |
34 |
jint& stub_inst = *(jint*) branch; |
|
35 |
stub_inst = patched_branch(target - branch, stub_inst, 0); |
|
36 |
} |
|
37 |
||
38 |
#ifndef PRODUCT |
|
39 |
inline void MacroAssembler::pd_print_patched_instruction(address branch) { |
|
40 |
jint stub_inst = *(jint*) branch; |
|
41 |
print_instruction(stub_inst); |
|
42 |
::tty->print("%s", " (unresolved)"); |
|
43 |
} |
|
44 |
#endif // PRODUCT |
|
45 |
||
46 |
inline bool Address::is_simm13(int offset) { return Assembler::is_simm13(disp() + offset); } |
|
47 |
||
48 |
||
2571 | 49 |
inline int AddressLiteral::low10() const { |
50 |
return Assembler::low10(value()); |
|
51 |
} |
|
52 |
||
53 |
||
1 | 54 |
// inlines for SPARC assembler -- dmu 5/97 |
55 |
||
56 |
inline void Assembler::check_delay() { |
|
57 |
# ifdef CHECK_DELAY |
|
58 |
guarantee( delay_state != at_delay_slot, "must say delayed() when filling delay slot"); |
|
59 |
delay_state = no_delay; |
|
60 |
# endif |
|
61 |
} |
|
62 |
||
63 |
inline void Assembler::emit_long(int x) { |
|
64 |
check_delay(); |
|
65 |
AbstractAssembler::emit_long(x); |
|
66 |
} |
|
67 |
||
68 |
inline void Assembler::emit_data(int x, relocInfo::relocType rtype) { |
|
69 |
relocate(rtype); |
|
70 |
emit_long(x); |
|
71 |
} |
|
72 |
||
73 |
inline void Assembler::emit_data(int x, RelocationHolder const& rspec) { |
|
74 |
relocate(rspec); |
|
75 |
emit_long(x); |
|
76 |
} |
|
77 |
||
78 |
||
2571 | 79 |
inline void Assembler::add(Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); } |
80 |
inline void Assembler::add(Register s1, int simm13a, Register d, relocInfo::relocType rtype ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rtype ); } |
|
81 |
inline void Assembler::add(Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { emit_data( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec ); } |
|
1 | 82 |
|
10252 | 83 |
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt); has_delay_slot(); } |
1 | 84 |
inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { bpr( c, a, p, s1, target(L)); } |
85 |
||
10252 | 86 |
inline void Assembler::fb( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); } |
1 | 87 |
inline void Assembler::fb( Condition c, bool a, Label& L ) { fb(c, a, target(L)); } |
88 |
||
10252 | 89 |
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(fbp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); } |
1 | 90 |
inline void Assembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { fbp(c, a, cc, p, target(L)); } |
91 |
||
10252 | 92 |
inline void Assembler::cb( Condition c, bool a, address d, relocInfo::relocType rt ) { v8_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(cb_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); } |
1 | 93 |
inline void Assembler::cb( Condition c, bool a, Label& L ) { cb(c, a, target(L)); } |
94 |
||
10252 | 95 |
inline void Assembler::br( Condition c, bool a, address d, relocInfo::relocType rt ) { v9_dep(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(br_op2) | wdisp(intptr_t(d), intptr_t(pc()), 22), rt); has_delay_slot(); } |
1 | 96 |
inline void Assembler::br( Condition c, bool a, Label& L ) { br(c, a, target(L)); } |
97 |
||
10252 | 98 |
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { v9_only(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bp_op2) | branchcc(cc) | predict(p) | wdisp(intptr_t(d), intptr_t(pc()), 19), rt); has_delay_slot(); } |
1 | 99 |
inline void Assembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { bp(c, a, cc, p, target(L)); } |
100 |
||
10252 | 101 |
// compare and branch |
102 |
inline void Assembler::cbcond(Condition c, CC cc, Register s1, Register s2, Label& L) { cti(); no_cbcond_before(); emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | rs2(s2)); } |
|
103 |
inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label& L) { cti(); no_cbcond_before(); emit_data(op(branch_op) | cond_cbcond(c) | op2(bpr_op2) | branchcc(cc) | wdisp10(intptr_t(target(L)), intptr_t(pc())) | rs1(s1) | immed(true) | simm(simm5, 5)); } |
|
104 |
||
105 |
inline void Assembler::call( address d, relocInfo::relocType rt ) { cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt); has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); } |
|
1 | 106 |
inline void Assembler::call( Label& L, relocInfo::relocType rt ) { call( target(L), rt); } |
107 |
||
108 |
inline void Assembler::flush( Register s1, Register s2) { emit_long( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); } |
|
109 |
inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
110 |
||
10252 | 111 |
inline void Assembler::jmpl( Register s1, Register s2, Register d ) { cti(); emit_long( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } |
112 |
inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { cti(); emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); } |
|
1 | 113 |
|
4009
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
114 |
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, RegisterOrConstant s2, FloatRegister d) { |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
115 |
if (s2.is_register()) ldf(w, s1, s2.as_register(), d); |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
116 |
else ldf(w, s1, s2.as_constant(), d); |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
117 |
} |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
118 |
|
2571 | 119 |
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | rs2(s2) ); } |
120 |
inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); } |
|
1 | 121 |
|
2571 | 122 |
inline void Assembler::ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset) { relocate(a.rspec(offset)); ldf( w, a.base(), a.disp() + offset, d); } |
1 | 123 |
|
124 |
inline void Assembler::ldfsr( Register s1, Register s2) { v9_dep(); emit_long( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); } |
|
125 |
inline void Assembler::ldfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
126 |
inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); } |
|
127 |
inline void Assembler::ldxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
128 |
||
129 |
inline void Assembler::ldc( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | rs2(s2) ); } |
|
130 |
inline void Assembler::ldc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
131 |
inline void Assembler::lddc( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | rs2(s2) ); } |
|
132 |
inline void Assembler::lddc( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(lddc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
133 |
inline void Assembler::ldcsr( Register s1, Register s2, int crd) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | rs2(s2) ); } |
|
134 |
inline void Assembler::ldcsr( Register s1, int simm13a, int crd) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(ldcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
135 |
||
136 |
inline void Assembler::ldsb( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); } |
|
137 |
inline void Assembler::ldsb( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
138 |
||
139 |
inline void Assembler::ldsh( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsh_op3) | rs1(s1) | rs2(s2) ); } |
|
140 |
inline void Assembler::ldsh( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsh_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
141 |
inline void Assembler::ldsw( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldsw_op3) | rs1(s1) | rs2(s2) ); } |
|
142 |
inline void Assembler::ldsw( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
143 |
inline void Assembler::ldub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldub_op3) | rs1(s1) | rs2(s2) ); } |
|
144 |
inline void Assembler::ldub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
145 |
inline void Assembler::lduh( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(lduh_op3) | rs1(s1) | rs2(s2) ); } |
|
146 |
inline void Assembler::lduh( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(lduh_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
147 |
inline void Assembler::lduw( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(lduw_op3) | rs1(s1) | rs2(s2) ); } |
|
148 |
inline void Assembler::lduw( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(lduw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
149 |
||
150 |
inline void Assembler::ldx( Register s1, Register s2, Register d) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(ldx_op3) | rs1(s1) | rs2(s2) ); } |
|
151 |
inline void Assembler::ldx( Register s1, int simm13a, Register d) { v9_only(); emit_data( op(ldst_op) | rd(d) | op3(ldx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
152 |
inline void Assembler::ldd( Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_long( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); } |
|
153 |
inline void Assembler::ldd( Register s1, int simm13a, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
154 |
||
155 |
#ifdef _LP64 |
|
156 |
// Make all 32 bit loads signed so 64 bit registers maintain proper sign |
|
2571 | 157 |
inline void Assembler::ld( Register s1, Register s2, Register d) { ldsw( s1, s2, d); } |
158 |
inline void Assembler::ld( Register s1, int simm13a, Register d) { ldsw( s1, simm13a, d); } |
|
1 | 159 |
#else |
2571 | 160 |
inline void Assembler::ld( Register s1, Register s2, Register d) { lduw( s1, s2, d); } |
161 |
inline void Assembler::ld( Register s1, int simm13a, Register d) { lduw( s1, simm13a, d); } |
|
162 |
#endif |
|
163 |
||
164 |
#ifdef ASSERT |
|
165 |
// ByteSize is only a class when ASSERT is defined, otherwise it's an int. |
|
166 |
# ifdef _LP64 |
|
167 |
inline void Assembler::ld( Register s1, ByteSize simm13a, Register d) { ldsw( s1, in_bytes(simm13a), d); } |
|
168 |
# else |
|
169 |
inline void Assembler::ld( Register s1, ByteSize simm13a, Register d) { lduw( s1, in_bytes(simm13a), d); } |
|
170 |
# endif |
|
1 | 171 |
#endif |
172 |
||
2571 | 173 |
inline void Assembler::ld( const Address& a, Register d, int offset) { |
174 |
if (a.has_index()) { assert(offset == 0, ""); ld( a.base(), a.index(), d); } |
|
175 |
else { ld( a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
176 |
} |
2571 | 177 |
inline void Assembler::ldsb(const Address& a, Register d, int offset) { |
178 |
if (a.has_index()) { assert(offset == 0, ""); ldsb(a.base(), a.index(), d); } |
|
179 |
else { ldsb(a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
180 |
} |
2571 | 181 |
inline void Assembler::ldsh(const Address& a, Register d, int offset) { |
182 |
if (a.has_index()) { assert(offset == 0, ""); ldsh(a.base(), a.index(), d); } |
|
183 |
else { ldsh(a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
184 |
} |
2571 | 185 |
inline void Assembler::ldsw(const Address& a, Register d, int offset) { |
186 |
if (a.has_index()) { assert(offset == 0, ""); ldsw(a.base(), a.index(), d); } |
|
187 |
else { ldsw(a.base(), a.disp() + offset, d); } |
|
188 |
} |
|
189 |
inline void Assembler::ldub(const Address& a, Register d, int offset) { |
|
190 |
if (a.has_index()) { assert(offset == 0, ""); ldub(a.base(), a.index(), d); } |
|
191 |
else { ldub(a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
192 |
} |
2571 | 193 |
inline void Assembler::lduh(const Address& a, Register d, int offset) { |
194 |
if (a.has_index()) { assert(offset == 0, ""); lduh(a.base(), a.index(), d); } |
|
195 |
else { lduh(a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
196 |
} |
2571 | 197 |
inline void Assembler::lduw(const Address& a, Register d, int offset) { |
198 |
if (a.has_index()) { assert(offset == 0, ""); lduw(a.base(), a.index(), d); } |
|
199 |
else { lduw(a.base(), a.disp() + offset, d); } |
|
200 |
} |
|
201 |
inline void Assembler::ldd( const Address& a, Register d, int offset) { |
|
202 |
if (a.has_index()) { assert(offset == 0, ""); ldd( a.base(), a.index(), d); } |
|
203 |
else { ldd( a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
204 |
} |
2571 | 205 |
inline void Assembler::ldx( const Address& a, Register d, int offset) { |
206 |
if (a.has_index()) { assert(offset == 0, ""); ldx( a.base(), a.index(), d); } |
|
207 |
else { ldx( a.base(), a.disp() + offset, d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
208 |
} |
2571 | 209 |
|
210 |
inline void Assembler::ldub(Register s1, RegisterOrConstant s2, Register d) { ldub(Address(s1, s2), d); } |
|
211 |
inline void Assembler::ldsb(Register s1, RegisterOrConstant s2, Register d) { ldsb(Address(s1, s2), d); } |
|
212 |
inline void Assembler::lduh(Register s1, RegisterOrConstant s2, Register d) { lduh(Address(s1, s2), d); } |
|
213 |
inline void Assembler::ldsh(Register s1, RegisterOrConstant s2, Register d) { ldsh(Address(s1, s2), d); } |
|
214 |
inline void Assembler::lduw(Register s1, RegisterOrConstant s2, Register d) { lduw(Address(s1, s2), d); } |
|
215 |
inline void Assembler::ldsw(Register s1, RegisterOrConstant s2, Register d) { ldsw(Address(s1, s2), d); } |
|
216 |
inline void Assembler::ldx( Register s1, RegisterOrConstant s2, Register d) { ldx( Address(s1, s2), d); } |
|
217 |
inline void Assembler::ld( Register s1, RegisterOrConstant s2, Register d) { ld( Address(s1, s2), d); } |
|
218 |
inline void Assembler::ldd( Register s1, RegisterOrConstant s2, Register d) { ldd( Address(s1, s2), d); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
219 |
|
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
220 |
// form effective addresses this way: |
7112
6fabbeabb6e9
6994093: MethodHandle.invokeGeneric needs porting to SPARC
jrose
parents:
6175
diff
changeset
|
221 |
inline void Assembler::add(const Address& a, Register d, int offset) { |
6fabbeabb6e9
6994093: MethodHandle.invokeGeneric needs porting to SPARC
jrose
parents:
6175
diff
changeset
|
222 |
if (a.has_index()) add(a.base(), a.index(), d); |
6fabbeabb6e9
6994093: MethodHandle.invokeGeneric needs porting to SPARC
jrose
parents:
6175
diff
changeset
|
223 |
else { add(a.base(), a.disp() + offset, d, a.rspec(offset)); offset = 0; } |
6fabbeabb6e9
6994093: MethodHandle.invokeGeneric needs porting to SPARC
jrose
parents:
6175
diff
changeset
|
224 |
if (offset != 0) add(d, offset, d); |
6fabbeabb6e9
6994093: MethodHandle.invokeGeneric needs porting to SPARC
jrose
parents:
6175
diff
changeset
|
225 |
} |
5416 | 226 |
inline void Assembler::add(Register s1, RegisterOrConstant s2, Register d, int offset) { |
227 |
if (s2.is_register()) add(s1, s2.as_register(), d); |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
228 |
else { add(s1, s2.as_constant() + offset, d); offset = 0; } |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
229 |
if (offset != 0) add(d, offset, d); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
230 |
} |
1 | 231 |
|
5416 | 232 |
inline void Assembler::andn(Register s1, RegisterOrConstant s2, Register d) { |
233 |
if (s2.is_register()) andn(s1, s2.as_register(), d); |
|
234 |
else andn(s1, s2.as_constant(), d); |
|
235 |
} |
|
236 |
||
1 | 237 |
inline void Assembler::ldstub( Register s1, Register s2, Register d) { emit_long( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | rs2(s2) ); } |
238 |
inline void Assembler::ldstub( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldstub_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
239 |
||
240 |
||
241 |
inline void Assembler::prefetch(Register s1, Register s2, PrefetchFcn f) { v9_only(); emit_long( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); } |
|
242 |
inline void Assembler::prefetch(Register s1, int simm13a, PrefetchFcn f) { v9_only(); emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
243 |
||
244 |
inline void Assembler::prefetch(const Address& a, PrefetchFcn f, int offset) { v9_only(); relocate(a.rspec(offset)); prefetch(a.base(), a.disp() + offset, f); } |
|
245 |
||
246 |
||
10252 | 247 |
inline void Assembler::rett( Register s1, Register s2 ) { cti(); emit_long( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } |
248 |
inline void Assembler::rett( Register s1, int simm13a, relocInfo::relocType rt) { cti(); emit_data( op(arith_op) | op3(rett_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rt); has_delay_slot(); } |
|
1 | 249 |
|
250 |
inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rspec ) { emit_data( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(imm22a), rspec); } |
|
251 |
||
252 |
// pp 222 |
|
253 |
||
4009
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
254 |
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, RegisterOrConstant s2) { |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
255 |
if (s2.is_register()) stf(w, d, s1, s2.as_register()); |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
256 |
else stf(w, d, s1, s2.as_constant()); |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
257 |
} |
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
258 |
|
1 | 259 |
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_long( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); } |
260 |
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a) { emit_data( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
261 |
||
9976
6fef34e63df1
7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
7892
diff
changeset
|
262 |
inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, const Address& a, int offset) { |
6fef34e63df1
7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
7892
diff
changeset
|
263 |
relocate(a.rspec(offset)); |
6fef34e63df1
7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
7892
diff
changeset
|
264 |
if (a.has_index()) { assert(offset == 0, ""); stf(w, d, a.base(), a.index() ); } |
6fef34e63df1
7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
7892
diff
changeset
|
265 |
else { stf(w, d, a.base(), a.disp() + offset); } |
6fef34e63df1
7045514: SPARC assembly code for JSR 292 ricochet frames
never
parents:
7892
diff
changeset
|
266 |
} |
1 | 267 |
|
268 |
inline void Assembler::stfsr( Register s1, Register s2) { v9_dep(); emit_long( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); } |
|
269 |
inline void Assembler::stfsr( Register s1, int simm13a) { v9_dep(); emit_data( op(ldst_op) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
270 |
inline void Assembler::stxfsr( Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); } |
|
271 |
inline void Assembler::stxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
272 |
||
273 |
// p 226 |
|
274 |
||
275 |
inline void Assembler::stb( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | rs2(s2) ); } |
|
276 |
inline void Assembler::stb( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
277 |
inline void Assembler::sth( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(sth_op3) | rs1(s1) | rs2(s2) ); } |
|
278 |
inline void Assembler::sth( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(sth_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
279 |
inline void Assembler::stw( Register d, Register s1, Register s2) { emit_long( op(ldst_op) | rd(d) | op3(stw_op3) | rs1(s1) | rs2(s2) ); } |
|
280 |
inline void Assembler::stw( Register d, Register s1, int simm13a) { emit_data( op(ldst_op) | rd(d) | op3(stw_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
281 |
||
282 |
||
283 |
inline void Assembler::stx( Register d, Register s1, Register s2) { v9_only(); emit_long( op(ldst_op) | rd(d) | op3(stx_op3) | rs1(s1) | rs2(s2) ); } |
|
284 |
inline void Assembler::stx( Register d, Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(d) | op3(stx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
285 |
inline void Assembler::std( Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_long( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); } |
|
286 |
inline void Assembler::std( Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
287 |
||
2571 | 288 |
inline void Assembler::st( Register d, Register s1, Register s2) { stw(d, s1, s2); } |
289 |
inline void Assembler::st( Register d, Register s1, int simm13a) { stw(d, s1, simm13a); } |
|
290 |
||
291 |
#ifdef ASSERT |
|
292 |
// ByteSize is only a class when ASSERT is defined, otherwise it's an int. |
|
293 |
inline void Assembler::st( Register d, Register s1, ByteSize simm13a) { stw(d, s1, in_bytes(simm13a)); } |
|
294 |
#endif |
|
1 | 295 |
|
2571 | 296 |
inline void Assembler::stb(Register d, const Address& a, int offset) { |
297 |
if (a.has_index()) { assert(offset == 0, ""); stb(d, a.base(), a.index() ); } |
|
298 |
else { stb(d, a.base(), a.disp() + offset); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
299 |
} |
2571 | 300 |
inline void Assembler::sth(Register d, const Address& a, int offset) { |
301 |
if (a.has_index()) { assert(offset == 0, ""); sth(d, a.base(), a.index() ); } |
|
302 |
else { sth(d, a.base(), a.disp() + offset); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
303 |
} |
2571 | 304 |
inline void Assembler::stw(Register d, const Address& a, int offset) { |
305 |
if (a.has_index()) { assert(offset == 0, ""); stw(d, a.base(), a.index() ); } |
|
306 |
else { stw(d, a.base(), a.disp() + offset); } |
|
307 |
} |
|
308 |
inline void Assembler::st( Register d, const Address& a, int offset) { |
|
309 |
if (a.has_index()) { assert(offset == 0, ""); st( d, a.base(), a.index() ); } |
|
310 |
else { st( d, a.base(), a.disp() + offset); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
311 |
} |
2571 | 312 |
inline void Assembler::std(Register d, const Address& a, int offset) { |
313 |
if (a.has_index()) { assert(offset == 0, ""); std(d, a.base(), a.index() ); } |
|
314 |
else { std(d, a.base(), a.disp() + offset); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
315 |
} |
2571 | 316 |
inline void Assembler::stx(Register d, const Address& a, int offset) { |
317 |
if (a.has_index()) { assert(offset == 0, ""); stx(d, a.base(), a.index() ); } |
|
318 |
else { stx(d, a.base(), a.disp() + offset); } |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
319 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
320 |
|
2571 | 321 |
inline void Assembler::stb(Register d, Register s1, RegisterOrConstant s2) { stb(d, Address(s1, s2)); } |
322 |
inline void Assembler::sth(Register d, Register s1, RegisterOrConstant s2) { sth(d, Address(s1, s2)); } |
|
4009
8731c367fa98
6879902: CTW failure jdk6_18/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp:845
twisti
parents:
2571
diff
changeset
|
323 |
inline void Assembler::stw(Register d, Register s1, RegisterOrConstant s2) { stw(d, Address(s1, s2)); } |
2571 | 324 |
inline void Assembler::stx(Register d, Register s1, RegisterOrConstant s2) { stx(d, Address(s1, s2)); } |
325 |
inline void Assembler::std(Register d, Register s1, RegisterOrConstant s2) { std(d, Address(s1, s2)); } |
|
326 |
inline void Assembler::st( Register d, Register s1, RegisterOrConstant s2) { st( d, Address(s1, s2)); } |
|
1 | 327 |
|
328 |
// v8 p 99 |
|
329 |
||
330 |
inline void Assembler::stc( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | rs2(s2) ); } |
|
331 |
inline void Assembler::stc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
332 |
inline void Assembler::stdc( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | rs2(s2) ); } |
|
333 |
inline void Assembler::stdc( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdc_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
334 |
inline void Assembler::stcsr( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | rs2(s2) ); } |
|
335 |
inline void Assembler::stcsr( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stcsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
336 |
inline void Assembler::stdcq( int crd, Register s1, Register s2) { v8_only(); emit_long( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | rs2(s2) ); } |
|
337 |
inline void Assembler::stdcq( int crd, Register s1, int simm13a) { v8_only(); emit_data( op(ldst_op) | fcn(crd) | op3(stdcq_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
338 |
||
7433 | 339 |
inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int offset) { |
340 |
if (s2.is_register()) sub(s1, s2.as_register(), d); |
|
341 |
else { sub(s1, s2.as_constant() + offset, d); offset = 0; } |
|
342 |
if (offset != 0) sub(d, offset, d); |
|
343 |
} |
|
1 | 344 |
|
345 |
// pp 231 |
|
346 |
||
347 |
inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); } |
|
348 |
inline void Assembler::swap( Register s1, int simm13a, Register d) { v9_dep(); emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } |
|
349 |
||
13886
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13728
diff
changeset
|
350 |
inline void Assembler::swap( Address& a, Register d, int offset ) { |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13728
diff
changeset
|
351 |
relocate(a.rspec(offset)); |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13728
diff
changeset
|
352 |
if (a.has_index()) { assert(offset == 0, ""); swap( a.base(), a.index(), d ); } |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13728
diff
changeset
|
353 |
else { swap( a.base(), a.disp() + offset, d ); } |
8d82c4dfa722
7023898: Intrinsify AtomicLongFieldUpdater.getAndIncrement()
roland
parents:
13728
diff
changeset
|
354 |
} |
1 | 355 |
|
356 |
||
357 |
// Use the right loads/stores for the platform |
|
358 |
inline void MacroAssembler::ld_ptr( Register s1, Register s2, Register d ) { |
|
359 |
#ifdef _LP64 |
|
2571 | 360 |
Assembler::ldx(s1, s2, d); |
1 | 361 |
#else |
2571 | 362 |
Assembler::ld( s1, s2, d); |
1 | 363 |
#endif |
364 |
} |
|
365 |
||
366 |
inline void MacroAssembler::ld_ptr( Register s1, int simm13a, Register d ) { |
|
367 |
#ifdef _LP64 |
|
2571 | 368 |
Assembler::ldx(s1, simm13a, d); |
1 | 369 |
#else |
2571 | 370 |
Assembler::ld( s1, simm13a, d); |
1 | 371 |
#endif |
372 |
} |
|
373 |
||
2571 | 374 |
#ifdef ASSERT |
375 |
// ByteSize is only a class when ASSERT is defined, otherwise it's an int. |
|
376 |
inline void MacroAssembler::ld_ptr( Register s1, ByteSize simm13a, Register d ) { |
|
377 |
ld_ptr(s1, in_bytes(simm13a), d); |
|
378 |
} |
|
379 |
#endif |
|
380 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2149
diff
changeset
|
381 |
inline void MacroAssembler::ld_ptr( Register s1, RegisterOrConstant s2, Register d ) { |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
382 |
#ifdef _LP64 |
2571 | 383 |
Assembler::ldx(s1, s2, d); |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
384 |
#else |
2571 | 385 |
Assembler::ld( s1, s2, d); |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
386 |
#endif |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
387 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
388 |
|
2571 | 389 |
inline void MacroAssembler::ld_ptr(const Address& a, Register d, int offset) { |
1 | 390 |
#ifdef _LP64 |
2571 | 391 |
Assembler::ldx(a, d, offset); |
1 | 392 |
#else |
2571 | 393 |
Assembler::ld( a, d, offset); |
1 | 394 |
#endif |
395 |
} |
|
396 |
||
397 |
inline void MacroAssembler::st_ptr( Register d, Register s1, Register s2 ) { |
|
398 |
#ifdef _LP64 |
|
2571 | 399 |
Assembler::stx(d, s1, s2); |
1 | 400 |
#else |
401 |
Assembler::st( d, s1, s2); |
|
402 |
#endif |
|
403 |
} |
|
404 |
||
405 |
inline void MacroAssembler::st_ptr( Register d, Register s1, int simm13a ) { |
|
406 |
#ifdef _LP64 |
|
2571 | 407 |
Assembler::stx(d, s1, simm13a); |
1 | 408 |
#else |
409 |
Assembler::st( d, s1, simm13a); |
|
410 |
#endif |
|
411 |
} |
|
412 |
||
2571 | 413 |
#ifdef ASSERT |
414 |
// ByteSize is only a class when ASSERT is defined, otherwise it's an int. |
|
415 |
inline void MacroAssembler::st_ptr( Register d, Register s1, ByteSize simm13a ) { |
|
416 |
st_ptr(d, s1, in_bytes(simm13a)); |
|
417 |
} |
|
418 |
#endif |
|
419 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2149
diff
changeset
|
420 |
inline void MacroAssembler::st_ptr( Register d, Register s1, RegisterOrConstant s2 ) { |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
421 |
#ifdef _LP64 |
2571 | 422 |
Assembler::stx(d, s1, s2); |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
423 |
#else |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
424 |
Assembler::st( d, s1, s2); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
425 |
#endif |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
426 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
427 |
|
2571 | 428 |
inline void MacroAssembler::st_ptr(Register d, const Address& a, int offset) { |
1 | 429 |
#ifdef _LP64 |
2571 | 430 |
Assembler::stx(d, a, offset); |
1 | 431 |
#else |
2571 | 432 |
Assembler::st( d, a, offset); |
1 | 433 |
#endif |
434 |
} |
|
435 |
||
436 |
// Use the right loads/stores for the platform |
|
437 |
inline void MacroAssembler::ld_long( Register s1, Register s2, Register d ) { |
|
438 |
#ifdef _LP64 |
|
439 |
Assembler::ldx(s1, s2, d); |
|
440 |
#else |
|
441 |
Assembler::ldd(s1, s2, d); |
|
442 |
#endif |
|
443 |
} |
|
444 |
||
445 |
inline void MacroAssembler::ld_long( Register s1, int simm13a, Register d ) { |
|
446 |
#ifdef _LP64 |
|
447 |
Assembler::ldx(s1, simm13a, d); |
|
448 |
#else |
|
449 |
Assembler::ldd(s1, simm13a, d); |
|
450 |
#endif |
|
451 |
} |
|
452 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2149
diff
changeset
|
453 |
inline void MacroAssembler::ld_long( Register s1, RegisterOrConstant s2, Register d ) { |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
454 |
#ifdef _LP64 |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
455 |
Assembler::ldx(s1, s2, d); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
456 |
#else |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
457 |
Assembler::ldd(s1, s2, d); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
458 |
#endif |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
459 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
460 |
|
2571 | 461 |
inline void MacroAssembler::ld_long(const Address& a, Register d, int offset) { |
1 | 462 |
#ifdef _LP64 |
2571 | 463 |
Assembler::ldx(a, d, offset); |
1 | 464 |
#else |
2571 | 465 |
Assembler::ldd(a, d, offset); |
1 | 466 |
#endif |
467 |
} |
|
468 |
||
469 |
inline void MacroAssembler::st_long( Register d, Register s1, Register s2 ) { |
|
470 |
#ifdef _LP64 |
|
471 |
Assembler::stx(d, s1, s2); |
|
472 |
#else |
|
473 |
Assembler::std(d, s1, s2); |
|
474 |
#endif |
|
475 |
} |
|
476 |
||
477 |
inline void MacroAssembler::st_long( Register d, Register s1, int simm13a ) { |
|
478 |
#ifdef _LP64 |
|
479 |
Assembler::stx(d, s1, simm13a); |
|
480 |
#else |
|
481 |
Assembler::std(d, s1, simm13a); |
|
482 |
#endif |
|
483 |
} |
|
484 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2149
diff
changeset
|
485 |
inline void MacroAssembler::st_long( Register d, Register s1, RegisterOrConstant s2 ) { |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
486 |
#ifdef _LP64 |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
487 |
Assembler::stx(d, s1, s2); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
488 |
#else |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
489 |
Assembler::std(d, s1, s2); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
490 |
#endif |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
491 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1
diff
changeset
|
492 |
|
1 | 493 |
inline void MacroAssembler::st_long( Register d, const Address& a, int offset ) { |
494 |
#ifdef _LP64 |
|
495 |
Assembler::stx(d, a, offset); |
|
496 |
#else |
|
497 |
Assembler::std(d, a, offset); |
|
498 |
#endif |
|
499 |
} |
|
500 |
||
501 |
// Functions for isolating 64 bit shifts for LP64 |
|
502 |
||
503 |
inline void MacroAssembler::sll_ptr( Register s1, Register s2, Register d ) { |
|
504 |
#ifdef _LP64 |
|
505 |
Assembler::sllx(s1, s2, d); |
|
506 |
#else |
|
2571 | 507 |
Assembler::sll( s1, s2, d); |
1 | 508 |
#endif |
509 |
} |
|
510 |
||
511 |
inline void MacroAssembler::sll_ptr( Register s1, int imm6a, Register d ) { |
|
512 |
#ifdef _LP64 |
|
513 |
Assembler::sllx(s1, imm6a, d); |
|
514 |
#else |
|
2571 | 515 |
Assembler::sll( s1, imm6a, d); |
1 | 516 |
#endif |
517 |
} |
|
518 |
||
519 |
inline void MacroAssembler::srl_ptr( Register s1, Register s2, Register d ) { |
|
520 |
#ifdef _LP64 |
|
521 |
Assembler::srlx(s1, s2, d); |
|
522 |
#else |
|
2571 | 523 |
Assembler::srl( s1, s2, d); |
1 | 524 |
#endif |
525 |
} |
|
526 |
||
527 |
inline void MacroAssembler::srl_ptr( Register s1, int imm6a, Register d ) { |
|
528 |
#ifdef _LP64 |
|
529 |
Assembler::srlx(s1, imm6a, d); |
|
530 |
#else |
|
2571 | 531 |
Assembler::srl( s1, imm6a, d); |
1 | 532 |
#endif |
533 |
} |
|
534 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2149
diff
changeset
|
535 |
inline void MacroAssembler::sll_ptr( Register s1, RegisterOrConstant s2, Register d ) { |
2149
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
536 |
if (s2.is_register()) sll_ptr(s1, s2.as_register(), d); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
537 |
else sll_ptr(s1, s2.as_constant(), d); |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
538 |
} |
3d362637b307
6812831: factor duplicated assembly code for megamorphic invokeinterface (for 6655638)
jrose
parents:
2148
diff
changeset
|
539 |
|
1 | 540 |
// Use the right branch for the platform |
541 |
||
542 |
inline void MacroAssembler::br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { |
|
543 |
if (VM_Version::v9_instructions_work()) |
|
544 |
Assembler::bp(c, a, icc, p, d, rt); |
|
545 |
else |
|
546 |
Assembler::br(c, a, d, rt); |
|
547 |
} |
|
548 |
||
549 |
inline void MacroAssembler::br( Condition c, bool a, Predict p, Label& L ) { |
|
550 |
br(c, a, p, target(L)); |
|
551 |
} |
|
552 |
||
553 |
||
554 |
// Branch that tests either xcc or icc depending on the |
|
555 |
// architecture compiled (LP64 or not) |
|
556 |
inline void MacroAssembler::brx( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { |
|
557 |
#ifdef _LP64 |
|
558 |
Assembler::bp(c, a, xcc, p, d, rt); |
|
559 |
#else |
|
560 |
MacroAssembler::br(c, a, p, d, rt); |
|
561 |
#endif |
|
562 |
} |
|
563 |
||
564 |
inline void MacroAssembler::brx( Condition c, bool a, Predict p, Label& L ) { |
|
565 |
brx(c, a, p, target(L)); |
|
566 |
} |
|
567 |
||
10252 | 568 |
inline void MacroAssembler::ba( Label& L ) { |
569 |
br(always, false, pt, L); |
|
1 | 570 |
} |
571 |
||
572 |
// Warning: V9 only functions |
|
573 |
inline void MacroAssembler::bp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { |
|
574 |
Assembler::bp(c, a, cc, p, d, rt); |
|
575 |
} |
|
576 |
||
577 |
inline void MacroAssembler::bp( Condition c, bool a, CC cc, Predict p, Label& L ) { |
|
578 |
Assembler::bp(c, a, cc, p, L); |
|
579 |
} |
|
580 |
||
581 |
inline void MacroAssembler::fb( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { |
|
582 |
if (VM_Version::v9_instructions_work()) |
|
583 |
fbp(c, a, fcc0, p, d, rt); |
|
584 |
else |
|
585 |
Assembler::fb(c, a, d, rt); |
|
586 |
} |
|
587 |
||
588 |
inline void MacroAssembler::fb( Condition c, bool a, Predict p, Label& L ) { |
|
589 |
fb(c, a, p, target(L)); |
|
590 |
} |
|
591 |
||
592 |
inline void MacroAssembler::fbp( Condition c, bool a, CC cc, Predict p, address d, relocInfo::relocType rt ) { |
|
593 |
Assembler::fbp(c, a, cc, p, d, rt); |
|
594 |
} |
|
595 |
||
596 |
inline void MacroAssembler::fbp( Condition c, bool a, CC cc, Predict p, Label& L ) { |
|
597 |
Assembler::fbp(c, a, cc, p, L); |
|
598 |
} |
|
599 |
||
600 |
inline void MacroAssembler::jmp( Register s1, Register s2 ) { jmpl( s1, s2, G0 ); } |
|
601 |
inline void MacroAssembler::jmp( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, G0, rspec); } |
|
602 |
||
7892
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
603 |
inline bool MacroAssembler::is_far_target(address d) { |
10983
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
604 |
if (ForceUnreachable) { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
605 |
// References outside the code cache should be treated as far |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
606 |
return d < CodeCache::low_bound() || d > CodeCache::high_bound(); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
607 |
} |
7892
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
608 |
return !is_in_wdisp30_range(d, CodeCache::low_bound()) || !is_in_wdisp30_range(d, CodeCache::high_bound()); |
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
609 |
} |
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
610 |
|
1 | 611 |
// Call with a check to see if we need to deal with the added |
612 |
// expense of relocation and if we overflow the displacement |
|
7892
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
613 |
// of the quick call instruction. |
1 | 614 |
inline void MacroAssembler::call( address d, relocInfo::relocType rt ) { |
615 |
#ifdef _LP64 |
|
616 |
intptr_t disp; |
|
617 |
// NULL is ok because it will be relocated later. |
|
618 |
// Must change NULL to a reachable address in order to |
|
619 |
// pass asserts here and in wdisp. |
|
620 |
if ( d == NULL ) |
|
621 |
d = pc(); |
|
622 |
||
623 |
// Is this address within range of the call instruction? |
|
624 |
// If not, use the expensive instruction sequence |
|
7892
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
625 |
if (is_far_target(d)) { |
1 | 626 |
relocate(rt); |
2571 | 627 |
AddressLiteral dest(d); |
628 |
jumpl_to(dest, O7, O7); |
|
7892
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
629 |
} else { |
ff4948f95c49
7011627: C1: call_RT must support targets that don't fit in wdisp30
iveresov
parents:
7433
diff
changeset
|
630 |
Assembler::call(d, rt); |
1 | 631 |
} |
632 |
#else |
|
633 |
Assembler::call( d, rt ); |
|
634 |
#endif |
|
635 |
} |
|
636 |
||
637 |
inline void MacroAssembler::call( Label& L, relocInfo::relocType rt ) { |
|
638 |
MacroAssembler::call( target(L), rt); |
|
639 |
} |
|
640 |
||
641 |
||
642 |
||
643 |
inline void MacroAssembler::callr( Register s1, Register s2 ) { jmpl( s1, s2, O7 ); } |
|
644 |
inline void MacroAssembler::callr( Register s1, int simm13a, RelocationHolder const& rspec ) { jmpl( s1, simm13a, O7, rspec); } |
|
645 |
||
646 |
// prefetch instruction |
|
647 |
inline void MacroAssembler::iprefetch( address d, relocInfo::relocType rt ) { |
|
648 |
if (VM_Version::v9_instructions_work()) |
|
649 |
Assembler::bp( never, true, xcc, pt, d, rt ); |
|
650 |
} |
|
651 |
inline void MacroAssembler::iprefetch( Label& L) { iprefetch( target(L) ); } |
|
652 |
||
653 |
||
654 |
// clobbers o7 on V8!! |
|
655 |
// returns delta from gotten pc to addr after |
|
656 |
inline int MacroAssembler::get_pc( Register d ) { |
|
657 |
int x = offset(); |
|
658 |
if (VM_Version::v9_instructions_work()) |
|
659 |
rdpc(d); |
|
660 |
else { |
|
661 |
Label lbl; |
|
662 |
Assembler::call(lbl, relocInfo::none); // No relocation as this is call to pc+0x8 |
|
663 |
if (d == O7) delayed()->nop(); |
|
664 |
else delayed()->mov(O7, d); |
|
665 |
bind(lbl); |
|
666 |
} |
|
667 |
return offset() - x; |
|
668 |
} |
|
669 |
||
670 |
||
671 |
// Note: All MacroAssembler::set_foo functions are defined out-of-line. |
|
672 |
||
673 |
||
674 |
// Loads the current PC of the following instruction as an immediate value in |
|
675 |
// 2 instructions. All PCs in the CodeCache are within 2 Gig of each other. |
|
676 |
inline intptr_t MacroAssembler::load_pc_address( Register reg, int bytes_to_skip ) { |
|
677 |
intptr_t thepc = (intptr_t)pc() + 2*BytesPerInstWord + bytes_to_skip; |
|
678 |
#ifdef _LP64 |
|
679 |
Unimplemented(); |
|
680 |
#else |
|
681 |
Assembler::sethi( thepc & ~0x3ff, reg, internal_word_Relocation::spec((address)thepc)); |
|
682 |
Assembler::add(reg,thepc & 0x3ff, reg, internal_word_Relocation::spec((address)thepc)); |
|
683 |
#endif |
|
684 |
return thepc; |
|
685 |
} |
|
686 |
||
2571 | 687 |
|
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
688 |
inline void MacroAssembler::load_contents(const AddressLiteral& addrlit, Register d, int offset) { |
1 | 689 |
assert_not_delayed(); |
10983
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
690 |
if (ForceUnreachable) { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
691 |
patchable_sethi(addrlit, d); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
692 |
} else { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
693 |
sethi(addrlit, d); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
694 |
} |
2571 | 695 |
ld(d, addrlit.low10() + offset, d); |
1 | 696 |
} |
697 |
||
698 |
||
11637
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
699 |
inline void MacroAssembler::load_bool_contents(const AddressLiteral& addrlit, Register d, int offset) { |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
700 |
assert_not_delayed(); |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
701 |
if (ForceUnreachable) { |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
702 |
patchable_sethi(addrlit, d); |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
703 |
} else { |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
704 |
sethi(addrlit, d); |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
705 |
} |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
706 |
ldub(d, addrlit.low10() + offset, d); |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
707 |
} |
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
708 |
|
030466036615
7013347: allow crypto functions to be called inline to enhance performance
never
parents:
10983
diff
changeset
|
709 |
|
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
710 |
inline void MacroAssembler::load_ptr_contents(const AddressLiteral& addrlit, Register d, int offset) { |
1 | 711 |
assert_not_delayed(); |
10983
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
712 |
if (ForceUnreachable) { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
713 |
patchable_sethi(addrlit, d); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
714 |
} else { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
715 |
sethi(addrlit, d); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
716 |
} |
2571 | 717 |
ld_ptr(d, addrlit.low10() + offset, d); |
1 | 718 |
} |
719 |
||
720 |
||
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
721 |
inline void MacroAssembler::store_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { |
1 | 722 |
assert_not_delayed(); |
10983
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
723 |
if (ForceUnreachable) { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
724 |
patchable_sethi(addrlit, temp); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
725 |
} else { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
726 |
sethi(addrlit, temp); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
727 |
} |
2571 | 728 |
st(s, temp, addrlit.low10() + offset); |
1 | 729 |
} |
730 |
||
731 |
||
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
732 |
inline void MacroAssembler::store_ptr_contents(Register s, const AddressLiteral& addrlit, Register temp, int offset) { |
1 | 733 |
assert_not_delayed(); |
10983
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
734 |
if (ForceUnreachable) { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
735 |
patchable_sethi(addrlit, temp); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
736 |
} else { |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
737 |
sethi(addrlit, temp); |
9ab65f4cec18
7104960: JSR 292: +VerifyMethodHandles in product JVM can overflow buffer
never
parents:
10252
diff
changeset
|
738 |
} |
2571 | 739 |
st_ptr(s, temp, addrlit.low10() + offset); |
1 | 740 |
} |
741 |
||
742 |
||
743 |
// This code sequence is relocatable to any address, even on LP64. |
|
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
744 |
inline void MacroAssembler::jumpl_to(const AddressLiteral& addrlit, Register temp, Register d, int offset) { |
1 | 745 |
assert_not_delayed(); |
746 |
// Force fixed length sethi because NativeJump and NativeFarCall don't handle |
|
747 |
// variable length instruction streams. |
|
2571 | 748 |
patchable_sethi(addrlit, temp); |
749 |
jmpl(temp, addrlit.low10() + offset, d); |
|
1 | 750 |
} |
751 |
||
752 |
||
6175
86dbf3cacacc
6958465: Sparc aten build24.0: openjdk-7.ea-b96 failed Error: Formal argument ... requires an lvalue
coleenp
parents:
5547
diff
changeset
|
753 |
inline void MacroAssembler::jump_to(const AddressLiteral& addrlit, Register temp, int offset) { |
2571 | 754 |
jumpl_to(addrlit, temp, G0, offset); |
1 | 755 |
} |
756 |
||
757 |
||
2571 | 758 |
inline void MacroAssembler::jump_indirect_to(Address& a, Register temp, |
759 |
int ld_offset, int jmp_offset) { |
|
2534 | 760 |
assert_not_delayed(); |
2571 | 761 |
//sethi(al); // sethi is caller responsibility for this one |
2534 | 762 |
ld_ptr(a, temp, ld_offset); |
763 |
jmp(temp, jmp_offset); |
|
764 |
} |
|
765 |
||
766 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
767 |
inline void MacroAssembler::set_metadata(Metadata* obj, Register d) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
768 |
set_metadata(allocate_metadata_address(obj), d); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
769 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
770 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
771 |
inline void MacroAssembler::set_metadata_constant(Metadata* obj, Register d) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
772 |
set_metadata(constant_metadata_address(obj), d); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
773 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
774 |
|
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
775 |
inline void MacroAssembler::set_metadata(const AddressLiteral& obj_addr, Register d) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
776 |
assert(obj_addr.rspec().type() == relocInfo::metadata_type, "must be a metadata reloc"); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
777 |
set(obj_addr, d); |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
778 |
} |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11637
diff
changeset
|
779 |
|
2571 | 780 |
inline void MacroAssembler::set_oop(jobject obj, Register d) { |
781 |
set_oop(allocate_oop_address(obj), d); |
|
1 | 782 |
} |
783 |
||
784 |
||
2571 | 785 |
inline void MacroAssembler::set_oop_constant(jobject obj, Register d) { |
786 |
set_oop(constant_oop_address(obj), d); |
|
1 | 787 |
} |
788 |
||
789 |
||
5542
be05c5ffe905
6951319: enable solaris builds using Sun Studio 12 update 1
jcoomes
parents:
5416
diff
changeset
|
790 |
inline void MacroAssembler::set_oop(const AddressLiteral& obj_addr, Register d) { |
2571 | 791 |
assert(obj_addr.rspec().type() == relocInfo::oop_type, "must be an oop reloc"); |
792 |
set(obj_addr, d); |
|
1 | 793 |
} |
794 |
||
795 |
||
796 |
inline void MacroAssembler::load_argument( Argument& a, Register d ) { |
|
797 |
if (a.is_register()) |
|
798 |
mov(a.as_register(), d); |
|
799 |
else |
|
800 |
ld (a.as_address(), d); |
|
801 |
} |
|
802 |
||
803 |
inline void MacroAssembler::store_argument( Register s, Argument& a ) { |
|
804 |
if (a.is_register()) |
|
805 |
mov(s, a.as_register()); |
|
806 |
else |
|
807 |
st_ptr (s, a.as_address()); // ABI says everything is right justified. |
|
808 |
} |
|
809 |
||
810 |
inline void MacroAssembler::store_ptr_argument( Register s, Argument& a ) { |
|
811 |
if (a.is_register()) |
|
812 |
mov(s, a.as_register()); |
|
813 |
else |
|
814 |
st_ptr (s, a.as_address()); |
|
815 |
} |
|
816 |
||
817 |
||
818 |
#ifdef _LP64 |
|
819 |
inline void MacroAssembler::store_float_argument( FloatRegister s, Argument& a ) { |
|
820 |
if (a.is_float_register()) |
|
821 |
// V9 ABI has F1, F3, F5 are used to pass instead of O0, O1, O2 |
|
822 |
fmov(FloatRegisterImpl::S, s, a.as_float_register() ); |
|
823 |
else |
|
824 |
// Floats are stored in the high half of the stack entry |
|
825 |
// The low half is undefined per the ABI. |
|
826 |
stf(FloatRegisterImpl::S, s, a.as_address(), sizeof(jfloat)); |
|
827 |
} |
|
828 |
||
829 |
inline void MacroAssembler::store_double_argument( FloatRegister s, Argument& a ) { |
|
830 |
if (a.is_float_register()) |
|
831 |
// V9 ABI has D0, D2, D4 are used to pass instead of O0, O1, O2 |
|
832 |
fmov(FloatRegisterImpl::D, s, a.as_double_register() ); |
|
833 |
else |
|
834 |
stf(FloatRegisterImpl::D, s, a.as_address()); |
|
835 |
} |
|
836 |
||
837 |
inline void MacroAssembler::store_long_argument( Register s, Argument& a ) { |
|
838 |
if (a.is_register()) |
|
839 |
mov(s, a.as_register()); |
|
840 |
else |
|
841 |
stx(s, a.as_address()); |
|
842 |
} |
|
843 |
#endif |
|
844 |
||
845 |
inline void MacroAssembler::clrb( Register s1, Register s2) { stb( G0, s1, s2 ); } |
|
846 |
inline void MacroAssembler::clrh( Register s1, Register s2) { sth( G0, s1, s2 ); } |
|
847 |
inline void MacroAssembler::clr( Register s1, Register s2) { stw( G0, s1, s2 ); } |
|
848 |
inline void MacroAssembler::clrx( Register s1, Register s2) { stx( G0, s1, s2 ); } |
|
849 |
||
850 |
inline void MacroAssembler::clrb( Register s1, int simm13a) { stb( G0, s1, simm13a); } |
|
851 |
inline void MacroAssembler::clrh( Register s1, int simm13a) { sth( G0, s1, simm13a); } |
|
852 |
inline void MacroAssembler::clr( Register s1, int simm13a) { stw( G0, s1, simm13a); } |
|
853 |
inline void MacroAssembler::clrx( Register s1, int simm13a) { stx( G0, s1, simm13a); } |
|
854 |
||
855 |
// returns if membar generates anything, obviously this code should mirror |
|
856 |
// membar below. |
|
857 |
inline bool MacroAssembler::membar_has_effect( Membar_mask_bits const7a ) { |
|
858 |
if( !os::is_MP() ) return false; // Not needed on single CPU |
|
859 |
if( VM_Version::v9_instructions_work() ) { |
|
860 |
const Membar_mask_bits effective_mask = |
|
861 |
Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); |
|
862 |
return (effective_mask != 0); |
|
863 |
} else { |
|
864 |
return true; |
|
865 |
} |
|
866 |
} |
|
867 |
||
868 |
inline void MacroAssembler::membar( Membar_mask_bits const7a ) { |
|
869 |
// Uniprocessors do not need memory barriers |
|
870 |
if (!os::is_MP()) return; |
|
871 |
// Weakened for current Sparcs and TSO. See the v9 manual, sections 8.4.3, |
|
872 |
// 8.4.4.3, a.31 and a.50. |
|
873 |
if( VM_Version::v9_instructions_work() ) { |
|
874 |
// Under TSO, setting bit 3, 2, or 0 is redundant, so the only value |
|
875 |
// of the mmask subfield of const7a that does anything that isn't done |
|
876 |
// implicitly is StoreLoad. |
|
877 |
const Membar_mask_bits effective_mask = |
|
878 |
Membar_mask_bits(const7a & ~(LoadLoad | LoadStore | StoreStore)); |
|
879 |
if ( effective_mask != 0 ) { |
|
880 |
Assembler::membar( effective_mask ); |
|
881 |
} |
|
882 |
} else { |
|
883 |
// stbar is the closest there is on v8. Equivalent to membar(StoreStore). We |
|
884 |
// do not issue the stbar because to my knowledge all v8 machines implement TSO, |
|
885 |
// which guarantees that all stores behave as if an stbar were issued just after |
|
886 |
// each one of them. On these machines, stbar ought to be a nop. There doesn't |
|
887 |
// appear to be an equivalent of membar(StoreLoad) on v8: TSO doesn't require it, |
|
888 |
// it can't be specified by stbar, nor have I come up with a way to simulate it. |
|
889 |
// |
|
890 |
// Addendum. Dave says that ldstub guarantees a write buffer flush to coherent |
|
891 |
// space. Put one here to be on the safe side. |
|
892 |
Assembler::ldstub(SP, 0, G0); |
|
893 |
} |
|
894 |
} |
|
7397 | 895 |
|
896 |
#endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP |