OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 5089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5100 | 5100 |
5101 // smi | 5101 // smi |
5102 __ bind(&is_smi); | 5102 __ bind(&is_smi); |
5103 __ SmiToInteger32(input_reg, input_reg); | 5103 __ SmiToInteger32(input_reg, input_reg); |
5104 __ ClampUint8(input_reg); | 5104 __ ClampUint8(input_reg); |
5105 | 5105 |
5106 __ bind(&done); | 5106 __ bind(&done); |
5107 } | 5107 } |
5108 | 5108 |
5109 | 5109 |
| 5110 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { |
| 5111 XMMRegister value_reg = ToDoubleRegister(instr->value()); |
| 5112 Register result_reg = ToRegister(instr->result()); |
| 5113 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
| 5114 __ movq(result_reg, value_reg); |
| 5115 __ shr(result_reg, Immediate(32)); |
| 5116 } else { |
| 5117 __ movd(result_reg, value_reg); |
| 5118 } |
| 5119 } |
| 5120 |
| 5121 |
| 5122 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5123 Register hi_reg = ToRegister(instr->hi()); |
| 5124 Register lo_reg = ToRegister(instr->lo()); |
| 5125 XMMRegister result_reg = ToDoubleRegister(instr->result()); |
| 5126 XMMRegister xmm_scratch = double_scratch0(); |
| 5127 __ movd(result_reg, hi_reg); |
| 5128 __ psllq(result_reg, 32); |
| 5129 __ movd(xmm_scratch, lo_reg); |
| 5130 __ orps(result_reg, xmm_scratch); |
| 5131 } |
| 5132 |
| 5133 |
5110 void LCodeGen::DoAllocate(LAllocate* instr) { | 5134 void LCodeGen::DoAllocate(LAllocate* instr) { |
5111 class DeferredAllocate V8_FINAL : public LDeferredCode { | 5135 class DeferredAllocate V8_FINAL : public LDeferredCode { |
5112 public: | 5136 public: |
5113 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) | 5137 DeferredAllocate(LCodeGen* codegen, LAllocate* instr) |
5114 : LDeferredCode(codegen), instr_(instr) { } | 5138 : LDeferredCode(codegen), instr_(instr) { } |
5115 virtual void Generate() V8_OVERRIDE { | 5139 virtual void Generate() V8_OVERRIDE { |
5116 codegen()->DoDeferredAllocate(instr_); | 5140 codegen()->DoDeferredAllocate(instr_); |
5117 } | 5141 } |
5118 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } | 5142 virtual LInstruction* instr() V8_OVERRIDE { return instr_; } |
5119 private: | 5143 private: |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5636 FixedArray::kHeaderSize - kPointerSize)); | 5660 FixedArray::kHeaderSize - kPointerSize)); |
5637 __ bind(&done); | 5661 __ bind(&done); |
5638 } | 5662 } |
5639 | 5663 |
5640 | 5664 |
5641 #undef __ | 5665 #undef __ |
5642 | 5666 |
5643 } } // namespace v8::internal | 5667 } } // namespace v8::internal |
5644 | 5668 |
5645 #endif // V8_TARGET_ARCH_X64 | 5669 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |