comparison src/cpu/sparc/vm/nativeInst_sparc.hpp @ 7204:f0c2369fda5a

8003250: SPARC: move MacroAssembler into separate file Reviewed-by: jrose, kvn
author twisti
date Thu, 06 Dec 2012 09:57:41 -0800
parents da91efe96a93
children 46c544b8fbfc
comparison
equal deleted inserted replaced
7201:c5d414e98fd4 7204:f0c2369fda5a
23 */ 23 */
24 24
25 #ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP 25 #ifndef CPU_SPARC_VM_NATIVEINST_SPARC_HPP
26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP 26 #define CPU_SPARC_VM_NATIVEINST_SPARC_HPP
27 27
28 #include "asm/assembler.hpp" 28 #include "asm/macroAssembler.hpp"
29 #include "memory/allocation.hpp" 29 #include "memory/allocation.hpp"
30 #include "runtime/icache.hpp" 30 #include "runtime/icache.hpp"
31 #include "runtime/os.hpp" 31 #include "runtime/os.hpp"
32 #include "utilities/top.hpp" 32 #include "utilities/top.hpp"
33 33
192 static int inv_op3( int x ) { return Assembler::inv_op3(x); } 192 static int inv_op3( int x ) { return Assembler::inv_op3(x); }
193 193
194 static int inv_simm( int x, int nbits ) { return Assembler::inv_simm(x, nbits); } 194 static int inv_simm( int x, int nbits ) { return Assembler::inv_simm(x, nbits); }
195 static intptr_t inv_wdisp( int x, int nbits ) { return Assembler::inv_wdisp( x, 0, nbits); } 195 static intptr_t inv_wdisp( int x, int nbits ) { return Assembler::inv_wdisp( x, 0, nbits); }
196 static intptr_t inv_wdisp16( int x ) { return Assembler::inv_wdisp16(x, 0); } 196 static intptr_t inv_wdisp16( int x ) { return Assembler::inv_wdisp16(x, 0); }
197 static int branch_destination_offset(int x) { return Assembler::branch_destination(x, 0); } 197 static int branch_destination_offset(int x) { return MacroAssembler::branch_destination(x, 0); }
198 static int patch_branch_destination_offset(int dest_offset, int x) { 198 static int patch_branch_destination_offset(int dest_offset, int x) {
199 return Assembler::patched_branch(dest_offset, x, 0); 199 return MacroAssembler::patched_branch(dest_offset, x, 0);
200 } 200 }
201 void set_annul_bit() { set_long_at(0, long_at(0) | Assembler::annul(true)); }
202 201
203 // utility for checking if x is either of 2 small constants 202 // utility for checking if x is either of 2 small constants
204 static bool is_either(int x, int k1, int k2) { 203 static bool is_either(int x, int k1, int k2) {
205 // return x == k1 || x == k2; 204 // return x == k1 || x == k2;
206 return (1 << x) & (1 << k1 | 1 << k2); 205 return (1 << x) & (1 << k1 | 1 << k2);
887 address jump_destination() const { return addr_at(0) + branch_destination_offset(long_at(0)); } 886 address jump_destination() const { return addr_at(0) + branch_destination_offset(long_at(0)); }
888 void set_jump_destination(address dest) { 887 void set_jump_destination(address dest) {
889 int patched_instr = patch_branch_destination_offset(dest - addr_at(0), long_at(0)); 888 int patched_instr = patch_branch_destination_offset(dest - addr_at(0), long_at(0));
890 set_long_at(0, patched_instr); 889 set_long_at(0, patched_instr);
891 } 890 }
892 void set_annul() { set_annul_bit(); }
893 NativeInstruction *delay_slot_instr() { return nativeInstruction_at(addr_at(4));} 891 NativeInstruction *delay_slot_instr() { return nativeInstruction_at(addr_at(4));}
894 void fill_delay_slot(int instr) { set_long_at(4, instr);} 892 void fill_delay_slot(int instr) { set_long_at(4, instr);}
895 Assembler::Condition condition() { 893 Assembler::Condition condition() {
896 int x = long_at(0); 894 int x = long_at(0);
897 return (Assembler::Condition) Assembler::inv_cond(x); 895 return (Assembler::Condition) Assembler::inv_cond(x);