Commit 82f52fa9 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips][liftoff][wasm-simd] Specify alignment requirements

port 57168634 https://crrev.com/c/1974961

Original Commit Message:

  Declare an inline method for the various backends to define based on
  alignment requirements. That way backends that might take a performance
  hit when data is not naturally aligned can specify the requirements.

  With this requirement defined, we can then specify that SIMD values
  require 16 bytes on the stack.

  This also opens up the possibility of storing 32-bit values in 32-bits,
  rather than the fixed kStackSlotSize.

Change-Id: I928fb74ccdd31393dd76bda1dc76c5dc0e32975e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1994368
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65716}
parent b9439f7a
......@@ -302,7 +302,22 @@ void LiftoffAssembler::FinishCode() {}
void LiftoffAssembler::AbortCompilation() {}
uint32_t LiftoffAssembler::SlotSizeForType(ValueType type) {
return kStackSlotSize;
switch (type) {
case kWasmS128:
return ValueTypes::ElementSizeInBytes(type);
default:
return kStackSlotSize;
}
}
bool LiftoffAssembler::NeedsAlignment(ValueType type) {
switch (type) {
case kWasmS128:
return true;
default:
// No alignment because all other types are kStackSlotSize.
return false;
}
}
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
......
......@@ -260,7 +260,22 @@ void LiftoffAssembler::FinishCode() {}
void LiftoffAssembler::AbortCompilation() {}
uint32_t LiftoffAssembler::SlotSizeForType(ValueType type) {
return kStackSlotSize;
switch (type) {
case kWasmS128:
return ValueTypes::ElementSizeInBytes(type);
default:
return kStackSlotSize;
}
}
bool LiftoffAssembler::NeedsAlignment(ValueType type) {
switch (type) {
case kWasmS128:
return true;
default:
// No alignment because all other types are kStackSlotSize.
return false;
}
}
void LiftoffAssembler::LoadConstant(LiftoffRegister reg, WasmValue value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment