Commit ebb16c58 authored by Julian Seward's avatar Julian Seward
Browse files

Bug 1823857 - part 2: arm64 simulator: inline a couple of small routines that are hot. r=rhunt.

The routines are used for loads and stores, so this minor improvement is
widely applicable.  Reduces (host) instruction count by around 2% for
wasm-baseline generated arm64 code.

Depends on D173275

Differential Revision: https://phabricator.services.mozilla.com/D173276
parent 821290a1
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -206,21 +206,6 @@ double Instruction::ImmNEONFP64() const {
  return Imm8ToFP64(ImmNEONabcdefgh());
}


unsigned CalcLSDataSize(LoadStoreOp op) {
  VIXL_ASSERT((LSSize_offset + LSSize_width) == (kInstructionSize * 8));
  unsigned size = static_cast<Instr>(op) >> LSSize_offset;
  if ((op & LSVector_mask) != 0) {
    // Vector register memory operations encode the access size in the "size"
    // and "opc" fields.
    if ((size == 0) && ((op & LSOpc_mask) >> LSOpc_offset) >= 2) {
      size = kQRegSizeInBytesLog2;
    }
  }
  return size;
}


unsigned CalcLSPairDataSize(LoadStorePairOp op) {
  VIXL_STATIC_ASSERT(kXRegSizeInBytes == kDRegSizeInBytes);
  VIXL_STATIC_ASSERT(kWRegSizeInBytes == kSRegSizeInBytes);
+13 −1
Original line number Diff line number Diff line
@@ -104,7 +104,19 @@ const uint64_t kAddressTagMask =
    ((UINT64_C(1) << kAddressTagWidth) - 1) << kAddressTagOffset;
VIXL_STATIC_ASSERT(kAddressTagMask == UINT64_C(0xff00000000000000));

unsigned CalcLSDataSize(LoadStoreOp op);
static inline unsigned CalcLSDataSize(LoadStoreOp op) {
  VIXL_ASSERT((LSSize_offset + LSSize_width) == (kInstructionSize * 8));
  unsigned size = static_cast<Instr>(op) >> LSSize_offset;
  if ((op & LSVector_mask) != 0) {
    // Vector register memory operations encode the access size in the "size"
    // and "opc" fields.
    if ((size == 0) && ((op & LSOpc_mask) >> LSOpc_offset) >= 2) {
      size = kQRegSizeInBytesLog2;
    }
  }
  return size;
}

unsigned CalcLSPairDataSize(LoadStorePairOp op);

enum ImmBranchType {
+3 −3
Original line number Diff line number Diff line
@@ -988,13 +988,13 @@ class Simulator : public DecoderVisitor {
  void PrintWrittenVRegisters();

  // As above, but respect LOG_REG and LOG_VREG.
  void LogWrittenRegisters() {
  inline void LogWrittenRegisters() {
    if (trace_parameters() & LOG_REGS) PrintWrittenRegisters();
  }
  void LogWrittenVRegisters() {
  inline void LogWrittenVRegisters() {
    if (trace_parameters() & LOG_VREGS) PrintWrittenVRegisters();
  }
  void LogAllWrittenRegisters() {
  inline void LogAllWrittenRegisters() {
    LogWrittenRegisters();
    LogWrittenVRegisters();
  }