Commit abfb5824 authored by Jaroslav Sevcik's avatar Jaroslav Sevcik Committed by Commit Bot

[turbofan,x64] Poison float64 loads.

Bug: chromium:798964
Change-Id: Ia359f68e30e87e2cbee5b8322b4ac54c335ef474
Reviewed-on: https://chromium-review.googlesource.com/955425Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51813}
parent 0d263070
...@@ -1907,16 +1907,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1907,16 +1907,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ movss(operand, i.InputDoubleRegister(index)); __ movss(operand, i.InputDoubleRegister(index));
} }
break; break;
case kX64Movsd: case kX64Movsd: {
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset()); EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
if (instr->HasOutput()) { if (instr->HasOutput()) {
const MemoryAccessMode access_mode =
static_cast<MemoryAccessMode>(MiscField::decode(opcode));
if (access_mode == kMemoryAccessPoisoned) {
// If we have to poison the loaded value, we load into a general
// purpose register first, mask it with the poison, and move the
// value from the general purpose register into the double register.
__ movq(kScratchRegister, i.MemoryOperand());
__ andq(kScratchRegister, kSpeculationPoisonRegister);
__ Movq(i.OutputDoubleRegister(), kScratchRegister);
} else {
__ Movsd(i.OutputDoubleRegister(), i.MemoryOperand()); __ Movsd(i.OutputDoubleRegister(), i.MemoryOperand());
}
} else { } else {
size_t index = 0; size_t index = 0;
Operand operand = i.MemoryOperand(&index); Operand operand = i.MemoryOperand(&index);
__ Movsd(operand, i.InputDoubleRegister(index)); __ Movsd(operand, i.InputDoubleRegister(index));
} }
break; break;
}
case kX64Movdqu: { case kX64Movdqu: {
CpuFeatureScope sse_scope(tasm(), SSSE3); CpuFeatureScope sse_scope(tasm(), SSSE3);
EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset()); EmitOOLTrapIfNeeded(zone(), this, opcode, instr, i, __ pc_offset());
......
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