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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 case kS390_Tst64: | 1297 case kS390_Tst64: |
1298 if (HasRegisterInput(instr, 1)) { | 1298 if (HasRegisterInput(instr, 1)) { |
1299 __ AndP(r0, i.InputRegister(0), i.InputRegister(1)); | 1299 __ AndP(r0, i.InputRegister(0), i.InputRegister(1)); |
1300 } else { | 1300 } else { |
1301 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1)); | 1301 __ AndP(r0, i.InputRegister(0), i.InputImmediate(1)); |
1302 } | 1302 } |
1303 break; | 1303 break; |
1304 #endif | 1304 #endif |
1305 case kS390_Push: | 1305 case kS390_Push: |
1306 if (instr->InputAt(0)->IsDoubleRegister()) { | 1306 if (instr->InputAt(0)->IsDoubleRegister()) { |
1307 __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize)); | |
1308 __ lay(sp, MemOperand(sp, -kDoubleSize)); | 1307 __ lay(sp, MemOperand(sp, -kDoubleSize)); |
| 1308 __ StoreDouble(i.InputDoubleRegister(0), MemOperand(sp)); |
1309 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); | 1309 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); |
1310 } else { | 1310 } else { |
1311 __ Push(i.InputRegister(0)); | 1311 __ Push(i.InputRegister(0)); |
1312 frame_access_state()->IncreaseSPDelta(1); | 1312 frame_access_state()->IncreaseSPDelta(1); |
1313 } | 1313 } |
1314 break; | 1314 break; |
1315 case kS390_PushFrame: { | 1315 case kS390_PushFrame: { |
1316 int num_slots = i.InputInt32(1); | 1316 int num_slots = i.InputInt32(1); |
| 1317 __ lay(sp, MemOperand(sp, -num_slots * kPointerSize)); |
1317 if (instr->InputAt(0)->IsDoubleRegister()) { | 1318 if (instr->InputAt(0)->IsDoubleRegister()) { |
1318 __ StoreDouble(i.InputDoubleRegister(0), | 1319 __ StoreDouble(i.InputDoubleRegister(0), |
1319 MemOperand(sp, -num_slots * kPointerSize)); | 1320 MemOperand(sp)); |
1320 } else { | 1321 } else { |
1321 __ StoreP(i.InputRegister(0), | 1322 __ StoreP(i.InputRegister(0), |
1322 MemOperand(sp, -num_slots * kPointerSize)); | 1323 MemOperand(sp)); |
1323 } | 1324 } |
1324 __ lay(sp, MemOperand(sp, -num_slots * kPointerSize)); | |
1325 break; | 1325 break; |
1326 } | 1326 } |
1327 case kS390_StoreToStackSlot: { | 1327 case kS390_StoreToStackSlot: { |
1328 int slot = i.InputInt32(1); | 1328 int slot = i.InputInt32(1); |
1329 if (instr->InputAt(0)->IsDoubleRegister()) { | 1329 if (instr->InputAt(0)->IsDoubleRegister()) { |
1330 __ StoreDouble(i.InputDoubleRegister(0), | 1330 __ StoreDouble(i.InputDoubleRegister(0), |
1331 MemOperand(sp, slot * kPointerSize)); | 1331 MemOperand(sp, slot * kPointerSize)); |
1332 } else { | 1332 } else { |
1333 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize)); | 1333 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize)); |
1334 } | 1334 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 break; | 1489 break; |
1490 } | 1490 } |
1491 #endif | 1491 #endif |
1492 case kS390_DoubleToFloat32: | 1492 case kS390_DoubleToFloat32: |
1493 __ ledbr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 1493 __ ledbr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
1494 break; | 1494 break; |
1495 case kS390_Float32ToDouble: | 1495 case kS390_Float32ToDouble: |
1496 __ ldebr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); | 1496 __ ldebr(i.OutputDoubleRegister(), i.InputDoubleRegister(0)); |
1497 break; | 1497 break; |
1498 case kS390_DoubleExtractLowWord32: | 1498 case kS390_DoubleExtractLowWord32: |
1499 // TODO(john.yan): this can cause problem when interrupting, | 1499 __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0)); |
1500 // use freg->greg instruction | 1500 __ llgfr(i.OutputRegister(), i.OutputRegister()); |
1501 __ stdy(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize)); | |
1502 __ LoadlW(i.OutputRegister(), | |
1503 MemOperand(sp, -kDoubleSize + Register::kMantissaOffset)); | |
1504 break; | 1501 break; |
1505 case kS390_DoubleExtractHighWord32: | 1502 case kS390_DoubleExtractHighWord32: |
1506 // TODO(john.yan): this can cause problem when interrupting, | 1503 __ lgdr(i.OutputRegister(), i.InputDoubleRegister(0)); |
1507 // use freg->greg instruction | 1504 __ srlg(i.OutputRegister(), i.OutputRegister(), Operand(32)); |
1508 __ stdy(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize)); | |
1509 __ LoadlW(i.OutputRegister(), | |
1510 MemOperand(sp, -kDoubleSize + Register::kExponentOffset)); | |
1511 break; | 1505 break; |
1512 case kS390_DoubleInsertLowWord32: | 1506 case kS390_DoubleInsertLowWord32: |
1513 __ InsertDoubleLow(i.OutputDoubleRegister(), i.InputRegister(1)); | 1507 __ lgdr(kScratchReg, i.OutputDoubleRegister()); |
| 1508 __ lr(kScratchReg, i.InputRegister(1)); |
| 1509 __ ldgr(i.OutputDoubleRegister(), kScratchReg); |
1514 break; | 1510 break; |
1515 case kS390_DoubleInsertHighWord32: | 1511 case kS390_DoubleInsertHighWord32: |
1516 __ InsertDoubleHigh(i.OutputDoubleRegister(), i.InputRegister(1)); | 1512 __ sllg(kScratchReg, i.InputRegister(1), Operand(32)); |
| 1513 __ lgdr(r0, i.OutputDoubleRegister()); |
| 1514 __ lr(kScratchReg, r0); |
| 1515 __ ldgr(i.OutputDoubleRegister(), kScratchReg); |
1517 break; | 1516 break; |
1518 case kS390_DoubleConstruct: | 1517 case kS390_DoubleConstruct: |
1519 // TODO(john.yan): this can cause problem when interrupting, | 1518 __ sllg(kScratchReg, i.InputRegister(0), Operand(32)); |
1520 // use greg->freg instruction | 1519 __ lr(kScratchReg, i.InputRegister(1)); |
1521 #if V8_TARGET_LITTLE_ENDIAN | 1520 |
1522 __ StoreW(i.InputRegister(0), MemOperand(sp, -kDoubleSize / 2)); | 1521 // Bitwise convert from GPR to FPR |
1523 __ StoreW(i.InputRegister(1), MemOperand(sp, -kDoubleSize)); | 1522 __ ldgr(i.OutputDoubleRegister(), kScratchReg); |
1524 #else | |
1525 __ StoreW(i.InputRegister(1), MemOperand(sp, -kDoubleSize / 2)); | |
1526 __ StoreW(i.InputRegister(0), MemOperand(sp, -kDoubleSize)); | |
1527 #endif | |
1528 __ ldy(i.OutputDoubleRegister(), MemOperand(sp, -kDoubleSize)); | |
1529 break; | 1523 break; |
1530 case kS390_LoadWordS8: | 1524 case kS390_LoadWordS8: |
1531 ASSEMBLE_LOAD_INTEGER(LoadlB); | 1525 ASSEMBLE_LOAD_INTEGER(LoadlB); |
1532 #if V8_TARGET_ARCH_S390X | 1526 #if V8_TARGET_ARCH_S390X |
1533 __ lgbr(i.OutputRegister(), i.OutputRegister()); | 1527 __ lgbr(i.OutputRegister(), i.OutputRegister()); |
1534 #else | 1528 #else |
1535 __ lbr(i.OutputRegister(), i.OutputRegister()); | 1529 __ lbr(i.OutputRegister(), i.OutputRegister()); |
1536 #endif | 1530 #endif |
1537 break; | 1531 break; |
1538 case kS390_BitcastFloat32ToInt32: | 1532 case kS390_BitcastFloat32ToInt32: |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 padding_size -= 2; | 2117 padding_size -= 2; |
2124 } | 2118 } |
2125 } | 2119 } |
2126 } | 2120 } |
2127 | 2121 |
2128 #undef __ | 2122 #undef __ |
2129 | 2123 |
2130 } // namespace compiler | 2124 } // namespace compiler |
2131 } // namespace internal | 2125 } // namespace internal |
2132 } // namespace v8 | 2126 } // namespace v8 |
OLD | NEW |