| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" | 6 #include "src/crankshaft/s390/lithium-codegen-s390.h" |
| 7 | 7 |
| 8 #include "src/base/bits.h" | 8 #include "src/base/bits.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 5192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5203 // smi | 5203 // smi |
| 5204 __ bind(&is_smi); | 5204 __ bind(&is_smi); |
| 5205 __ ClampUint8(result_reg, result_reg); | 5205 __ ClampUint8(result_reg, result_reg); |
| 5206 | 5206 |
| 5207 __ bind(&done); | 5207 __ bind(&done); |
| 5208 } | 5208 } |
| 5209 | 5209 |
| 5210 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { | 5210 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { |
| 5211 DoubleRegister value_reg = ToDoubleRegister(instr->value()); | 5211 DoubleRegister value_reg = ToDoubleRegister(instr->value()); |
| 5212 Register result_reg = ToRegister(instr->result()); | 5212 Register result_reg = ToRegister(instr->result()); |
| 5213 // TODO(joransiu): Use non-memory version. | 5213 __ lgdr(result_reg, value_reg); |
| 5214 __ stdy(value_reg, MemOperand(sp, -kDoubleSize)); | |
| 5215 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | 5214 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
| 5216 __ LoadlW(result_reg, | 5215 __ srlg(result_reg, result_reg, Operand(32)); |
| 5217 MemOperand(sp, -kDoubleSize + Register::kExponentOffset)); | |
| 5218 } else { | 5216 } else { |
| 5219 __ LoadlW(result_reg, | 5217 __ llgfr(result_reg, result_reg); |
| 5220 MemOperand(sp, -kDoubleSize + Register::kMantissaOffset)); | |
| 5221 } | 5218 } |
| 5222 } | 5219 } |
| 5223 | 5220 |
| 5224 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | 5221 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5225 Register hi_reg = ToRegister(instr->hi()); | 5222 Register hi_reg = ToRegister(instr->hi()); |
| 5226 Register lo_reg = ToRegister(instr->lo()); | 5223 Register lo_reg = ToRegister(instr->lo()); |
| 5227 DoubleRegister result_reg = ToDoubleRegister(instr->result()); | 5224 DoubleRegister result_reg = ToDoubleRegister(instr->result()); |
| 5228 // TODO(joransiu): Construct with ldgr | |
| 5229 Register scratch = scratch0(); | 5225 Register scratch = scratch0(); |
| 5230 | 5226 |
| 5231 // Combine hi_reg:lo_reg into a single 64-bit register. | 5227 // Combine hi_reg:lo_reg into a single 64-bit register. |
| 5232 __ sllg(scratch, hi_reg, Operand(32)); | 5228 __ sllg(scratch, hi_reg, Operand(32)); |
| 5233 __ lr(scratch, lo_reg); | 5229 __ lr(scratch, lo_reg); |
| 5234 | 5230 |
| 5235 // Bitwise convert from GPR to FPR | 5231 // Bitwise convert from GPR to FPR |
| 5236 __ ldgr(result_reg, scratch); | 5232 __ ldgr(result_reg, scratch); |
| 5237 } | 5233 } |
| 5238 | 5234 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5670 __ LoadP(result, | 5666 __ LoadP(result, |
| 5671 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5667 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5672 __ bind(deferred->exit()); | 5668 __ bind(deferred->exit()); |
| 5673 __ bind(&done); | 5669 __ bind(&done); |
| 5674 } | 5670 } |
| 5675 | 5671 |
| 5676 #undef __ | 5672 #undef __ |
| 5677 | 5673 |
| 5678 } // namespace internal | 5674 } // namespace internal |
| 5679 } // namespace v8 | 5675 } // namespace v8 |
| OLD | NEW |