PPC/s390: [codegen] Change RegList into a class
Port 8a0d1b6fe5
Original Commit Message:
Modernise the RegList interface to be a proper class, rather than a
typedef to an integer, and add proper methods onto it rather than ad-hoc
bit manipulation.
In particular, this makes RegList typesafe, adding a DoubleRegList for
DoubleRegisters.
The Arm64 CPURegList isn't updated to use (or extend) the new RegList
interface, because of its weird type-erasing semantics (it can store
Registers and VRegisters). Maybe in the future we'll want to get rid of
CPURegList entirely and use RegList/DoubleRegList directly.
R=leszeks@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: I997156fe4f4f2ccc40b2631d5cb752efdc8a5ad2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3525084
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79484}
This commit is contained in:
parent
e7eac72803
commit
46cd6c8bb4
@ -2475,13 +2475,13 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
gp_regs.set(gp_param_reg);
|
||||
}
|
||||
|
||||
RegList fp_regs;
|
||||
DoubleRegList fp_regs;
|
||||
for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
|
||||
fp_regs.set(fp_param_reg);
|
||||
}
|
||||
|
||||
// List must match register numbers under kFpParamRegisters.
|
||||
constexpr RegList simd_regs = {v1, v2, v3, v4, v5, v6, v7, v8};
|
||||
constexpr Simd128RegList simd_regs = {v1, v2, v3, v4, v5, v6, v7, v8};
|
||||
|
||||
CHECK_EQ(gp_regs.Count(), arraysize(wasm::kGpParamRegisters));
|
||||
CHECK_EQ(fp_regs.Count(), arraysize(wasm::kFpParamRegisters));
|
||||
@ -2523,7 +2523,7 @@ void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
|
||||
// them after the runtime call.
|
||||
__ MultiPush(WasmDebugBreakFrameConstants::kPushedGpRegs);
|
||||
__ MultiPushF64AndV128(WasmDebugBreakFrameConstants::kPushedFpRegs,
|
||||
WasmDebugBreakFrameConstants::kPushedFpRegs);
|
||||
WasmDebugBreakFrameConstants::kPushedSimd128Regs);
|
||||
|
||||
// Initialize the JavaScript context with 0. CEntry will use it to
|
||||
// set the current context on the isolate.
|
||||
@ -2532,7 +2532,7 @@ void Builtins::Generate_WasmDebugBreak(MacroAssembler* masm) {
|
||||
|
||||
// Restore registers.
|
||||
__ MultiPopF64AndV128(WasmDebugBreakFrameConstants::kPushedFpRegs,
|
||||
WasmDebugBreakFrameConstants::kPushedFpRegs);
|
||||
WasmDebugBreakFrameConstants::kPushedSimd128Regs);
|
||||
__ MultiPop(WasmDebugBreakFrameConstants::kPushedGpRegs);
|
||||
}
|
||||
__ Ret();
|
||||
@ -3263,7 +3263,7 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
|
||||
// Leave gaps for other registers.
|
||||
__ subi(sp, sp, Operand(kNumberOfRegisters * kSystemPointerSize));
|
||||
for (int16_t i = kNumberOfRegisters - 1; i >= 0; i--) {
|
||||
if ((saved_regs & (1 << i)) != 0) {
|
||||
if ((saved_regs.bits() & (1 << i)) != 0) {
|
||||
__ StoreU64(ToRegister(i), MemOperand(sp, kSystemPointerSize * i));
|
||||
}
|
||||
}
|
||||
@ -3433,7 +3433,7 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
|
||||
for (int i = kNumberOfRegisters - 1; i >= 0; i--) {
|
||||
int offset =
|
||||
(i * kSystemPointerSize) + FrameDescription::registers_offset();
|
||||
if ((restored_regs & (1 << i)) != 0) {
|
||||
if ((restored_regs.bits() & (1 << i)) != 0) {
|
||||
__ LoadU64(ToRegister(i), MemOperand(scratch, offset));
|
||||
}
|
||||
}
|
||||
|
@ -2904,7 +2904,7 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
|
||||
gp_regs.set(gp_param_reg);
|
||||
}
|
||||
|
||||
RegList fp_regs;
|
||||
DoubleRegList fp_regs;
|
||||
for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
|
||||
fp_regs.set(fp_param_reg);
|
||||
}
|
||||
@ -3820,7 +3820,7 @@ void Generate_DeoptimizationEntry(MacroAssembler* masm,
|
||||
for (int i = kNumberOfRegisters - 1; i > 0; i--) {
|
||||
int offset =
|
||||
(i * kSystemPointerSize) + FrameDescription::registers_offset();
|
||||
if ((restored_regs & (1 << i)) != 0) {
|
||||
if ((restored_regs.bits() & (1 << i)) != 0) {
|
||||
__ LoadU64(ToRegister(i), MemOperand(r1, offset));
|
||||
}
|
||||
}
|
||||
|
@ -2109,7 +2109,7 @@ UseScratchRegisterScope::~UseScratchRegisterScope() {
|
||||
Register UseScratchRegisterScope::Acquire() {
|
||||
RegList* available = assembler_->GetScratchRegisterList();
|
||||
DCHECK_NOT_NULL(available);
|
||||
return available->PopFront();
|
||||
return available->PopFirst();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
@ -1513,7 +1513,9 @@ class V8_EXPORT_PRIVATE V8_NODISCARD UseScratchRegisterScope {
|
||||
Register Acquire();
|
||||
|
||||
// Check if we have registers available to acquire.
|
||||
bool CanAcquire() const { return *assembler_->GetScratchRegisterList() != 0; }
|
||||
bool CanAcquire() const {
|
||||
return !assembler_->GetScratchRegisterList()->is_empty();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Assembler;
|
||||
|
@ -38,7 +38,7 @@ void StaticCallInterfaceDescriptor<DerivedDescriptor>::
|
||||
|
||||
// static
|
||||
constexpr auto WriteBarrierDescriptor::registers() {
|
||||
return RegisterArray(r4, r8, r7, r5, r3);
|
||||
return RegisterArray(r4, r8, r7, r5, r3, r6, kContextRegister);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -80,7 +80,7 @@ int TurboAssembler::PushCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
bytes += list.Count() * kSystemPointerSize;
|
||||
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPushF64AndV128(kCallerSavedDoubles, kCallerSavedDoubles);
|
||||
MultiPushF64AndV128(kCallerSavedDoubles, kCallerSavedSimd128s);
|
||||
bytes += kStackSavedSavedFPSizeInBytes;
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ int TurboAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, Register exclusion1,
|
||||
Register exclusion2, Register exclusion3) {
|
||||
int bytes = 0;
|
||||
if (fp_mode == SaveFPRegsMode::kSave) {
|
||||
MultiPopF64AndV128(kCallerSavedDoubles, kCallerSavedDoubles);
|
||||
MultiPopF64AndV128(kCallerSavedDoubles, kCallerSavedSimd128s);
|
||||
bytes += kStackSavedSavedFPSizeInBytes;
|
||||
}
|
||||
|
||||
@ -377,12 +377,12 @@ void TurboAssembler::Move(DoubleRegister dst, DoubleRegister src) {
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPush(RegList regs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(regs);
|
||||
int16_t num_to_push = regs.Count();
|
||||
int16_t stack_offset = num_to_push * kSystemPointerSize;
|
||||
|
||||
subi(location, location, Operand(stack_offset));
|
||||
for (int16_t i = Register::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((regs & (1 << i)) != 0) {
|
||||
if ((regs.bits() & (1 << i)) != 0) {
|
||||
stack_offset -= kSystemPointerSize;
|
||||
StoreU64(ToRegister(i), MemOperand(location, stack_offset));
|
||||
}
|
||||
@ -393,7 +393,7 @@ void TurboAssembler::MultiPop(RegList regs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < Register::kNumRegisters; i++) {
|
||||
if ((regs & (1 << i)) != 0) {
|
||||
if ((regs.bits() & (1 << i)) != 0) {
|
||||
LoadU64(ToRegister(i), MemOperand(location, stack_offset));
|
||||
stack_offset += kSystemPointerSize;
|
||||
}
|
||||
@ -401,13 +401,13 @@ void TurboAssembler::MultiPop(RegList regs, Register location) {
|
||||
addi(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(dregs);
|
||||
void TurboAssembler::MultiPushDoubles(DoubleRegList dregs, Register location) {
|
||||
int16_t num_to_push = dregs.Count();
|
||||
int16_t stack_offset = num_to_push * kDoubleSize;
|
||||
|
||||
subi(location, location, Operand(stack_offset));
|
||||
for (int16_t i = DoubleRegister::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
DoubleRegister dreg = DoubleRegister::from_code(i);
|
||||
stack_offset -= kDoubleSize;
|
||||
stfd(dreg, MemOperand(location, stack_offset));
|
||||
@ -415,26 +415,27 @@ void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushV128(RegList dregs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(dregs);
|
||||
void TurboAssembler::MultiPushV128(Simd128RegList simd_regs,
|
||||
Register location) {
|
||||
int16_t num_to_push = simd_regs.Count();
|
||||
int16_t stack_offset = num_to_push * kSimd128Size;
|
||||
|
||||
subi(location, location, Operand(stack_offset));
|
||||
for (int16_t i = Simd128Register::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
Simd128Register dreg = Simd128Register::from_code(i);
|
||||
if ((simd_regs.bits() & (1 << i)) != 0) {
|
||||
Simd128Register simd_reg = Simd128Register::from_code(i);
|
||||
stack_offset -= kSimd128Size;
|
||||
li(ip, Operand(stack_offset));
|
||||
StoreSimd128(dreg, MemOperand(location, ip));
|
||||
StoreSimd128(simd_reg, MemOperand(location, ip));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPopDoubles(DoubleRegList dregs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < DoubleRegister::kNumRegisters; i++) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
DoubleRegister dreg = DoubleRegister::from_code(i);
|
||||
lfd(dreg, MemOperand(location, stack_offset));
|
||||
stack_offset += kDoubleSize;
|
||||
@ -443,21 +444,22 @@ void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
|
||||
addi(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopV128(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPopV128(Simd128RegList simd_regs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < Simd128Register::kNumRegisters; i++) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
Simd128Register dreg = Simd128Register::from_code(i);
|
||||
if ((simd_regs.bits() & (1 << i)) != 0) {
|
||||
Simd128Register simd_reg = Simd128Register::from_code(i);
|
||||
li(ip, Operand(stack_offset));
|
||||
LoadSimd128(dreg, MemOperand(location, ip));
|
||||
LoadSimd128(simd_reg, MemOperand(location, ip));
|
||||
stack_offset += kSimd128Size;
|
||||
}
|
||||
}
|
||||
addi(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushF64AndV128(RegList dregs, RegList simd_regs,
|
||||
void TurboAssembler::MultiPushF64AndV128(DoubleRegList dregs,
|
||||
Simd128RegList simd_regs,
|
||||
Register location) {
|
||||
MultiPushDoubles(dregs);
|
||||
#if V8_ENABLE_WEBASSEMBLY
|
||||
@ -492,7 +494,8 @@ void TurboAssembler::MultiPushF64AndV128(RegList dregs, RegList simd_regs,
|
||||
#endif
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopF64AndV128(RegList dregs, RegList simd_regs,
|
||||
void TurboAssembler::MultiPopF64AndV128(DoubleRegList dregs,
|
||||
Simd128RegList simd_regs,
|
||||
Register location) {
|
||||
#if V8_ENABLE_WEBASSEMBLY
|
||||
bool generating_bultins =
|
||||
|
@ -557,15 +557,15 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
void MultiPush(RegList regs, Register location = sp);
|
||||
void MultiPop(RegList regs, Register location = sp);
|
||||
|
||||
void MultiPushDoubles(RegList dregs, Register location = sp);
|
||||
void MultiPopDoubles(RegList dregs, Register location = sp);
|
||||
void MultiPushDoubles(DoubleRegList dregs, Register location = sp);
|
||||
void MultiPopDoubles(DoubleRegList dregs, Register location = sp);
|
||||
|
||||
void MultiPushV128(RegList dregs, Register location = sp);
|
||||
void MultiPopV128(RegList dregs, Register location = sp);
|
||||
void MultiPushV128(Simd128RegList dregs, Register location = sp);
|
||||
void MultiPopV128(Simd128RegList dregs, Register location = sp);
|
||||
|
||||
void MultiPushF64AndV128(RegList dregs, RegList simd_regs,
|
||||
void MultiPushF64AndV128(DoubleRegList dregs, Simd128RegList simd_regs,
|
||||
Register location = sp);
|
||||
void MultiPopF64AndV128(RegList dregs, RegList simd_regs,
|
||||
void MultiPopF64AndV128(DoubleRegList dregs, Simd128RegList simd_regs,
|
||||
Register location = sp);
|
||||
|
||||
// Calculate how much stack space (in bytes) are required to store caller
|
||||
|
@ -60,8 +60,6 @@ namespace internal {
|
||||
V(cr8) V(cr9) V(cr10) V(cr11) V(cr12) V(cr15)
|
||||
// clang-format on
|
||||
|
||||
const int kNumCalleeSavedDoubles = 18;
|
||||
|
||||
// The following constants describe the stack frame linkage area as
|
||||
// defined by the ABI. Note that kNumRequiredStackFrameSlots must
|
||||
// satisfy alignment requirements (rounding up if required).
|
||||
|
@ -13,6 +13,7 @@ namespace internal {
|
||||
|
||||
using RegList = RegListBase<Register>;
|
||||
using DoubleRegList = RegListBase<DoubleRegister>;
|
||||
using Simd128RegList = RegListBase<Simd128Register>;
|
||||
ASSERT_TRIVIALLY_COPYABLE(RegList);
|
||||
ASSERT_TRIVIALLY_COPYABLE(DoubleRegList);
|
||||
|
||||
@ -38,18 +39,21 @@ int JSCallerSavedCode(int n);
|
||||
|
||||
// Callee-saved registers preserved when switching from C to JavaScript
|
||||
const RegList kCalleeSaved = {r14, r15, r16, r17, r18, r19, r20, r21, r22,
|
||||
r23, r24, r25, r26, r27, r28, r29, r30, r31};
|
||||
r23, r24, r25, r26, r27, r28, r29, r30, fp};
|
||||
|
||||
const int kNumCalleeSaved = 18;
|
||||
|
||||
const RegList kCallerSavedDoubles = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12, d13};
|
||||
const DoubleRegList kCallerSavedDoubles = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12, d13};
|
||||
|
||||
const Simd128RegList kCallerSavedSimd128s = {v0, v1, v2, v3, v4, v5, v6,
|
||||
v7, v8, v9, v10, v11, v12, v13};
|
||||
|
||||
const int kNumCallerSavedDoubles = 14;
|
||||
|
||||
const RegList kCalleeSavedDoubles = {d14, d15, d16, d17, d18, d19,
|
||||
d20, d21, d22, d23, d24, d25,
|
||||
d26, d27, d28, d29, d30, d31};
|
||||
const DoubleRegList kCalleeSavedDoubles = {d14, d15, d16, d17, d18, d19,
|
||||
d20, d21, d22, d23, d24, d25,
|
||||
d26, d27, d28, d29, d30, d31};
|
||||
|
||||
const int kNumCalleeSavedDoubles = 18;
|
||||
|
||||
|
@ -884,7 +884,7 @@ UseScratchRegisterScope::~UseScratchRegisterScope() {
|
||||
Register UseScratchRegisterScope::Acquire() {
|
||||
RegList* available = assembler_->GetScratchRegisterList();
|
||||
DCHECK_NOT_NULL(available);
|
||||
return available->PopFront();
|
||||
return available->PopFirst();
|
||||
}
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
@ -1489,7 +1489,9 @@ class V8_EXPORT_PRIVATE V8_NODISCARD UseScratchRegisterScope {
|
||||
Register Acquire();
|
||||
|
||||
// Check if we have registers available to acquire.
|
||||
bool CanAcquire() const { return *assembler_->GetScratchRegisterList() != 0; }
|
||||
bool CanAcquire() const {
|
||||
return !assembler_->GetScratchRegisterList()->is_empty();
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Assembler;
|
||||
|
@ -38,7 +38,7 @@ void StaticCallInterfaceDescriptor<DerivedDescriptor>::
|
||||
|
||||
// static
|
||||
constexpr auto WriteBarrierDescriptor::registers() {
|
||||
return RegisterArray(r3, r7, r6, r4, r2);
|
||||
return RegisterArray(r3, r7, r6, r4, r2, r5, kContextRegister);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -629,12 +629,12 @@ void TurboAssembler::PushArray(Register array, Register size, Register scratch,
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPush(RegList regs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(regs);
|
||||
int16_t num_to_push = regs.Count();
|
||||
int16_t stack_offset = num_to_push * kSystemPointerSize;
|
||||
|
||||
SubS64(location, location, Operand(stack_offset));
|
||||
for (int16_t i = Register::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((regs & (1 << i)) != 0) {
|
||||
if ((regs.bits() & (1 << i)) != 0) {
|
||||
stack_offset -= kSystemPointerSize;
|
||||
StoreU64(ToRegister(i), MemOperand(location, stack_offset));
|
||||
}
|
||||
@ -645,7 +645,7 @@ void TurboAssembler::MultiPop(RegList regs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < Register::kNumRegisters; i++) {
|
||||
if ((regs & (1 << i)) != 0) {
|
||||
if ((regs.bits() & (1 << i)) != 0) {
|
||||
LoadU64(ToRegister(i), MemOperand(location, stack_offset));
|
||||
stack_offset += kSystemPointerSize;
|
||||
}
|
||||
@ -653,13 +653,13 @@ void TurboAssembler::MultiPop(RegList regs, Register location) {
|
||||
AddS64(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(dregs);
|
||||
void TurboAssembler::MultiPushDoubles(DoubleRegList dregs, Register location) {
|
||||
int16_t num_to_push = dregs.Count();
|
||||
int16_t stack_offset = num_to_push * kDoubleSize;
|
||||
|
||||
SubS64(location, location, Operand(stack_offset));
|
||||
for (int16_t i = DoubleRegister::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
DoubleRegister dreg = DoubleRegister::from_code(i);
|
||||
stack_offset -= kDoubleSize;
|
||||
StoreF64(dreg, MemOperand(location, stack_offset));
|
||||
@ -667,13 +667,13 @@ void TurboAssembler::MultiPushDoubles(RegList dregs, Register location) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushV128(RegList dregs, Register location) {
|
||||
int16_t num_to_push = base::bits::CountPopulation(dregs);
|
||||
void TurboAssembler::MultiPushV128(DoubleRegList dregs, Register location) {
|
||||
int16_t num_to_push = dregs.Count();
|
||||
int16_t stack_offset = num_to_push * kSimd128Size;
|
||||
|
||||
SubS64(location, location, Operand(stack_offset));
|
||||
for (int16_t i = Simd128Register::kNumRegisters - 1; i >= 0; i--) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
Simd128Register dreg = Simd128Register::from_code(i);
|
||||
stack_offset -= kSimd128Size;
|
||||
StoreV128(dreg, MemOperand(location, stack_offset), r0);
|
||||
@ -681,11 +681,11 @@ void TurboAssembler::MultiPushV128(RegList dregs, Register location) {
|
||||
}
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPopDoubles(DoubleRegList dregs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < DoubleRegister::kNumRegisters; i++) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
DoubleRegister dreg = DoubleRegister::from_code(i);
|
||||
LoadF64(dreg, MemOperand(location, stack_offset));
|
||||
stack_offset += kDoubleSize;
|
||||
@ -694,11 +694,11 @@ void TurboAssembler::MultiPopDoubles(RegList dregs, Register location) {
|
||||
AddS64(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopV128(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPopV128(DoubleRegList dregs, Register location) {
|
||||
int16_t stack_offset = 0;
|
||||
|
||||
for (int16_t i = 0; i < Simd128Register::kNumRegisters; i++) {
|
||||
if ((dregs & (1 << i)) != 0) {
|
||||
if ((dregs.bits() & (1 << i)) != 0) {
|
||||
Simd128Register dreg = Simd128Register::from_code(i);
|
||||
LoadV128(dreg, MemOperand(location, stack_offset), r0);
|
||||
stack_offset += kSimd128Size;
|
||||
@ -707,7 +707,8 @@ void TurboAssembler::MultiPopV128(RegList dregs, Register location) {
|
||||
AddS64(location, location, Operand(stack_offset));
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPushF64OrV128(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPushF64OrV128(DoubleRegList dregs,
|
||||
Register location) {
|
||||
#if V8_ENABLE_WEBASSEMBLY
|
||||
bool generating_bultins =
|
||||
isolate() && isolate()->IsGeneratingEmbeddedBuiltins();
|
||||
@ -740,7 +741,7 @@ void TurboAssembler::MultiPushF64OrV128(RegList dregs, Register location) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void TurboAssembler::MultiPopF64OrV128(RegList dregs, Register location) {
|
||||
void TurboAssembler::MultiPopF64OrV128(DoubleRegList dregs, Register location) {
|
||||
#if V8_ENABLE_WEBASSEMBLY
|
||||
bool generating_bultins =
|
||||
isolate() && isolate()->IsGeneratingEmbeddedBuiltins();
|
||||
|
@ -175,14 +175,14 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
|
||||
void MultiPush(RegList regs, Register location = sp);
|
||||
void MultiPop(RegList regs, Register location = sp);
|
||||
|
||||
void MultiPushDoubles(RegList dregs, Register location = sp);
|
||||
void MultiPopDoubles(RegList dregs, Register location = sp);
|
||||
void MultiPushDoubles(DoubleRegList dregs, Register location = sp);
|
||||
void MultiPopDoubles(DoubleRegList dregs, Register location = sp);
|
||||
|
||||
void MultiPushV128(RegList dregs, Register location = sp);
|
||||
void MultiPopV128(RegList dregs, Register location = sp);
|
||||
void MultiPushV128(DoubleRegList dregs, Register location = sp);
|
||||
void MultiPopV128(DoubleRegList dregs, Register location = sp);
|
||||
|
||||
void MultiPushF64OrV128(RegList dregs, Register location = sp);
|
||||
void MultiPopF64OrV128(RegList dregs, Register location = sp);
|
||||
void MultiPushF64OrV128(DoubleRegList dregs, Register location = sp);
|
||||
void MultiPopF64OrV128(DoubleRegList dregs, Register location = sp);
|
||||
|
||||
// Calculate how much stack space (in bytes) are required to store caller
|
||||
// registers excluding those specified in the arguments.
|
||||
|
@ -36,18 +36,19 @@ const RegList kCalleeSaved = {r6, // r6 (argument passing in CEntryStub)
|
||||
// (HandleScope logic in MacroAssembler)
|
||||
r9, // r9 (HandleScope logic in MacroAssembler)
|
||||
r10, // r10 (Roots register in Javascript)
|
||||
r11, // r11 (fp in Javascript)
|
||||
r12, // r12 (ip in Javascript)
|
||||
fp, // r11 (fp in Javascript)
|
||||
ip, // r12 (ip in Javascript)
|
||||
r13}; // r13 (cp in Javascript)
|
||||
// r15; // r15 (sp in Javascript)
|
||||
|
||||
const int kNumCalleeSaved = 8;
|
||||
|
||||
const RegList kCallerSavedDoubles = {d0, d1, d2, d3, d4, d5, d6, d7};
|
||||
const DoubleRegList kCallerSavedDoubles = {d0, d1, d2, d3, d4, d5, d6, d7};
|
||||
|
||||
const int kNumCallerSavedDoubles = 8;
|
||||
|
||||
const RegList kCalleeSavedDoubles = {d8, d9, d10, d11, d12, d13, d14, d15};
|
||||
const DoubleRegList kCalleeSavedDoubles = {d8, d9, d10, d11,
|
||||
d12, d13, d14, d15};
|
||||
|
||||
const int kNumCalleeSavedDoubles = 8;
|
||||
|
||||
|
@ -3986,10 +3986,9 @@ void CodeGenerator::FinishFrame(Frame* frame) {
|
||||
const DoubleRegList double_saves = call_descriptor->CalleeSavedFPRegisters();
|
||||
|
||||
// Save callee-saved Double registers.
|
||||
if (double_ !saves.is_empty()) {
|
||||
if (!double_saves.is_empty()) {
|
||||
frame->AlignSavedCalleeRegisterSlots();
|
||||
DCHECK_EQ(kNumCalleeSavedDoubles,
|
||||
base::bits::CountPopulation(double_saves));
|
||||
DCHECK_EQ(kNumCalleeSavedDoubles, double_saves.Count());
|
||||
frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
|
||||
(kDoubleSize / kSystemPointerSize));
|
||||
}
|
||||
@ -4155,7 +4154,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) {
|
||||
|
||||
// Restore double registers.
|
||||
const DoubleRegList double_saves = call_descriptor->CalleeSavedFPRegisters();
|
||||
if (double_ !saves.is_empty()) {
|
||||
if (!double_saves.is_empty()) {
|
||||
__ MultiPopDoubles(double_saves);
|
||||
}
|
||||
|
||||
|
@ -3362,10 +3362,9 @@ void CodeGenerator::FinishFrame(Frame* frame) {
|
||||
const DoubleRegList double_saves = call_descriptor->CalleeSavedFPRegisters();
|
||||
|
||||
// Save callee-saved Double registers.
|
||||
if (double_ !saves.is_empty()) {
|
||||
if (!double_saves.is_empty()) {
|
||||
frame->AlignSavedCalleeRegisterSlots();
|
||||
DCHECK_EQ(kNumCalleeSavedDoubles,
|
||||
base::bits::CountPopulation(double_saves));
|
||||
DCHECK_EQ(kNumCalleeSavedDoubles, double_saves.Count());
|
||||
frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
|
||||
(kDoubleSize / kSystemPointerSize));
|
||||
}
|
||||
@ -3513,7 +3512,7 @@ void CodeGenerator::AssembleReturn(InstructionOperand* additional_pop_count) {
|
||||
|
||||
// Restore double registers.
|
||||
const DoubleRegList double_saves = call_descriptor->CalleeSavedFPRegisters();
|
||||
if (double_ !saves.is_empty()) {
|
||||
if (!double_saves.is_empty()) {
|
||||
__ MultiPopDoubles(double_saves);
|
||||
}
|
||||
|
||||
|
@ -46,8 +46,11 @@ class WasmDebugBreakFrameConstants : public TypedFrameConstants {
|
||||
static constexpr RegList kPushedGpRegs = {r3, r4, r5, r6, r7,
|
||||
r8, r9, r10, r11, cp};
|
||||
|
||||
static constexpr RegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12};
|
||||
static constexpr DoubleRegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12};
|
||||
|
||||
static constexpr Simd128RegList kPushedSimd128Regs = {
|
||||
v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12};
|
||||
|
||||
static constexpr int kNumPushedGpRegisters = kPushedGpRegs.Count();
|
||||
static constexpr int kNumPushedFpRegisters = kPushedFpRegs.Count();
|
||||
|
@ -48,8 +48,8 @@ class WasmDebugBreakFrameConstants : public TypedFrameConstants {
|
||||
public:
|
||||
static constexpr RegList kPushedGpRegs = {r2, r3, r4, r5, r6, r7, r8, cp};
|
||||
|
||||
static constexpr RegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12};
|
||||
static constexpr DoubleRegList kPushedFpRegs = {d0, d1, d2, d3, d4, d5, d6,
|
||||
d7, d8, d9, d10, d11, d12};
|
||||
|
||||
static constexpr int kNumPushedGpRegisters = kPushedGpRegs.Count();
|
||||
static constexpr int kNumPushedFpRegisters = kPushedFpRegs.Count();
|
||||
|
@ -215,8 +215,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerPPC
|
||||
};
|
||||
|
||||
// Set of non-volatile registers saved/restored by generated regexp code.
|
||||
const RegList kRegExpCalleeSaved =
|
||||
1 << 25 | 1 << 26 | 1 << 27 | 1 << 28 | 1 << 29 | 1 << 30 | 1 << 31;
|
||||
const RegList kRegExpCalleeSaved = {r25, r26, r27, r28, r29, r30, fp};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
@ -215,8 +215,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerS390
|
||||
};
|
||||
|
||||
// Set of non-volatile registers saved/restored by generated regexp code.
|
||||
const RegList kRegExpCalleeSaved =
|
||||
1 << 6 | 1 << 7 | 1 << 8 | 1 << 9 | 1 << 10 | 1 << 11 | 1 << 13;
|
||||
const RegList kRegExpCalleeSaved = {r6, r7, r8, r9, r10, fp, r13};
|
||||
|
||||
} // namespace internal
|
||||
} // namespace v8
|
||||
|
Loading…
Reference in New Issue
Block a user