| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
| 9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); | 1311 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); |
| 1312 } else { | 1312 } else { |
| 1313 __ Push(i.InputRegister(0)); | 1313 __ Push(i.InputRegister(0)); |
| 1314 frame_access_state()->IncreaseSPDelta(1); | 1314 frame_access_state()->IncreaseSPDelta(1); |
| 1315 } | 1315 } |
| 1316 break; | 1316 break; |
| 1317 case kS390_PushFrame: { | 1317 case kS390_PushFrame: { |
| 1318 int num_slots = i.InputInt32(1); | 1318 int num_slots = i.InputInt32(1); |
| 1319 __ lay(sp, MemOperand(sp, -num_slots * kPointerSize)); | 1319 __ lay(sp, MemOperand(sp, -num_slots * kPointerSize)); |
| 1320 if (instr->InputAt(0)->IsFPRegister()) { | 1320 if (instr->InputAt(0)->IsFPRegister()) { |
| 1321 __ StoreDouble(i.InputDoubleRegister(0), | 1321 LocationOperand* op = LocationOperand::cast(instr->InputAt(0)); |
| 1322 MemOperand(sp)); | 1322 if (op->representation() == MachineRepresentation::kFloat64) { |
| 1323 __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp)); |
| 1324 } else { |
| 1325 DCHECK(op->representation() == MachineRepresentation::kFloat32); |
| 1326 __ StoreFloat32(i.InputDoubleRegister(0), MemOperand(sp)); |
| 1327 } |
| 1323 } else { | 1328 } else { |
| 1324 __ StoreP(i.InputRegister(0), | 1329 __ StoreP(i.InputRegister(0), |
| 1325 MemOperand(sp)); | 1330 MemOperand(sp)); |
| 1326 } | 1331 } |
| 1327 break; | 1332 break; |
| 1328 } | 1333 } |
| 1329 case kS390_StoreToStackSlot: { | 1334 case kS390_StoreToStackSlot: { |
| 1330 int slot = i.InputInt32(1); | 1335 int slot = i.InputInt32(1); |
| 1331 if (instr->InputAt(0)->IsFPRegister()) { | 1336 if (instr->InputAt(0)->IsFPRegister()) { |
| 1332 __ StoreDouble(i.InputDoubleRegister(0), | 1337 LocationOperand* op = LocationOperand::cast(instr->InputAt(0)); |
| 1333 MemOperand(sp, slot * kPointerSize)); | 1338 if (op->representation() == MachineRepresentation::kFloat64) { |
| 1339 __ StoreDouble(i.InputDoubleRegister(0), |
| 1340 MemOperand(sp, slot * kPointerSize)); |
| 1341 } else { |
| 1342 DCHECK(op->representation() == MachineRepresentation::kFloat32); |
| 1343 __ StoreFloat32(i.InputDoubleRegister(0), |
| 1344 MemOperand(sp, slot * kPointerSize)); |
| 1345 } |
| 1334 } else { | 1346 } else { |
| 1335 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize)); | 1347 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize)); |
| 1336 } | 1348 } |
| 1337 break; | 1349 break; |
| 1338 } | 1350 } |
| 1339 case kS390_ExtendSignWord8: | 1351 case kS390_ExtendSignWord8: |
| 1340 #if V8_TARGET_ARCH_S390X | 1352 #if V8_TARGET_ARCH_S390X |
| 1341 __ lgbr(i.OutputRegister(), i.InputRegister(0)); | 1353 __ lgbr(i.OutputRegister(), i.InputRegister(0)); |
| 1342 #else | 1354 #else |
| 1343 __ lbr(i.OutputRegister(), i.InputRegister(0)); | 1355 __ lbr(i.OutputRegister(), i.InputRegister(0)); |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2010 __ StoreDouble(dst, g.ToMemOperand(destination)); | 2022 __ StoreDouble(dst, g.ToMemOperand(destination)); |
| 2011 } | 2023 } |
| 2012 } | 2024 } |
| 2013 } else if (source->IsFPRegister()) { | 2025 } else if (source->IsFPRegister()) { |
| 2014 DoubleRegister src = g.ToDoubleRegister(source); | 2026 DoubleRegister src = g.ToDoubleRegister(source); |
| 2015 if (destination->IsFPRegister()) { | 2027 if (destination->IsFPRegister()) { |
| 2016 DoubleRegister dst = g.ToDoubleRegister(destination); | 2028 DoubleRegister dst = g.ToDoubleRegister(destination); |
| 2017 __ Move(dst, src); | 2029 __ Move(dst, src); |
| 2018 } else { | 2030 } else { |
| 2019 DCHECK(destination->IsFPStackSlot()); | 2031 DCHECK(destination->IsFPStackSlot()); |
| 2020 __ StoreDouble(src, g.ToMemOperand(destination)); | 2032 LocationOperand* op = LocationOperand::cast(source); |
| 2033 if (op->representation() == MachineRepresentation::kFloat64) { |
| 2034 __ StoreDouble(src, g.ToMemOperand(destination)); |
| 2035 } else { |
| 2036 __ StoreFloat32(src, g.ToMemOperand(destination)); |
| 2037 } |
| 2021 } | 2038 } |
| 2022 } else if (source->IsFPStackSlot()) { | 2039 } else if (source->IsFPStackSlot()) { |
| 2023 DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot()); | 2040 DCHECK(destination->IsFPRegister() || destination->IsFPStackSlot()); |
| 2024 MemOperand src = g.ToMemOperand(source); | 2041 MemOperand src = g.ToMemOperand(source); |
| 2025 if (destination->IsFPRegister()) { | 2042 if (destination->IsFPRegister()) { |
| 2026 __ LoadDouble(g.ToDoubleRegister(destination), src); | 2043 LocationOperand* op = LocationOperand::cast(source); |
| 2044 if (op->representation() == MachineRepresentation::kFloat64) { |
| 2045 __ LoadDouble(g.ToDoubleRegister(destination), src); |
| 2046 } else { |
| 2047 __ LoadFloat32(g.ToDoubleRegister(destination), src); |
| 2048 } |
| 2027 } else { | 2049 } else { |
| 2050 LocationOperand* op = LocationOperand::cast(source); |
| 2028 DoubleRegister temp = kScratchDoubleReg; | 2051 DoubleRegister temp = kScratchDoubleReg; |
| 2029 __ LoadDouble(temp, src); | 2052 if (op->representation() == MachineRepresentation::kFloat64) { |
| 2030 __ StoreDouble(temp, g.ToMemOperand(destination)); | 2053 __ LoadDouble(temp, src); |
| 2054 __ StoreDouble(temp, g.ToMemOperand(destination)); |
| 2055 } else { |
| 2056 __ LoadFloat32(temp, src); |
| 2057 __ StoreFloat32(temp, g.ToMemOperand(destination)); |
| 2058 } |
| 2031 } | 2059 } |
| 2032 } else { | 2060 } else { |
| 2033 UNREACHABLE(); | 2061 UNREACHABLE(); |
| 2034 } | 2062 } |
| 2035 } | 2063 } |
| 2036 | 2064 |
| 2037 void CodeGenerator::AssembleSwap(InstructionOperand* source, | 2065 void CodeGenerator::AssembleSwap(InstructionOperand* source, |
| 2038 InstructionOperand* destination) { | 2066 InstructionOperand* destination) { |
| 2039 S390OperandConverter g(this, nullptr); | 2067 S390OperandConverter g(this, nullptr); |
| 2040 // Dispatch on the source and destination operand kinds. Not all | 2068 // Dispatch on the source and destination operand kinds. Not all |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 padding_size -= 2; | 2154 padding_size -= 2; |
| 2127 } | 2155 } |
| 2128 } | 2156 } |
| 2129 } | 2157 } |
| 2130 | 2158 |
| 2131 #undef __ | 2159 #undef __ |
| 2132 | 2160 |
| 2133 } // namespace compiler | 2161 } // namespace compiler |
| 2134 } // namespace internal | 2162 } // namespace internal |
| 2135 } // namespace v8 | 2163 } // namespace v8 |
| OLD | NEW |