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 4783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4794 __ jmp(&done, Label::kNear); | 4794 __ jmp(&done, Label::kNear); |
4795 | 4795 |
4796 // smi | 4796 // smi |
4797 __ bind(&is_smi); | 4797 __ bind(&is_smi); |
4798 __ SmiUntag(input_reg); | 4798 __ SmiUntag(input_reg); |
4799 __ ClampUint8(input_reg); | 4799 __ ClampUint8(input_reg); |
4800 __ bind(&done); | 4800 __ bind(&done); |
4801 } | 4801 } |
4802 | 4802 |
4803 | 4803 |
4804 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { | |
4805 XMMRegister value_reg = ToDoubleRegister(instr->value()); | |
4806 Register result_reg = ToRegister(instr->result()); | |
4807 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | |
4808 if (CpuFeatures::IsSupported(SSE4_1)) { | |
4809 CpuFeatureScope scope2(masm(), SSE4_1); | |
4810 __ pextrd(result_reg, value_reg, 1); | |
4811 } else { | |
4812 XMMRegister xmm_scratch = double_scratch0(); | |
4813 __ pshufd(xmm_scratch, value_reg, 1); | |
4814 __ movd(result_reg, xmm_scratch); | |
4815 } | |
4816 } else { | |
4817 __ movd(result_reg, value_reg); | |
4818 } | |
4819 } | |
4820 | |
4821 | |
4822 void LCodeGen::DoAllocate(LAllocate* instr) { | 4804 void LCodeGen::DoAllocate(LAllocate* instr) { |
4823 class DeferredAllocate final : public LDeferredCode { | 4805 class DeferredAllocate final : public LDeferredCode { |
4824 public: | 4806 public: |
4825 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 4807 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
4826 : LDeferredCode(codegen), instr_(instr) { } | 4808 : LDeferredCode(codegen), instr_(instr) { } |
4827 void Generate() override { codegen()->DoDeferredAllocate(instr_); } | 4809 void Generate() override { codegen()->DoDeferredAllocate(instr_); } |
4828 LInstruction* instr() override { return instr_; } | 4810 LInstruction* instr() override { return instr_; } |
4829 | 4811 |
4830 private: | 4812 private: |
4831 LAllocate* instr_; | 4813 LAllocate* instr_; |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5307 __ bind(deferred->exit()); | 5289 __ bind(deferred->exit()); |
5308 __ bind(&done); | 5290 __ bind(&done); |
5309 } | 5291 } |
5310 | 5292 |
5311 #undef __ | 5293 #undef __ |
5312 | 5294 |
5313 } // namespace internal | 5295 } // namespace internal |
5314 } // namespace v8 | 5296 } // namespace v8 |
5315 | 5297 |
5316 #endif // V8_TARGET_ARCH_IA32 | 5298 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |