43 #include "md-trap.hpp"
48 #define DEBUG_NAME "compiler2/aarch64"
55 using namespace aarch64;
63 template <
class I,
class Seg>
64 static void write_data(Seg seg,
I data) {
65 assert(seg.size() ==
sizeof(
I));
67 for (
int i = 0,
e =
sizeof(
I) ;
i <
e ; ++
i) {
68 seg[
i] = (
u1) 0xff & *(reinterpret_cast<u1*>(&data) +
i);
104 write_data<float>(data, imm);
117 write_data<double>(data, imm);
154 ABORT_MSG(
"aarch64: Move not implemented",
155 "Inst: " << src <<
" -> " << dst <<
" type: " << type);
166 template <
unsigned size,
class T>
167 inline T align_to(T val) {
169 return val + ( rem == 0 ? 0 :
size - rem);
210 ABORT_MSG(
"aarch64 type not supported: ", I <<
" type: " << type);
228 if (!is_floatingpoint(type)) {
229 ABORT_MSG(
"aarch64: Lowering not supported",
230 "Inst: " << I <<
" type: " << type);
307 ABORT_MSG(
"aarch64 Conditional not supported: ", I <<
"cond: "
319 ABORT_MSG(
"aarch64: Lowering not supported",
320 "Inst: " << I <<
" type: " << type);
343 ABORT_MSG(
"aarch64: Lowering not supported",
344 "Inst: " << I <<
" type: " << type);
354 assert(src_op1->
is_Register() && src_op2->is_Register());
372 ABORT_MSG(
"aarch64: Lowering not supported",
373 "Inst: " << I <<
" type: " << type);
395 ABORT_MSG(
"aarch64: Lowering not supported",
396 "Inst: " << I <<
" type: " << type);
423 ABORT_MSG(
"aarch64: Lowering not supported",
424 "Inst: " << I <<
" type: " << type);
451 ABORT_MSG(
"aarch64: Lowering not supported",
452 "Inst: " << I <<
" type: " << type);
479 ABORT_MSG(
"aarch64: Lowering not supported",
480 "Inst: " << I <<
" type: " << type);
502 SrcOp(dividend), type);
509 ABORT_MSG(
"aarch64: Lowering not supported",
510 "Inst: " << I <<
" type: " << type);
564 ABORT_MSG(
"aarch64 Lowering not supported",
565 "Inst: " << I <<
" type: " << type);
627 ABORT_MSG(
"aarch64 Lowering not supported",
628 "Inst: " << I <<
" type: " << type);
717 ABORT_MSG(
"aarch64: Lowering not supported",
718 "Inst: " << I <<
" type: " << type);
724 set_op(I, mov->get_result().op);
771 SrcOp(src_op), from);
780 SrcOp(src_op), from);
853 ABORT_MSG(
"aarch64: Cast not supported!",
"From " << from <<
" to " << to );
881 ABORT_MSG(
"x86_64 Lowering not supported",
882 "Inst: " << I <<
" type: " << type);
889 for (std::size_t
i = 0;
i < I->
op_size(); ++
i ) {
907 assert(source_state);
961 int32_t
s2 =
sizeof(
methodptr) * (callee - callee->clazz->methods);
993 visit(static_cast<INVOKEInst*>(I), copyOperands);
997 visit(static_cast<INVOKEInst*>(I), copyOperands);
1001 visit(static_cast<INVOKEInst*>(I), copyOperands);
1005 visit(static_cast<INVOKEInst*>(I), copyOperands);
1009 visit(static_cast<INVOKEInst*>(I), copyOperands);
1026 set_op(I, read_field->get_result().op);
1043 set_op(I, write_field->get_result().op);
1089 if (*i < 0 || *i > 4095) {
1128 ABORT_MSG(
"aarch64: Lowering not supported",
1129 "Inst: " << I <<
" type: " << type);
1144 assert(source_state);
1157 << ruleId <<
" is not supported by method lowerComplex!");
void set_op(Instruction *I, MachineOperand *op) const
BeginInstRef & get_else_target()
static const COND EQ
Equal (Z == 1)
void set_current(MachineBasicBlock *MBB)
virtual MachineInstruction * create_Move(MachineOperand *src, MachineOperand *dst) const =0
bool is_stackslot() const
ConstTag< DataSegmentType, float, FloatID > DSFloat
virtual BUILTINInst * to_BUILTINInst()
static const COND GE
Signed greater than or equal (N == V)
Value * get_operand(size_t i)
virtual Instruction * to_Instruction()
SourceStateInst * get_source_state() const
Get the SourceStateInst that corresponds to this Instruction.
virtual MachineInstruction * create_Jump(MachineBasicBlock *target) const
PointerTag< DataSegmentType, constant_FMIref, FMIRefID > DSFMIRef
static const COND NE
Not equal (Z == 0)
const MethodDescriptor & get_MethodDescriptor() const
Get the MethodDescriptor.
fieldinfo * get_field() const
Get the accessed field.
Write a value to a static field.
virtual void lowerComplex(Instruction *I, int ruleId)
Type::TypeID get_type() const
get the value type of the instruction
MatchTy::iterator match_iterator
u4 get_frame_size() const
Get the value of an object's field.
Base type of instruction that perform a method invocation.
Load a value from an array.
static const COND GT
Signed greater then (Z == 0 && N == V)
A basic block of (scheduled) machine instructions.
virtual void create_frame(CodeMemory *CM, StackSlotManager *SSM) const
virtual INVOKESTATICInst * to_INVOKESTATICInst()
bool is_StackSlot() const
Invoke an interface method.
Transfers execution back to an unoptimized version of the method.
Get the value of a static field.
union constant_FMIref::@26 p
StackSlotManager * get_StackSlotManager()
Write a value to an object's field.
static const COND CC
Carry clear (C == 0)
Perform a bounds-check for an array-access.
void set_operand(std::size_t i, MachineOperand *op)
virtual void visit(LOADInst *I, bool copyOperands)
JNIEnv jthread jobject jclass jlong size
Represents an explicit null-check on an object reference.
static const COND LT
Signed less then (N != V)
Store a value into an array.
static bool is_invalid(IdxTy idx)
is invalid index
This stores a reference to a BeginInst.
ManagedStackSlot * create_argument_slot(Type::TypeID type, u4 index)
Create a ManagedStackSlot for an invocation argument.
constant_FMIref * get_fmiref() const
Get information about the method to invoke.
GPRegister R9("R9", 9, 9 *8, 8)
SuccessorListTy::const_iterator succ_end() const
void push_back(MachineInstruction *value)
Appends the given element value to the end of the container.
Instruction::InstID tmp[]
FPRegister V0("V0", 0, 0 *16, 16)
Invoke an instance method with special handling.
Provides a mapping from HIR values to baseline IR variables.
Conditional::CondID get_condition() const
Get the kind of condition that is computed.
CodeMemory * get_CodeMemory()
CodeMemory * get_CodeMemory() const
Get containing CodeMemory.
u1 * get_address() const
Get the pointer to the function that implements the builtin functionality.
#define UNIMPLEMENTED_MSG(EXPR_LONG)
void push_front(MachineInstruction *value)
inserts value to the beginning
Specialication for INVOKESpecial and INVOKEStatic.
IdxTy insert_tag(SegmentTag< Tag > *tag, IdxTy o)
insert tag
SuccessorListTy::const_iterator succ_begin() const
MethodDescriptor & get_MethodDescriptor()
Get the MethodDescriptor of the method to invoke.
virtual const char * get_name() const
IdxTy get_index(Tag2 tag) const
get the index of a tag
virtual MachineInstruction * create_Move(MachineOperand *src, MachineOperand *dst) const
virtual Immediate * to_Immediate()
SuccessorListTy::const_iterator succ_const_iterator
static const COND HI
Unsigned higher (C == 1 && Z == 0)
Get the length of an array.
match_iterator match_end()
GPRegister R0("R0", 0, 0 *8, 8)
Backend * get_Backend() const
Proxy to encode explicit and implicit successors.
virtual SourceStateInst * get_SourceStateInst() const
Method * get_Method() const
MachineBasicBlock * get_current() const
Type::TypeID get_type() const
void lower_source_state_dependencies(MachineReplacementPointInst *MI, SourceStateInst *source_state)
Represents a replacement point at a call site (INVOKE* ICMDs) The reference to the corresponding call...
Operands that can be directly used by the machine (register, memory, stackslot)
const MachineOperandDesc & get_result() const
aarch64::NativeRegister NativeRegister
unsigned get_index() const
The index of the argument is represented by this LOADInst.
bool is_ManagedStackSlot() const
virtual INVOKESPECIALInst * to_INVOKESPECIALInst()
GPRegister R18("R18", 18, 18 *8, 8)
void insert_pred(MachineBasicBlock *value)
Appends the given element value to the list of predecessors.
ConstTag< DataSegmentType, double, DoubleID > DSDouble
MachineBasicBlock * new_block() const
static const COND LE
Signed less than or equal (!(Z == 0 && N == V))
MachineOperand * get_op(Instruction *I) const
#define ABORT_MSG(EXPR_SHORT, EXPR_LONG)
BeginInstRef & get_then_target()
void place_deoptimization_marker(SourceStateAwareInst *I)
JITData * get_JITData() const
Ref get_Ref(std::size_t t)
get a new reference to the segment
virtual INVOKEVIRTUALInst * to_INVOKEVIRTUALInst()
virtual INVOKEINTERFACEInst * to_INVOKEINTERFACEInst()
bool is_Immediate() const
match_iterator match_begin()
A LOADInst represents an argument that is passed to the current method.
const DataSegment & get_DataSegment() const
get DataSegment
FloatHandling get_FloatHandling() const
Invoke an instance method.
Return from the current method.
s4 get_source_location() const
MethodDescriptor TODO: more info.