Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index 970f85d8d3dcc40cf63327d64c30ce0b816bb151..5e1ef6ba1a6994d3bd4ef1396a7f8712ad19492a 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -1297,6 +1297,61 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( |
-kDoubleSize); |
break; |
} |
+ case kSSEFloat32Max: { |
+ Label compare_nan, compare_swap, done_compare; |
+ if (instr->InputAt(1)->IsFPRegister()) { |
+ __ Ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
+ } else { |
+ __ Ucomiss(i.InputDoubleRegister(0), i.InputOperand(1)); |
+ } |
+ auto ool = |
+ new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister()); |
+ __ j(parity_even, ool->entry()); |
+ __ j(above, &done_compare, Label::kNear); |
+ __ j(below, &compare_swap, Label::kNear); |
+ __ Movmskps(kScratchRegister, i.InputDoubleRegister(0)); |
+ __ testl(kScratchRegister, Immediate(1)); |
+ __ j(zero, &done_compare, Label::kNear); |
+ __ bind(&compare_swap); |
+ if (instr->InputAt(1)->IsFPRegister()) { |
+ __ Movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
+ } else { |
+ __ Movss(i.InputDoubleRegister(0), i.InputOperand(1)); |
+ } |
+ __ bind(&done_compare); |
+ __ bind(ool->exit()); |
+ break; |
+ } |
+ case kSSEFloat32Min: { |
+ Label compare_swap, done_compare; |
+ if (instr->InputAt(1)->IsFPRegister()) { |
+ __ Ucomiss(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
+ } else { |
+ __ Ucomiss(i.InputDoubleRegister(0), i.InputOperand(1)); |
+ } |
+ auto ool = |
+ new (zone()) OutOfLineLoadFloat32NaN(this, i.OutputDoubleRegister()); |
+ __ j(parity_even, ool->entry()); |
+ __ j(below, &done_compare, Label::kNear); |
+ __ j(above, &compare_swap, Label::kNear); |
+ if (instr->InputAt(1)->IsFPRegister()) { |
+ __ Movmskps(kScratchRegister, i.InputDoubleRegister(1)); |
+ } else { |
+ __ Movss(kScratchDoubleReg, i.InputOperand(1)); |
+ __ Movmskps(kScratchRegister, kScratchDoubleReg); |
+ } |
+ __ testl(kScratchRegister, Immediate(1)); |
+ __ j(zero, &done_compare, Label::kNear); |
+ __ bind(&compare_swap); |
+ if (instr->InputAt(1)->IsFPRegister()) { |
+ __ Movss(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
+ } else { |
+ __ Movss(i.InputDoubleRegister(0), i.InputOperand(1)); |
+ } |
+ __ bind(&done_compare); |
+ __ bind(ool->exit()); |
+ break; |
+ } |
case kSSEFloat64Max: { |
Label compare_nan, compare_swap, done_compare; |
if (instr->InputAt(1)->IsFPRegister()) { |