OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5778 __ bind(&is_smi); | 5778 __ bind(&is_smi); |
5779 if (!input_reg.is(result_reg)) { | 5779 if (!input_reg.is(result_reg)) { |
5780 __ mov(result_reg, input_reg); | 5780 __ mov(result_reg, input_reg); |
5781 } | 5781 } |
5782 __ SmiUntag(result_reg); | 5782 __ SmiUntag(result_reg); |
5783 __ ClampUint8(result_reg); | 5783 __ ClampUint8(result_reg); |
5784 __ bind(&done); | 5784 __ bind(&done); |
5785 } | 5785 } |
5786 | 5786 |
5787 | 5787 |
| 5788 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { |
| 5789 CpuFeatureScope scope(masm(), SSE2); |
| 5790 XMMRegister value_reg = ToDoubleRegister(instr->value()); |
| 5791 Register result_reg = ToRegister(instr->result()); |
| 5792 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
| 5793 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 5794 CpuFeatureScope scope2(masm(), SSE4_1); |
| 5795 __ pextrd(result_reg, value_reg, 1); |
| 5796 } else { |
| 5797 XMMRegister xmm_scratch = double_scratch0(); |
| 5798 __ pshufd(xmm_scratch, value_reg, 1); |
| 5799 __ movd(result_reg, xmm_scratch); |
| 5800 } |
| 5801 } else { |
| 5802 __ movd(result_reg, value_reg); |
| 5803 } |
| 5804 } |
| 5805 |
| 5806 |
| 5807 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5808 Register hi_reg = ToRegister(instr->hi()); |
| 5809 Register lo_reg = ToRegister(instr->lo()); |
| 5810 XMMRegister result_reg = ToDoubleRegister(instr->result()); |
| 5811 CpuFeatureScope scope(masm(), SSE2); |
| 5812 |
| 5813 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 5814 CpuFeatureScope scope2(masm(), SSE4_1); |
| 5815 __ movd(result_reg, lo_reg); |
| 5816 __ pinsrd(result_reg, hi_reg, 1); |
| 5817 } else { |
| 5818 XMMRegister xmm_scratch = double_scratch0(); |
| 5819 __ movd(result_reg, hi_reg); |
| 5820 __ psllq(result_reg, 32); |
| 5821 __ movd(xmm_scratch, lo_reg); |
| 5822 __ orps(result_reg, xmm_scratch); |
| 5823 } |
| 5824 } |
| 5825 |
| 5826 |
5788 void LCodeGen::DoAllocate(LAllocate* instr) { | 5827 void LCodeGen::DoAllocate(LAllocate* instr) { |
5789 class DeferredAllocate V8_FINAL : public LDeferredCode { | 5828 class DeferredAllocate V8_FINAL : public LDeferredCode { |
5790 public: | 5829 public: |
5791 DeferredAllocate(LCodeGen* codegen, | 5830 DeferredAllocate(LCodeGen* codegen, |
5792 LAllocate* instr, | 5831 LAllocate* instr, |
5793 const X87Stack& x87_stack) | 5832 const X87Stack& x87_stack) |
5794 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5833 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5795 virtual void Generate() V8_OVERRIDE { | 5834 virtual void Generate() V8_OVERRIDE { |
5796 codegen()->DoDeferredAllocate(instr_); | 5835 codegen()->DoDeferredAllocate(instr_); |
5797 } | 5836 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6308 FixedArray::kHeaderSize - kPointerSize)); | 6347 FixedArray::kHeaderSize - kPointerSize)); |
6309 __ bind(&done); | 6348 __ bind(&done); |
6310 } | 6349 } |
6311 | 6350 |
6312 | 6351 |
6313 #undef __ | 6352 #undef __ |
6314 | 6353 |
6315 } } // namespace v8::internal | 6354 } } // namespace v8::internal |
6316 | 6355 |
6317 #endif // V8_TARGET_ARCH_IA32 | 6356 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |