// This `#include` should never be used by compilation, as this file (`nodes_shared.h`) is included // in `nodes.h`. However it helps editing tools (e.g. YouCompleteMe) by giving them better context // (defining `HInstruction` and co). #include"nodes.h"
private: // Indicates if this is a MADD or MSUB. const InstructionKind op_kind_;
};
// This instruction computes part of the array access offset (data and index offset). // // For array accesses the element address has the following structure: // Address = CONST_OFFSET + base_addr + index << ELEM_SHIFT. Taking into account LDR/STR addressing // modes address part (CONST_OFFSET + index << ELEM_SHIFT) can be shared across array access with // the same data type and index. For example, for the following loop 5 accesses can share address // computation: // // void foo(int[] a, int[] b, int[] c) { // for (i...) { // a[i] = a[i] + 5; // b[i] = b[i] + c[i]; // } // } // // Note: as the instruction doesn't involve base array address into computations it has no side // effects (in comparison of HIntermediateAddress). class HIntermediateAddressIndex final : public HExpression<3> { public:
HIntermediateAddressIndex(
HInstruction* index, HInstruction* offset, HInstruction* shift, uint32_t dex_pc)
: HExpression(kIntermediateAddressIndex,
DataType::Type::kInt32,
SideEffects::None(),
dex_pc) {
SetRawInputAt(0, index);
SetRawInputAt(1, offset);
SetRawInputAt(2, shift);
}
class HDataProcWithShifterOp final : public HExpression<2> { public: enum OpKind {
kLSL, // Logical shift left.
kLSR, // Logical shift right.
kASR, // Arithmetic shift right.
kUXTB, // Unsigned extend byte.
kUXTH, // Unsigned extend half-word.
kUXTW, // Unsigned extend word.
kSXTB, // Signed extend byte.
kSXTH, // Signed extend half-word.
kSXTW, // Signed extend word.
// Aliases.
kFirstShiftOp = kLSL,
kLastShiftOp = kASR,
kFirstExtensionOp = kUXTB,
kLastExtensionOp = kSXTW
};
HDataProcWithShifterOp(HInstruction* instr,
HInstruction* left,
HInstruction* right,
OpKind op, // The shift argument is unused if the operation // is an extension. int shift = 0,
uint32_t dex_pc = kNoDexPc)
: HExpression(kDataProcWithShifterOp, instr->GetType(), SideEffects::None(), dex_pc),
instr_kind_(instr->GetKind()), op_kind_(op),
shift_amount_(shift & (instr->GetType() == DataType::Type::kInt32
? kMaxIntShiftDistance
: kMaxLongShiftDistance)) {
DCHECK(!instr->HasSideEffects()); // LSL #0 is used for type conversion to `long` but ASR and LSR should not shift by 0. // On ARM, encodings with immediate 0 represent ASR #32 and LSR #32.
DCHECK_IMPLIES(op == kASR || op == kLSR, shift != 0);
SetRawInputAt(0, left);
SetRawInputAt(1, right);
}
// Find the operation kind and shift amount from a bitfield move instruction. staticvoid GetOpInfoFromInstruction(HInstruction* bitfield_op, /*out*/OpKind* op_kind, /*out*/int* shift_amount);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.