| 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 5184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5195 // smi | 5195 // smi |
| 5196 __ bind(&is_smi); | 5196 __ bind(&is_smi); |
| 5197 __ ClampUint8(result_reg, result_reg); | 5197 __ ClampUint8(result_reg, result_reg); |
| 5198 | 5198 |
| 5199 __ bind(&done); | 5199 __ bind(&done); |
| 5200 } | 5200 } |
| 5201 | 5201 |
| 5202 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { | 5202 void LCodeGen::DoDoubleBits(LDoubleBits* instr) { |
| 5203 DoubleRegister value_reg = ToDoubleRegister(instr->value()); | 5203 DoubleRegister value_reg = ToDoubleRegister(instr->value()); |
| 5204 Register result_reg = ToRegister(instr->result()); | 5204 Register result_reg = ToRegister(instr->result()); |
| 5205 // TODO(joransiu): Use non-memory version. | 5205 __ lgdr(result_reg, value_reg); |
| 5206 __ stdy(value_reg, MemOperand(sp, -kDoubleSize)); | |
| 5207 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { | 5206 if (instr->hydrogen()->bits() == HDoubleBits::HIGH) { |
| 5208 __ LoadlW(result_reg, | 5207 __ srlg(result_reg, result_reg, Operand(32)); |
| 5209 MemOperand(sp, -kDoubleSize + Register::kExponentOffset)); | |
| 5210 } else { | 5208 } else { |
| 5211 __ LoadlW(result_reg, | 5209 __ llgfr(result_reg, result_reg); |
| 5212 MemOperand(sp, -kDoubleSize + Register::kMantissaOffset)); | |
| 5213 } | 5210 } |
| 5214 } | 5211 } |
| 5215 | 5212 |
| 5216 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { | 5213 void LCodeGen::DoConstructDouble(LConstructDouble* instr) { |
| 5217 Register hi_reg = ToRegister(instr->hi()); | 5214 Register hi_reg = ToRegister(instr->hi()); |
| 5218 Register lo_reg = ToRegister(instr->lo()); | 5215 Register lo_reg = ToRegister(instr->lo()); |
| 5219 DoubleRegister result_reg = ToDoubleRegister(instr->result()); | 5216 DoubleRegister result_reg = ToDoubleRegister(instr->result()); |
| 5220 // TODO(joransiu): Construct with ldgr | |
| 5221 Register scratch = scratch0(); | 5217 Register scratch = scratch0(); |
| 5222 | 5218 |
| 5223 // Combine hi_reg:lo_reg into a single 64-bit register. | 5219 // Combine hi_reg:lo_reg into a single 64-bit register. |
| 5224 __ sllg(scratch, hi_reg, Operand(32)); | 5220 __ sllg(scratch, hi_reg, Operand(32)); |
| 5225 __ lr(scratch, lo_reg); | 5221 __ lr(scratch, lo_reg); |
| 5226 | 5222 |
| 5227 // Bitwise convert from GPR to FPR | 5223 // Bitwise convert from GPR to FPR |
| 5228 __ ldgr(result_reg, scratch); | 5224 __ ldgr(result_reg, scratch); |
| 5229 } | 5225 } |
| 5230 | 5226 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5662 __ LoadP(result, | 5658 __ LoadP(result, |
| 5663 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); | 5659 FieldMemOperand(scratch, FixedArray::kHeaderSize - kPointerSize)); |
| 5664 __ bind(deferred->exit()); | 5660 __ bind(deferred->exit()); |
| 5665 __ bind(&done); | 5661 __ bind(&done); |
| 5666 } | 5662 } |
| 5667 | 5663 |
| 5668 #undef __ | 5664 #undef __ |
| 5669 | 5665 |
| 5670 } // namespace internal | 5666 } // namespace internal |
| 5671 } // namespace v8 | 5667 } // namespace v8 |
| OLD | NEW |