Commit b4f1e240 authored by Rodolph Perfetta's avatar Rodolph Perfetta Committed by Commit Bot

[instruction scheduler] deal with CSP/JSSP disparity on arm64.

This is preparation work to re-enable the scheduler: on arm64 some opcodes will
be neutral wrt the stack (JSSP) but will modify the underlying CSP. Identify
those opcode as such until JSSP is removed.

Bug: 
Change-Id: Iae633382c5ed38b01edaec896f2ce44d76931fc8
Reviewed-on: https://chromium-review.googlesource.com/568822Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Rodolph Perfetta <rodolph.perfetta@arm.com>
Cr-Commit-Position: refs/heads/master@{#46946}
parent ffeea0fe
......@@ -93,7 +93,6 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArm64Float64Sub:
case kArm64Float64Mul:
case kArm64Float64Div:
case kArm64Float64Mod:
case kArm64Float64Max:
case kArm64Float64Min:
case kArm64Float64Abs:
......@@ -295,6 +294,8 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArm64Ldr:
return kIsLoadOperation;
case kArm64Float64Mod: // This opcode will call a C Function which can
// alter CSP. TODO(arm64): Remove once JSSP is gone.
case kArm64ClaimCSP:
case kArm64ClaimJSSP:
case kArm64PokeCSP:
......
......@@ -240,9 +240,13 @@ int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const {
case kArchNop:
case kArchFramePointer:
case kArchParentFramePointer:
case kArchTruncateDoubleToI:
case kArchStackSlot:
case kArchStackSlot: // Despite its name this opcode will produce a
// reference to a frame slot, so it is not affected
// by the arm64 dual stack issues mentioned below.
case kArchComment:
return kNoOpcodeFlags;
case kArchTruncateDoubleToI:
case kIeee754Float64Acos:
case kIeee754Float64Acosh:
case kIeee754Float64Asin:
......@@ -264,7 +268,21 @@ int InstructionScheduler::GetInstructionFlags(const Instruction* instr) const {
case kIeee754Float64Sinh:
case kIeee754Float64Tan:
case kIeee754Float64Tanh:
#ifdef V8_TARGET_ARCH_ARM64
// This is an unfortunate effect of arm64 dual stack pointers:
// * TruncateDoubleToI may call a stub, and the stub will push and pop
// values onto the stack. Push updates both CSP and JSSP but pop only
// restores JSSP.
// * kIeee754XXX opcodes call a C Function and the call macro may update
// CSP to meet alignment requirements but it will not bring back CSP to
// its original value.
// Those opcode cannot be reordered with instructions with side effects
// such as Arm64ClaimCSP.
// TODO(arm64): remove when JSSP is gone.
return kHasSideEffect;
#else
return kNoOpcodeFlags;
#endif
case kArchStackPointer:
// ArchStackPointer instruction loads the current stack pointer value and
......
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