OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 5283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5294 __ fst_d(Operand(esp, 0)); | 5294 __ fst_d(Operand(esp, 0)); |
5295 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | 5295 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
5296 __ mov(result_reg, Operand(esp, kPointerSize)); | 5296 __ mov(result_reg, Operand(esp, kPointerSize)); |
5297 } else { | 5297 } else { |
5298 __ mov(result_reg, Operand(esp, 0)); | 5298 __ mov(result_reg, Operand(esp, 0)); |
5299 } | 5299 } |
5300 __ add(esp, Immediate(kDoubleSize)); | 5300 __ add(esp, Immediate(kDoubleSize)); |
5301 } | 5301 } |
5302 | 5302 |
5303 | 5303 |
5304 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | |
5305 Register hi_reg = ToRegister(instr->hi()); | |
5306 Register lo_reg = ToRegister(instr->lo()); | |
5307 X87Register result_reg = ToX87Register(instr->result()); | |
5308 // Follow below pattern to write a x87 fp register. | |
5309 X87PrepareToWrite(result_reg); | |
5310 __ sub(esp, Immediate(kDoubleSize)); | |
5311 __ mov(Operand(esp, 0), lo_reg); | |
5312 __ mov(Operand(esp, kPointerSize), hi_reg); | |
5313 __ fld_d(Operand(esp, 0)); | |
5314 __ add(esp, Immediate(kDoubleSize)); | |
5315 X87CommitWrite(result_reg); | |
5316 } | |
5317 | |
5318 | |
5319 void LCodeGen::DoAllocate(LAllocate* instr) { | 5304 void LCodeGen::DoAllocate(LAllocate* instr) { |
5320 class DeferredAllocate final : public LDeferredCode { | 5305 class DeferredAllocate final : public LDeferredCode { |
5321 public: | 5306 public: |
5322 DeferredAllocate(LCodeGen* codegen, | 5307 DeferredAllocate(LCodeGen* codegen, |
5323 LAllocate* instr, | 5308 LAllocate* instr, |
5324 const X87Stack& x87_stack) | 5309 const X87Stack& x87_stack) |
5325 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5310 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5326 void Generate() override { codegen()->DoDeferredAllocate(instr_); } | 5311 void Generate() override { codegen()->DoDeferredAllocate(instr_); } |
5327 LInstruction* instr() override { return instr_; } | 5312 LInstruction* instr() override { return instr_; } |
5328 | 5313 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5811 __ bind(deferred->exit()); | 5796 __ bind(deferred->exit()); |
5812 __ bind(&done); | 5797 __ bind(&done); |
5813 } | 5798 } |
5814 | 5799 |
5815 #undef __ | 5800 #undef __ |
5816 | 5801 |
5817 } // namespace internal | 5802 } // namespace internal |
5818 } // namespace v8 | 5803 } // namespace v8 |
5819 | 5804 |
5820 #endif // V8_TARGET_ARCH_X87 | 5805 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |