Commit 2806dd78 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [liftoff][wasm-simd] Specify alignment requirements

Port 57168634

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.

R=zhin@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Ic61ba7508d37971a04fddad9e25025d038fdc3bd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1994181Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#65706}
parent 193c08ad
......@@ -65,7 +65,22 @@ void LiftoffAssembler::FinishCode() { EmitConstantPool(); }
void LiftoffAssembler::AbortCompilation() { FinishCode(); }
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,
......
......@@ -64,7 +64,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