| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.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 4806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4817 XMMRegister xmm_scratch = double_scratch0(); | 4817 XMMRegister xmm_scratch = double_scratch0(); |
| 4818 __ pshufd(xmm_scratch, value_reg, 1); | 4818 __ pshufd(xmm_scratch, value_reg, 1); |
| 4819 __ movd(result_reg, xmm_scratch); | 4819 __ movd(result_reg, xmm_scratch); |
| 4820 } | 4820 } |
| 4821 } else { | 4821 } else { |
| 4822 __ movd(result_reg, value_reg); | 4822 __ movd(result_reg, value_reg); |
| 4823 } | 4823 } |
| 4824 } | 4824 } |
| 4825 | 4825 |
| 4826 | 4826 |
| 4827 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | |
| 4828 Register hi_reg = ToRegister(instr->hi()); | |
| 4829 Register lo_reg = ToRegister(instr->lo()); | |
| 4830 XMMRegister result_reg = ToDoubleRegister(instr->result()); | |
| 4831 | |
| 4832 if (CpuFeatures::IsSupported(SSE4_1)) { | |
| 4833 CpuFeatureScope scope2(masm(), SSE4_1); | |
| 4834 __ movd(result_reg, lo_reg); | |
| 4835 __ pinsrd(result_reg, hi_reg, 1); | |
| 4836 } else { | |
| 4837 XMMRegister xmm_scratch = double_scratch0(); | |
| 4838 __ movd(result_reg, hi_reg); | |
| 4839 __ psllq(result_reg, 32); | |
| 4840 __ movd(xmm_scratch, lo_reg); | |
| 4841 __ orps(result_reg, xmm_scratch); | |
| 4842 } | |
| 4843 } | |
| 4844 | |
| 4845 | |
| 4846 void LCodeGen::DoAllocate(LAllocate* instr) { | 4827 void LCodeGen::DoAllocate(LAllocate* instr) { |
| 4847 class DeferredAllocate final : public LDeferredCode { | 4828 class DeferredAllocate final : public LDeferredCode { |
| 4848 public: | 4829 public: |
| 4849 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 4830 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
| 4850 : LDeferredCode(codegen), instr_(instr) { } | 4831 : LDeferredCode(codegen), instr_(instr) { } |
| 4851 void Generate() override { codegen()->DoDeferredAllocate(instr_); } | 4832 void Generate() override { codegen()->DoDeferredAllocate(instr_); } |
| 4852 LInstruction* instr() override { return instr_; } | 4833 LInstruction* instr() override { return instr_; } |
| 4853 | 4834 |
| 4854 private: | 4835 private: |
| 4855 LAllocate* instr_; | 4836 LAllocate* instr_; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5331 __ bind(deferred->exit()); | 5312 __ bind(deferred->exit()); |
| 5332 __ bind(&done); | 5313 __ bind(&done); |
| 5333 } | 5314 } |
| 5334 | 5315 |
| 5335 #undef __ | 5316 #undef __ |
| 5336 | 5317 |
| 5337 } // namespace internal | 5318 } // namespace internal |
| 5338 } // namespace v8 | 5319 } // namespace v8 |
| 5339 | 5320 |
| 5340 #endif // V8_TARGET_ARCH_IA32 | 5321 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |