// Do not rely on add2reg* emitter. // Depending on CmdLine switches and actual parameter values, // the generated code may alter the condition code, which is counter-intuitive // to the semantics of the "load address" (LA/LAY) instruction. // Generic address loading d <- base(a) + index(a) + disp(a) inline void MacroAssembler::load_address(Register d, const Address &a) { if (Displacement::is_shortDisp(a.disp())) { z_la(d, a.disp(), a.indexOrR0(), a.baseOrR0()); } else if (Displacement::is_validDisp(a.disp())) { z_lay(d, a.disp(), a.indexOrR0(), a.baseOrR0()); } else { guarantee(false, "displacement = " SIZE_FORMAT_HEX ", out of range for LA/LAY", a.disp()); } }
// *((int8_t*)(dst)) |= imm8 inline void MacroAssembler::or2mem_8(Address& dst, int64_t imm8) { if (Displacement::is_shortDisp(dst.disp())) { z_oi(dst, imm8); } else { z_oiy(dst, imm8); } }
inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset) { relocate(a.rspec(offset)); if (a.has_index()) { assert(offset == 0, ""); ldf(w, a.base(), a.index(), d); } else { ldf(w, a.base(), a.disp() + offset, d); } }
inline void MacroAssembler::swap(const Address& a, Register d, int offset) { relocate(a.rspec(offset)); if (a.has_index()) { assert(offset == 0, ""); swap(a.base(), a.index(), d ); } else { swap(a.base(), a.disp() + offset, d); } }
inline void MacroAssembler::stx(Register d, const Address& a, int offset) { if (a.has_index()) { assert(offset == 0, ""); stx(d, a.base(), a.index() ); } else { stx(d, a.base(), a.disp() + offset); } }
inline void MacroAssembler::prefetch(const Address& a, PrefetchFcn f, int offset) { relocate(a.rspec(offset)); assert(!a.has_index(), ""); prefetch(a.base(), a.disp() + offset, f); }
inline void MacroAssembler::ldx( const Address& a, Register d, int offset) { if (a.has_index()) { assert(offset == 0, ""); ldx( a.base(), a.index(), d); } else { ldx( a.base(), a.disp() + offset, d); } }
// form effective addresses this way: inline void MacroAssembler::add(const Address& a, Register d, int offset) { if (a.has_index()) add(a.base(), a.index(), d); else { add(a.base(), a.disp() + offset, d, a.rspec(offset)); offset = 0; } if (offset != 0) add(d, offset, d); }