diff options
Diffstat (limited to 'deps/v8/src/compiler/arm64/code-generator-arm64.cc')
-rw-r--r-- | deps/v8/src/compiler/arm64/code-generator-arm64.cc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/deps/v8/src/compiler/arm64/code-generator-arm64.cc b/deps/v8/src/compiler/arm64/code-generator-arm64.cc index a7c5beee4cf..867c3687a10 100644 --- a/deps/v8/src/compiler/arm64/code-generator-arm64.cc +++ b/deps/v8/src/compiler/arm64/code-generator-arm64.cc @@ -13,6 +13,7 @@ #include "src/frame-constants.h" #include "src/heap/heap-inl.h" #include "src/optimized-compilation-info.h" +#include "src/wasm/wasm-objects.h" namespace v8 { namespace internal { @@ -1266,6 +1267,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kArm64Rbit32: __ Rbit(i.OutputRegister32(), i.InputRegister32(0)); break; + case kArm64Rev: + __ Rev(i.OutputRegister64(), i.InputRegister64(0)); + break; + case kArm64Rev32: + __ Rev(i.OutputRegister32(), i.InputRegister32(0)); + break; case kArm64Cmp: __ Cmp(i.InputOrZeroRegister64(0), i.InputOperand2_64(1)); break; @@ -1346,12 +1353,12 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputDoubleRegister(1)); break; case kArm64Float64Mod: { - // TODO(dcarney): implement directly. See note in lithium-codegen-arm64.cc + // TODO(turbofan): implement directly. FrameScope scope(tasm(), StackFrame::MANUAL); DCHECK(d0.is(i.InputDoubleRegister(0))); DCHECK(d1.is(i.InputDoubleRegister(1))); DCHECK(d0.is(i.OutputDoubleRegister())); - // TODO(dcarney): make sure this saves all relevant registers. + // TODO(turbofan): make sure this saves all relevant registers. __ CallCFunction(ExternalReference::mod_two_doubles_operation(), 0, 2); break; } @@ -1414,35 +1421,29 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kArm64Float32ToInt64: __ Fcvtzs(i.OutputRegister64(), i.InputFloat32Register(0)); if (i.OutputCount() > 1) { - __ Mov(i.OutputRegister(1), 1); - Label done; - __ Cmp(i.OutputRegister(0), 1); - __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); - __ Fccmp(i.InputFloat32Register(0), i.InputFloat32Register(0), VFlag, - vc); - __ B(vc, &done); + // Check for inputs below INT64_MIN and NaN. __ Fcmp(i.InputFloat32Register(0), static_cast<float>(INT64_MIN)); - __ Cset(i.OutputRegister(1), eq); - __ Bind(&done); + // Check overflow. + // -1 value is used to indicate a possible overflow which will occur + // when subtracting (-1) from the provided INT64_MAX operand. + // OutputRegister(1) is set to 0 if the input was out of range or NaN. + __ Ccmp(i.OutputRegister(0), -1, VFlag, ge); + __ Cset(i.OutputRegister(1), vc); } break; case kArm64Float64ToInt64: __ Fcvtzs(i.OutputRegister(0), i.InputDoubleRegister(0)); if (i.OutputCount() > 1) { - __ Mov(i.OutputRegister(1), 1); - Label done; - __ Cmp(i.OutputRegister(0), 1); - __ Ccmp(i.OutputRegister(0), -1, VFlag, vc); - __ Fccmp(i.InputDoubleRegister(0), i.InputDoubleRegister(0), VFlag, vc); - __ B(vc, &done); + // See kArm64Float32ToInt64 for a detailed description. __ Fcmp(i.InputDoubleRegister(0), static_cast<double>(INT64_MIN)); - __ Cset(i.OutputRegister(1), eq); - __ Bind(&done); + __ Ccmp(i.OutputRegister(0), -1, VFlag, ge); + __ Cset(i.OutputRegister(1), vc); } break; case kArm64Float32ToUint64: __ Fcvtzu(i.OutputRegister64(), i.InputFloat32Register(0)); if (i.OutputCount() > 1) { + // See kArm64Float32ToInt64 for a detailed description. __ Fcmp(i.InputFloat32Register(0), -1.0); __ Ccmp(i.OutputRegister(0), -1, ZFlag, gt); __ Cset(i.OutputRegister(1), ne); @@ -1451,6 +1452,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kArm64Float64ToUint64: __ Fcvtzu(i.OutputRegister64(), i.InputDoubleRegister(0)); if (i.OutputCount() > 1) { + // See kArm64Float32ToInt64 for a detailed description. __ Fcmp(i.InputDoubleRegister(0), -1.0); __ Ccmp(i.OutputRegister(0), -1, ZFlag, gt); __ Cset(i.OutputRegister(1), ne); @@ -2580,10 +2582,8 @@ void CodeGenerator::AssembleMove(InstructionOperand* source, if (IsMaterializableFromRoot(src_object, &index)) { __ LoadRoot(dst, index); } else { - __ Move(dst, src_object); + __ Mov(dst, src_object); } - } else if (src.type() == Constant::kExternalReference) { - __ Mov(dst, src.ToExternalReference()); } else { __ Mov(dst, g.ToImmediate(source)); } |