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 5729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5740 __ bind(&is_smi); | 5740 __ bind(&is_smi); |
5741 if (!input_reg.is(result_reg)) { | 5741 if (!input_reg.is(result_reg)) { |
5742 __ mov(result_reg, input_reg); | 5742 __ mov(result_reg, input_reg); |
5743 } | 5743 } |
5744 __ SmiUntag(result_reg); | 5744 __ SmiUntag(result_reg); |
5745 __ ClampUint8(result_reg); | 5745 __ ClampUint8(result_reg); |
5746 __ bind(&done); | 5746 __ bind(&done); |
5747 } | 5747 } |
5748 | 5748 |
5749 | 5749 |
| 5750 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { |
| 5751 CpuFeatureScope scope(masm(), SSE2); |
| 5752 XMMRegister value_reg = ToDoubleRegister(instr->value()); |
| 5753 Register result_reg = ToRegister(instr->result()); |
| 5754 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
| 5755 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 5756 CpuFeatureScope scope2(masm(), SSE4_1); |
| 5757 __ pextrd(result_reg, value_reg, 1); |
| 5758 } else { |
| 5759 XMMRegister xmm_scratch = double_scratch0(); |
| 5760 __ pshufd(xmm_scratch, value_reg, 1); |
| 5761 __ movd(result_reg, xmm_scratch); |
| 5762 } |
| 5763 } else { |
| 5764 __ movd(result_reg, value_reg); |
| 5765 } |
| 5766 } |
| 5767 |
| 5768 |
| 5769 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5770 Register hi_reg = ToRegister(instr->hi()); |
| 5771 Register lo_reg = ToRegister(instr->lo()); |
| 5772 XMMRegister result_reg = ToDoubleRegister(instr->result()); |
| 5773 CpuFeatureScope scope(masm(), SSE2); |
| 5774 |
| 5775 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 5776 CpuFeatureScope scope2(masm(), SSE4_1); |
| 5777 __ movd(result_reg, lo_reg); |
| 5778 __ pinsrd(result_reg, hi_reg, 1); |
| 5779 } else { |
| 5780 XMMRegister xmm_scratch = double_scratch0(); |
| 5781 __ xorps(result_reg, result_reg); |
| 5782 __ movd(result_reg, hi_reg); |
| 5783 __ psllq(result_reg, 32); |
| 5784 __ movd(xmm_scratch, lo_reg); |
| 5785 __ orps(result_reg, xmm_scratch); |
| 5786 } |
| 5787 } |
| 5788 |
| 5789 |
5750 void LCodeGen::DoAllocate(LAllocate* instr) { | 5790 void LCodeGen::DoAllocate(LAllocate* instr) { |
5751 class DeferredAllocate V8_FINAL : public LDeferredCode { | 5791 class DeferredAllocate V8_FINAL : public LDeferredCode { |
5752 public: | 5792 public: |
5753 DeferredAllocate(LCodeGen* codegen, | 5793 DeferredAllocate(LCodeGen* codegen, |
5754 LAllocate* instr, | 5794 LAllocate* instr, |
5755 const X87Stack& x87_stack) | 5795 const X87Stack& x87_stack) |
5756 : LDeferredCode(codegen, x87_stack), instr_(instr) { } | 5796 : LDeferredCode(codegen, x87_stack), instr_(instr) { } |
5757 virtual void Generate() V8_OVERRIDE { | 5797 virtual void Generate() V8_OVERRIDE { |
5758 codegen()->DoDeferredAllocate(instr_); | 5798 codegen()->DoDeferredAllocate(instr_); |
5759 } | 5799 } |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6274 FixedArray::kHeaderSize - kPointerSize)); | 6314 FixedArray::kHeaderSize - kPointerSize)); |
6275 __ bind(&done); | 6315 __ bind(&done); |
6276 } | 6316 } |
6277 | 6317 |
6278 | 6318 |
6279 #undef __ | 6319 #undef __ |
6280 | 6320 |
6281 } } // namespace v8::internal | 6321 } } // namespace v8::internal |
6282 | 6322 |
6283 #endif // V8_TARGET_ARCH_IA32 | 6323 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |