OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 <stdarg.h> | 5 #include <stdarg.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #if V8_TARGET_ARCH_S390 | 9 #if V8_TARGET_ARCH_S390 |
10 | 10 |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 EvalTable[CGF] = &Simulator::Evaluate_CGF; | 1293 EvalTable[CGF] = &Simulator::Evaluate_CGF; |
1294 EvalTable[CLGF] = &Simulator::Evaluate_CLGF; | 1294 EvalTable[CLGF] = &Simulator::Evaluate_CLGF; |
1295 EvalTable[LTGF] = &Simulator::Evaluate_LTGF; | 1295 EvalTable[LTGF] = &Simulator::Evaluate_LTGF; |
1296 EvalTable[CGH] = &Simulator::Evaluate_CGH; | 1296 EvalTable[CGH] = &Simulator::Evaluate_CGH; |
1297 EvalTable[PFD] = &Simulator::Evaluate_PFD; | 1297 EvalTable[PFD] = &Simulator::Evaluate_PFD; |
1298 EvalTable[STRV] = &Simulator::Evaluate_STRV; | 1298 EvalTable[STRV] = &Simulator::Evaluate_STRV; |
1299 EvalTable[STRVH] = &Simulator::Evaluate_STRVH; | 1299 EvalTable[STRVH] = &Simulator::Evaluate_STRVH; |
1300 EvalTable[BCTG] = &Simulator::Evaluate_BCTG; | 1300 EvalTable[BCTG] = &Simulator::Evaluate_BCTG; |
1301 EvalTable[STY] = &Simulator::Evaluate_STY; | 1301 EvalTable[STY] = &Simulator::Evaluate_STY; |
1302 EvalTable[MSY] = &Simulator::Evaluate_MSY; | 1302 EvalTable[MSY] = &Simulator::Evaluate_MSY; |
| 1303 EvalTable[MSC] = &Simulator::Evaluate_MSC; |
1303 EvalTable[NY] = &Simulator::Evaluate_NY; | 1304 EvalTable[NY] = &Simulator::Evaluate_NY; |
1304 EvalTable[CLY] = &Simulator::Evaluate_CLY; | 1305 EvalTable[CLY] = &Simulator::Evaluate_CLY; |
1305 EvalTable[OY] = &Simulator::Evaluate_OY; | 1306 EvalTable[OY] = &Simulator::Evaluate_OY; |
1306 EvalTable[XY] = &Simulator::Evaluate_XY; | 1307 EvalTable[XY] = &Simulator::Evaluate_XY; |
1307 EvalTable[LY] = &Simulator::Evaluate_LY; | 1308 EvalTable[LY] = &Simulator::Evaluate_LY; |
1308 EvalTable[CY] = &Simulator::Evaluate_CY; | 1309 EvalTable[CY] = &Simulator::Evaluate_CY; |
1309 EvalTable[AY] = &Simulator::Evaluate_AY; | 1310 EvalTable[AY] = &Simulator::Evaluate_AY; |
1310 EvalTable[SY] = &Simulator::Evaluate_SY; | 1311 EvalTable[SY] = &Simulator::Evaluate_SY; |
1311 EvalTable[MFY] = &Simulator::Evaluate_MFY; | 1312 EvalTable[MFY] = &Simulator::Evaluate_MFY; |
1312 EvalTable[ALY] = &Simulator::Evaluate_ALY; | 1313 EvalTable[ALY] = &Simulator::Evaluate_ALY; |
(...skipping 6837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8150 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 8151 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
8151 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 8152 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
8152 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 8153 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
8153 intptr_t d2_val = d2; | 8154 intptr_t d2_val = d2; |
8154 int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); | 8155 int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); |
8155 int32_t r1_val = get_low_register<int32_t>(r1); | 8156 int32_t r1_val = get_low_register<int32_t>(r1); |
8156 set_low_register(r1, mem_val * r1_val); | 8157 set_low_register(r1, mem_val * r1_val); |
8157 return length; | 8158 return length; |
8158 } | 8159 } |
8159 | 8160 |
| 8161 EVALUATE(MSC) { |
| 8162 DCHECK_OPCODE(MSC); |
| 8163 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
| 8164 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
| 8165 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
| 8166 intptr_t d2_val = d2; |
| 8167 int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); |
| 8168 int32_t r1_val = get_low_register<int32_t>(r1); |
| 8169 int64_t result64 = |
| 8170 static_cast<int64_t>(r1_val) * static_cast<int64_t>(mem_val); |
| 8171 int32_t result32 = static_cast<int32_t>(result64); |
| 8172 bool isOF = (static_cast<int64_t>(result32) != result64); |
| 8173 SetS390ConditionCode<int32_t>(result32, 0); |
| 8174 SetS390OverflowCode(isOF); |
| 8175 set_low_register(r1, result32); |
| 8176 set_low_register(r1, mem_val * r1_val); |
| 8177 return length; |
| 8178 } |
| 8179 |
8160 EVALUATE(NY) { | 8180 EVALUATE(NY) { |
8161 DCHECK_OPCODE(NY); | 8181 DCHECK_OPCODE(NY); |
8162 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 8182 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
8163 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 8183 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
8164 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 8184 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
8165 int32_t alu_out = get_low_register<int32_t>(r1); | 8185 int32_t alu_out = get_low_register<int32_t>(r1); |
8166 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | 8186 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); |
8167 alu_out &= mem_val; | 8187 alu_out &= mem_val; |
8168 SetS390BitWiseConditionCode<uint32_t>(alu_out); | 8188 SetS390BitWiseConditionCode<uint32_t>(alu_out); |
8169 set_low_register(r1, alu_out); | 8189 set_low_register(r1, alu_out); |
(...skipping 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9825 return 0; | 9845 return 0; |
9826 } | 9846 } |
9827 | 9847 |
9828 #undef EVALUATE | 9848 #undef EVALUATE |
9829 | 9849 |
9830 } // namespace internal | 9850 } // namespace internal |
9831 } // namespace v8 | 9851 } // namespace v8 |
9832 | 9852 |
9833 #endif // USE_SIMULATOR | 9853 #endif // USE_SIMULATOR |
9834 #endif // V8_TARGET_ARCH_S390 | 9854 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |