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 5930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5941 int r1 = AS(RSInstruction)->R1Value(); \ | 5941 int r1 = AS(RSInstruction)->R1Value(); \ |
5942 int d2 = AS(RSInstruction)->D2Value(); \ | 5942 int d2 = AS(RSInstruction)->D2Value(); \ |
5943 int length = 4; | 5943 int length = 4; |
5944 | 5944 |
5945 #define DECODE_SI_INSTRUCTION_I_UINT8(b1, d1_val, imm_val) \ | 5945 #define DECODE_SI_INSTRUCTION_I_UINT8(b1, d1_val, imm_val) \ |
5946 int b1 = AS(SIInstruction)->B1Value(); \ | 5946 int b1 = AS(SIInstruction)->B1Value(); \ |
5947 intptr_t d1_val = AS(SIInstruction)->D1Value(); \ | 5947 intptr_t d1_val = AS(SIInstruction)->D1Value(); \ |
5948 uint8_t imm_val = AS(SIInstruction)->I2Value(); \ | 5948 uint8_t imm_val = AS(SIInstruction)->I2Value(); \ |
5949 int length = 4; | 5949 int length = 4; |
5950 | 5950 |
5951 #define DECODE_SIL_INSTRUCTION(b1, d1, i2) \ | |
5952 int b1 = AS(SILInstruction)->B1Value(); \ | |
5953 intptr_t d1 = AS(SILInstruction)->D1Value(); \ | |
5954 int16_t i2 = AS(SILInstruction)->I2Value(); \ | |
5955 int length = 6; | |
5956 | |
5957 #define DECODE_SIY_INSTRUCTION(b1, d1, i2) \ | |
5958 int b1 = AS(SIYInstruction)->B1Value(); \ | |
5959 intptr_t d1 = AS(SIYInstruction)->D1Value(); \ | |
5960 uint8_t i2 = AS(SIYInstruction)->I2Value(); \ | |
5961 int length = 6; | |
5962 | |
5951 #define DECODE_RRE_INSTRUCTION(r1, r2) \ | 5963 #define DECODE_RRE_INSTRUCTION(r1, r2) \ |
5952 int r1 = AS(RREInstruction)->R1Value(); \ | 5964 int r1 = AS(RREInstruction)->R1Value(); \ |
5953 int r2 = AS(RREInstruction)->R2Value(); \ | 5965 int r2 = AS(RREInstruction)->R2Value(); \ |
5954 int length = 4; | 5966 int length = 4; |
5955 | 5967 |
5956 #define DECODE_RRE_INSTRUCTION_NO_R2(r1) \ | 5968 #define DECODE_RRE_INSTRUCTION_NO_R2(r1) \ |
5957 int r1 = AS(RREInstruction)->R1Value(); \ | 5969 int r1 = AS(RREInstruction)->R1Value(); \ |
5958 int length = 4; | 5970 int length = 4; |
5959 | 5971 |
5960 #define DECODE_RRD_INSTRUCTION(r1, r2, r3) \ | 5972 #define DECODE_RRD_INSTRUCTION(r1, r2, r3) \ |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6010 #define DECODE_RI_B_INSTRUCTION(instr, r1, i2) \ | 6022 #define DECODE_RI_B_INSTRUCTION(instr, r1, i2) \ |
6011 int32_t r1 = AS(RILInstruction)->R1Value(); \ | 6023 int32_t r1 = AS(RILInstruction)->R1Value(); \ |
6012 int16_t i2 = AS(RILInstruction)->I2Value(); \ | 6024 int16_t i2 = AS(RILInstruction)->I2Value(); \ |
6013 int length = 4; | 6025 int length = 4; |
6014 | 6026 |
6015 #define DECODE_RI_C_INSTRUCTION(instr, m1, i2) \ | 6027 #define DECODE_RI_C_INSTRUCTION(instr, m1, i2) \ |
6016 Condition m1 = static_cast<Condition>(AS(RIInstruction)->R1Value()); \ | 6028 Condition m1 = static_cast<Condition>(AS(RIInstruction)->R1Value()); \ |
6017 int16_t i2 = AS(RIInstruction)->I2Value(); \ | 6029 int16_t i2 = AS(RIInstruction)->I2Value(); \ |
6018 int length = 4; | 6030 int length = 4; |
6019 | 6031 |
6032 #define DECODE_RXE_INSTRUCTION(r1, b2, x2, d2) \ | |
6033 int r1 = AS(RXEInstruction)->R1Value(); \ | |
6034 int b2 = AS(RXEInstruction)->B2Value(); \ | |
6035 int x2 = AS(RXEInstruction)->X2Value(); \ | |
6036 int d2 = AS(RXEInstruction)->D2Value(); \ | |
6037 int length = 6; | |
6038 | |
6020 #define GET_ADDRESS(index_reg, base_reg, offset) \ | 6039 #define GET_ADDRESS(index_reg, base_reg, offset) \ |
6021 (((index_reg) == 0) ? 0 : get_register(index_reg)) + \ | 6040 (((index_reg) == 0) ? 0 : get_register(index_reg)) + \ |
6022 (((base_reg) == 0) ? 0 : get_register(base_reg)) + offset | 6041 (((base_reg) == 0) ? 0 : get_register(base_reg)) + offset |
6023 | 6042 |
6024 int Simulator::Evaluate_Unknown(Instruction* instr) { | 6043 int Simulator::Evaluate_Unknown(Instruction* instr) { |
6025 UNREACHABLE(); | 6044 UNREACHABLE(); |
6026 return 0; | 6045 return 0; |
6027 } | 6046 } |
6028 | 6047 |
6029 EVALUATE(CLR) { | 6048 EVALUATE(CLR) { |
(...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9157 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9176 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9158 // Miscellaneous Loads and Stores | 9177 // Miscellaneous Loads and Stores |
9159 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9178 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9160 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9179 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9161 intptr_t addr = x2_val + b2_val + d2; | 9180 intptr_t addr = x2_val + b2_val + d2; |
9162 int64_t mem_val = static_cast<int64_t>(ReadH(addr, instr)); | 9181 int64_t mem_val = static_cast<int64_t>(ReadH(addr, instr)); |
9163 set_register(r1, mem_val); | 9182 set_register(r1, mem_val); |
9164 return length; | 9183 return length; |
9165 } | 9184 } |
9166 | 9185 |
9167 EVALUATE(LLGF) { return DecodeInstructionOriginal(instr); } | 9186 EVALUATE(LLGF) { |
9187 DCHECK_OPCODE(LLGF); | |
9188 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9189 // Miscellaneous Loads and Stores | |
9190 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9191 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9192 intptr_t addr = x2_val + b2_val + d2; | |
9193 uint64_t mem_val = static_cast<uint64_t>(ReadWU(addr, instr)); | |
9194 set_register(r1, mem_val); | |
9195 return length; | |
9196 } | |
9168 | 9197 |
9169 EVALUATE(LLGT) { return DecodeInstructionOriginal(instr); } | 9198 EVALUATE(LLGT) { return DecodeInstructionOriginal(instr); } |
9170 | 9199 |
9171 EVALUATE(AGF) { return DecodeInstructionOriginal(instr); } | 9200 EVALUATE(AGF) { |
9201 DCHECK_OPCODE(AGF); | |
9202 #ifndef V8_TARGET_ARCH_S390X | |
9203 DCHECK(false); | |
JoranSiu
2016/05/18 23:06:49
I don't think we need these #ifndef ... these inst
| |
9204 #endif | |
9205 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9206 uint64_t r1_val = get_register(r1); | |
9207 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9208 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9209 intptr_t d2_val = d2; | |
9210 uint64_t alu_out = r1_val; | |
9211 uint32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); | |
9212 alu_out += mem_val; | |
9213 SetS390ConditionCode<int64_t>(alu_out, 0); | |
9214 set_register(r1, alu_out); | |
9215 return length; | |
9216 } | |
9172 | 9217 |
9173 EVALUATE(SGF) { return DecodeInstructionOriginal(instr); } | 9218 EVALUATE(SGF) { |
9219 DCHECK_OPCODE(SGF); | |
9220 #ifndef V8_TARGET_ARCH_S390X | |
JoranSiu
2016/05/18 23:06:49
same as above
| |
9221 DCHECK(false); | |
9222 #endif | |
9223 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9224 uint64_t r1_val = get_register(r1); | |
9225 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9226 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9227 intptr_t d2_val = d2; | |
9228 uint64_t alu_out = r1_val; | |
9229 uint32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); | |
9230 alu_out -= mem_val; | |
9231 SetS390ConditionCode<int64_t>(alu_out, 0); | |
9232 set_register(r1, alu_out); | |
9233 return length; | |
9234 } | |
9174 | 9235 |
9175 EVALUATE(ALGF) { return DecodeInstructionOriginal(instr); } | 9236 EVALUATE(ALGF) { return DecodeInstructionOriginal(instr); } |
9176 | 9237 |
9177 EVALUATE(SLGF) { return DecodeInstructionOriginal(instr); } | 9238 EVALUATE(SLGF) { return DecodeInstructionOriginal(instr); } |
9178 | 9239 |
9179 EVALUATE(MSGF) { return DecodeInstructionOriginal(instr); } | 9240 EVALUATE(MSGF) { return DecodeInstructionOriginal(instr); } |
9180 | 9241 |
9181 EVALUATE(DSGF) { return DecodeInstructionOriginal(instr); } | 9242 EVALUATE(DSGF) { return DecodeInstructionOriginal(instr); } |
9182 | 9243 |
9183 EVALUATE(LRV) { return DecodeInstructionOriginal(instr); } | 9244 EVALUATE(LRV) { |
9245 DCHECK_OPCODE(LRV); | |
9246 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9247 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9248 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9249 intptr_t mem_addr = b2_val + x2_val + d2; | |
9250 int32_t mem_val = ReadW(mem_addr, instr); | |
9251 set_low_register(r1, ByteReverse(mem_val)); | |
9252 return length; | |
9253 } | |
9184 | 9254 |
9185 EVALUATE(LRVH) { return DecodeInstructionOriginal(instr); } | 9255 EVALUATE(LRVH) { |
9256 DCHECK_OPCODE(LRVH); | |
9257 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9258 int32_t r1_val = get_low_register<int32_t>(r1); | |
9259 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9260 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9261 intptr_t mem_addr = b2_val + x2_val + d2; | |
9262 int16_t mem_val = ReadH(mem_addr, instr); | |
9263 int32_t result = ByteReverse(mem_val) & 0x0000ffff; | |
9264 result |= r1_val & 0xffff0000; | |
9265 set_low_register(r1, result); | |
9266 return length; | |
9267 } | |
9186 | 9268 |
9187 EVALUATE(CG) { return DecodeInstructionOriginal(instr); } | 9269 EVALUATE(CG) { |
9270 DCHECK_OPCODE(CG); | |
9271 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9272 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9273 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9274 int64_t alu_out = get_register(r1); | |
9275 int64_t mem_val = ReadDW(b2_val + x2_val + d2); | |
9276 SetS390ConditionCode<int64_t>(alu_out, mem_val); | |
9277 set_register(r1, alu_out); | |
9278 return length; | |
9279 } | |
9188 | 9280 |
9189 EVALUATE(CLG) { return DecodeInstructionOriginal(instr); } | 9281 EVALUATE(CLG) { |
9282 DCHECK_OPCODE(CLG); | |
9283 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9284 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9285 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9286 int64_t alu_out = get_register(r1); | |
9287 int64_t mem_val = ReadDW(b2_val + x2_val + d2); | |
9288 SetS390ConditionCode<uint64_t>(alu_out, mem_val); | |
9289 set_register(r1, alu_out); | |
9290 return length; | |
9291 } | |
9190 | 9292 |
9191 EVALUATE(NTSTG) { return DecodeInstructionOriginal(instr); } | 9293 EVALUATE(NTSTG) { return DecodeInstructionOriginal(instr); } |
9192 | 9294 |
9193 EVALUATE(CVDY) { return DecodeInstructionOriginal(instr); } | 9295 EVALUATE(CVDY) { return DecodeInstructionOriginal(instr); } |
9194 | 9296 |
9195 EVALUATE(CVDG) { return DecodeInstructionOriginal(instr); } | 9297 EVALUATE(CVDG) { return DecodeInstructionOriginal(instr); } |
9196 | 9298 |
9197 EVALUATE(STRVG) { return DecodeInstructionOriginal(instr); } | 9299 EVALUATE(STRVG) { return DecodeInstructionOriginal(instr); } |
9198 | 9300 |
9199 EVALUATE(CGF) { return DecodeInstructionOriginal(instr); } | 9301 EVALUATE(CGF) { return DecodeInstructionOriginal(instr); } |
9200 | 9302 |
9201 EVALUATE(CLGF) { return DecodeInstructionOriginal(instr); } | 9303 EVALUATE(CLGF) { return DecodeInstructionOriginal(instr); } |
9202 | 9304 |
9203 EVALUATE(LTGF) { return DecodeInstructionOriginal(instr); } | 9305 EVALUATE(LTGF) { return DecodeInstructionOriginal(instr); } |
9204 | 9306 |
9205 EVALUATE(CGH) { return DecodeInstructionOriginal(instr); } | 9307 EVALUATE(CGH) { return DecodeInstructionOriginal(instr); } |
9206 | 9308 |
9207 EVALUATE(PFD) { return DecodeInstructionOriginal(instr); } | 9309 EVALUATE(PFD) { return DecodeInstructionOriginal(instr); } |
9208 | 9310 |
9209 EVALUATE(STRV) { return DecodeInstructionOriginal(instr); } | 9311 EVALUATE(STRV) { |
9312 DCHECK_OPCODE(STRV); | |
9313 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9314 int32_t r1_val = get_low_register<int32_t>(r1); | |
9315 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9316 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9317 intptr_t mem_addr = b2_val + x2_val + d2; | |
9318 WriteW(mem_addr, ByteReverse(r1_val), instr); | |
9319 return length; | |
9320 } | |
9210 | 9321 |
9211 EVALUATE(STRVH) { return DecodeInstructionOriginal(instr); } | 9322 EVALUATE(STRVH) { |
9323 DCHECK_OPCODE(STRVH); | |
9324 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9325 int32_t r1_val = get_low_register<int32_t>(r1); | |
9326 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9327 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9328 intptr_t mem_addr = b2_val + x2_val + d2; | |
9329 int16_t result = static_cast<int16_t>(r1_val >> 16); | |
9330 WriteH(mem_addr, ByteReverse(result), instr); | |
9331 return length; | |
9332 } | |
9212 | 9333 |
9213 EVALUATE(BCTG) { return DecodeInstructionOriginal(instr); } | 9334 EVALUATE(BCTG) { return DecodeInstructionOriginal(instr); } |
9214 | 9335 |
9215 EVALUATE(MSY) { | 9336 EVALUATE(MSY) { |
9216 DCHECK_OPCODE(MSY); | 9337 DCHECK_OPCODE(MSY); |
9217 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9338 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9218 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9339 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9219 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9340 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9220 intptr_t d2_val = d2; | 9341 intptr_t d2_val = d2; |
9221 int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); | 9342 int32_t mem_val = ReadW(b2_val + d2_val + x2_val, instr); |
9222 int32_t r1_val = get_low_register<int32_t>(r1); | 9343 int32_t r1_val = get_low_register<int32_t>(r1); |
9223 set_low_register(r1, mem_val * r1_val); | 9344 set_low_register(r1, mem_val * r1_val); |
9224 return length; | 9345 return length; |
9225 } | 9346 } |
9226 | 9347 |
9227 EVALUATE(NY) { return DecodeInstructionOriginal(instr); } | 9348 EVALUATE(NY) { |
9349 DCHECK_OPCODE(NY); | |
9350 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9351 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9352 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9353 int32_t alu_out = get_low_register<int32_t>(r1); | |
9354 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9355 alu_out &= mem_val; | |
9356 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9357 set_low_register(r1, alu_out); | |
9358 return length; | |
9359 } | |
9228 | 9360 |
9229 EVALUATE(CLY) { return DecodeInstructionOriginal(instr); } | 9361 EVALUATE(CLY) { |
9362 DCHECK_OPCODE(CLY); | |
9363 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9364 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9365 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9366 uint32_t alu_out = get_low_register<uint32_t>(r1); | |
9367 uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr); | |
9368 SetS390ConditionCode<uint32_t>(alu_out, mem_val); | |
9369 return length; | |
9370 } | |
9230 | 9371 |
9231 EVALUATE(OY) { return DecodeInstructionOriginal(instr); } | 9372 EVALUATE(OY) { |
9373 DCHECK_OPCODE(OY); | |
9374 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9375 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9376 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9377 int32_t alu_out = get_low_register<int32_t>(r1); | |
9378 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9379 alu_out |= mem_val; | |
9380 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9381 set_low_register(r1, alu_out); | |
9382 return length; | |
9383 } | |
9232 | 9384 |
9233 EVALUATE(XY) { return DecodeInstructionOriginal(instr); } | 9385 EVALUATE(XY) { |
9386 DCHECK_OPCODE(XY); | |
9387 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9388 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9389 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9390 int32_t alu_out = get_low_register<int32_t>(r1); | |
9391 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9392 alu_out ^= mem_val; | |
9393 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9394 set_low_register(r1, alu_out); | |
9395 return length; | |
9396 } | |
9234 | 9397 |
9235 EVALUATE(CY) { return DecodeInstructionOriginal(instr); } | 9398 EVALUATE(CY) { |
9399 DCHECK_OPCODE(CY); | |
9400 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9401 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9402 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9403 int32_t alu_out = get_low_register<int32_t>(r1); | |
9404 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9405 SetS390ConditionCode<int32_t>(alu_out, mem_val); | |
9406 return length; | |
9407 } | |
9236 | 9408 |
9237 EVALUATE(AY) { return DecodeInstructionOriginal(instr); } | 9409 EVALUATE(AY) { |
9410 DCHECK_OPCODE(AY); | |
9411 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9412 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9413 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9414 int32_t alu_out = get_low_register<int32_t>(r1); | |
9415 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9416 bool isOF = false; | |
9417 isOF = CheckOverflowForIntAdd(alu_out, mem_val, int32_t); | |
9418 alu_out += mem_val; | |
9419 SetS390ConditionCode<int32_t>(alu_out, 0); | |
9420 SetS390OverflowCode(isOF); | |
9421 set_low_register(r1, alu_out); | |
9422 return length; | |
9423 } | |
9238 | 9424 |
9239 EVALUATE(SY) { return DecodeInstructionOriginal(instr); } | 9425 EVALUATE(SY) { |
9426 DCHECK_OPCODE(SY); | |
9427 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9428 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9429 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9430 int32_t alu_out = get_low_register<int32_t>(r1); | |
9431 int32_t mem_val = ReadW(b2_val + x2_val + d2, instr); | |
9432 bool isOF = false; | |
9433 isOF = CheckOverflowForIntSub(alu_out, mem_val, int32_t); | |
9434 alu_out -= mem_val; | |
9435 SetS390ConditionCode<int32_t>(alu_out, 0); | |
9436 SetS390OverflowCode(isOF); | |
9437 set_low_register(r1, alu_out); | |
9438 return length; | |
9439 } | |
9240 | 9440 |
9241 EVALUATE(MFY) { return DecodeInstructionOriginal(instr); } | 9441 EVALUATE(MFY) { return DecodeInstructionOriginal(instr); } |
9242 | 9442 |
9243 EVALUATE(ALY) { return DecodeInstructionOriginal(instr); } | 9443 EVALUATE(ALY) { |
9444 DCHECK_OPCODE(ALY); | |
9445 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9446 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9447 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9448 uint32_t alu_out = get_low_register<uint32_t>(r1); | |
9449 uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr); | |
9450 alu_out += mem_val; | |
9451 set_low_register(r1, alu_out); | |
9452 SetS390ConditionCode<uint32_t>(alu_out, 0); | |
9453 return length; | |
9454 } | |
9244 | 9455 |
9245 EVALUATE(SLY) { return DecodeInstructionOriginal(instr); } | 9456 EVALUATE(SLY) { |
9457 DCHECK_OPCODE(SLY); | |
9458 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9459 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9460 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9461 uint32_t alu_out = get_low_register<uint32_t>(r1); | |
9462 uint32_t mem_val = ReadWU(b2_val + x2_val + d2, instr); | |
9463 alu_out -= mem_val; | |
9464 set_low_register(r1, alu_out); | |
9465 SetS390ConditionCode<uint32_t>(alu_out, 0); | |
9466 return length; | |
9467 } | |
9246 | 9468 |
9247 EVALUATE(STHY) { | 9469 EVALUATE(STHY) { |
9248 DCHECK_OPCODE(STHY); | 9470 DCHECK_OPCODE(STHY); |
9249 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9471 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9250 // Miscellaneous Loads and Stores | 9472 // Miscellaneous Loads and Stores |
9251 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9473 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9252 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9474 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9253 intptr_t addr = x2_val + b2_val + d2; | 9475 intptr_t addr = x2_val + b2_val + d2; |
9254 uint16_t value = get_low_register<uint32_t>(r1); | 9476 uint16_t value = get_low_register<uint32_t>(r1); |
9255 WriteH(addr, value, instr); | 9477 WriteH(addr, value, instr); |
9256 return length; | 9478 return length; |
9257 } | 9479 } |
9258 | 9480 |
9259 EVALUATE(LAY) { return DecodeInstructionOriginal(instr); } | 9481 EVALUATE(LAY) { |
9482 DCHECK_OPCODE(LAY); | |
9483 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9484 // Load Address | |
9485 int rb = b2; | |
9486 int rx = x2; | |
9487 int offset = d2; | |
9488 int64_t rb_val = (rb == 0) ? 0 : get_register(rb); | |
9489 int64_t rx_val = (rx == 0) ? 0 : get_register(rx); | |
9490 set_register(r1, rx_val + rb_val + offset); | |
9491 return length; | |
9492 } | |
9260 | 9493 |
9261 EVALUATE(STCY) { | 9494 EVALUATE(STCY) { |
9262 DCHECK_OPCODE(STCY); | 9495 DCHECK_OPCODE(STCY); |
9263 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9496 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9264 // Miscellaneous Loads and Stores | 9497 // Miscellaneous Loads and Stores |
9265 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9498 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9266 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9499 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9267 intptr_t addr = x2_val + b2_val + d2; | 9500 intptr_t addr = x2_val + b2_val + d2; |
9268 uint8_t value = get_low_register<uint32_t>(r1); | 9501 uint8_t value = get_low_register<uint32_t>(r1); |
9269 WriteB(addr, value); | 9502 WriteB(addr, value); |
9270 return length; | 9503 return length; |
9271 } | 9504 } |
9272 | 9505 |
9273 EVALUATE(ICY) { return DecodeInstructionOriginal(instr); } | 9506 EVALUATE(ICY) { return DecodeInstructionOriginal(instr); } |
9274 | 9507 |
9275 EVALUATE(LAEY) { return DecodeInstructionOriginal(instr); } | 9508 EVALUATE(LAEY) { return DecodeInstructionOriginal(instr); } |
9276 | 9509 |
9277 EVALUATE(LB) { return DecodeInstructionOriginal(instr); } | 9510 EVALUATE(LB) { |
9511 DCHECK_OPCODE(LB); | |
9512 // Miscellaneous Loads and Stores | |
9513 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9514 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9515 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9516 intptr_t addr = x2_val + b2_val + d2; | |
9517 int32_t mem_val = ReadB(addr); | |
9518 set_low_register(r1, mem_val); | |
9519 return length; | |
9520 } | |
9278 | 9521 |
9279 EVALUATE(LGB) { | 9522 EVALUATE(LGB) { |
9280 DCHECK_OPCODE(LGB); | 9523 DCHECK_OPCODE(LGB); |
9281 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9524 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9282 // Miscellaneous Loads and Stores | 9525 // Miscellaneous Loads and Stores |
9283 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9526 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9284 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9527 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9285 intptr_t addr = x2_val + b2_val + d2; | 9528 intptr_t addr = x2_val + b2_val + d2; |
9286 int64_t mem_val = ReadB(addr); | 9529 int64_t mem_val = ReadB(addr); |
9287 set_register(r1, mem_val); | 9530 set_register(r1, mem_val); |
9288 return length; | 9531 return length; |
9289 } | 9532 } |
9290 | 9533 |
9291 EVALUATE(LHY) { | 9534 EVALUATE(LHY) { |
9292 DCHECK_OPCODE(LHY); | 9535 DCHECK_OPCODE(LHY); |
9293 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | 9536 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
9294 // Miscellaneous Loads and Stores | 9537 // Miscellaneous Loads and Stores |
9295 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | 9538 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); |
9296 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | 9539 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); |
9297 intptr_t addr = x2_val + b2_val + d2; | 9540 intptr_t addr = x2_val + b2_val + d2; |
9298 int32_t result = static_cast<int32_t>(ReadH(addr, instr)); | 9541 int32_t result = static_cast<int32_t>(ReadH(addr, instr)); |
9299 set_low_register(r1, result); | 9542 set_low_register(r1, result); |
9300 return length; | 9543 return length; |
9301 } | 9544 } |
9302 | 9545 |
9303 EVALUATE(CHY) { return DecodeInstructionOriginal(instr); } | 9546 EVALUATE(CHY) { return DecodeInstructionOriginal(instr); } |
9304 | 9547 |
9305 EVALUATE(AHY) { return DecodeInstructionOriginal(instr); } | 9548 EVALUATE(AHY) { |
9549 DCHECK_OPCODE(AHY); | |
9550 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9551 int32_t r1_val = get_low_register<int32_t>(r1); | |
9552 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9553 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9554 intptr_t d2_val = d2; | |
9555 int32_t mem_val = | |
9556 static_cast<int32_t>(ReadH(b2_val + d2_val + x2_val, instr)); | |
9557 int32_t alu_out = 0; | |
9558 bool isOF = false; | |
9559 alu_out = r1_val + mem_val; | |
9560 isOF = CheckOverflowForIntAdd(r1_val, mem_val, int32_t); | |
9561 set_low_register(r1, alu_out); | |
9562 SetS390ConditionCode<int32_t>(alu_out, 0); | |
9563 SetS390OverflowCode(isOF); | |
9564 return length; | |
9565 } | |
9306 | 9566 |
9307 EVALUATE(SHY) { return DecodeInstructionOriginal(instr); } | 9567 EVALUATE(SHY) { |
9568 DCHECK_OPCODE(SHY); | |
9569 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9570 int32_t r1_val = get_low_register<int32_t>(r1); | |
9571 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9572 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9573 intptr_t d2_val = d2; | |
9574 int32_t mem_val = | |
9575 static_cast<int32_t>(ReadH(b2_val + d2_val + x2_val, instr)); | |
9576 int32_t alu_out = 0; | |
9577 bool isOF = false; | |
9578 alu_out = r1_val - mem_val; | |
9579 isOF = CheckOverflowForIntSub(r1_val, mem_val, int64_t); | |
9580 set_low_register(r1, alu_out); | |
9581 SetS390ConditionCode<int32_t>(alu_out, 0); | |
9582 SetS390OverflowCode(isOF); | |
9583 return length; | |
9584 } | |
9308 | 9585 |
9309 EVALUATE(MHY) { return DecodeInstructionOriginal(instr); } | 9586 EVALUATE(MHY) { return DecodeInstructionOriginal(instr); } |
9310 | 9587 |
9311 EVALUATE(NG) { return DecodeInstructionOriginal(instr); } | 9588 EVALUATE(NG) { |
9589 DCHECK_OPCODE(NG); | |
9590 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9591 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9592 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9593 int64_t alu_out = get_register(r1); | |
9594 int64_t mem_val = ReadDW(b2_val + x2_val + d2); | |
9595 alu_out &= mem_val; | |
9596 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9597 set_register(r1, alu_out); | |
9598 return length; | |
9599 } | |
9312 | 9600 |
9313 EVALUATE(OG) { return DecodeInstructionOriginal(instr); } | 9601 EVALUATE(OG) { |
9602 DCHECK_OPCODE(OG); | |
9603 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9604 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9605 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9606 int64_t alu_out = get_register(r1); | |
9607 int64_t mem_val = ReadDW(b2_val + x2_val + d2); | |
9608 alu_out |= mem_val; | |
9609 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9610 set_register(r1, alu_out); | |
9611 return length; | |
9612 } | |
9314 | 9613 |
9315 EVALUATE(XG) { return DecodeInstructionOriginal(instr); } | 9614 EVALUATE(XG) { |
9615 DCHECK_OPCODE(XG); | |
9616 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9617 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9618 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9619 int64_t alu_out = get_register(r1); | |
9620 int64_t mem_val = ReadDW(b2_val + x2_val + d2); | |
9621 alu_out ^= mem_val; | |
9622 SetS390BitWiseConditionCode<uint32_t>(alu_out); | |
9623 set_register(r1, alu_out); | |
9624 return length; | |
9625 } | |
9316 | 9626 |
9317 EVALUATE(LGAT) { return DecodeInstructionOriginal(instr); } | 9627 EVALUATE(LGAT) { return DecodeInstructionOriginal(instr); } |
9318 | 9628 |
9319 EVALUATE(MLG) { return DecodeInstructionOriginal(instr); } | 9629 EVALUATE(MLG) { return DecodeInstructionOriginal(instr); } |
9320 | 9630 |
9321 EVALUATE(DLG) { return DecodeInstructionOriginal(instr); } | 9631 EVALUATE(DLG) { return DecodeInstructionOriginal(instr); } |
9322 | 9632 |
9323 EVALUATE(ALCG) { return DecodeInstructionOriginal(instr); } | 9633 EVALUATE(ALCG) { return DecodeInstructionOriginal(instr); } |
9324 | 9634 |
9325 EVALUATE(SLBG) { return DecodeInstructionOriginal(instr); } | 9635 EVALUATE(SLBG) { return DecodeInstructionOriginal(instr); } |
9326 | 9636 |
9327 EVALUATE(STPQ) { return DecodeInstructionOriginal(instr); } | 9637 EVALUATE(STPQ) { return DecodeInstructionOriginal(instr); } |
9328 | 9638 |
9329 EVALUATE(LPQ) { return DecodeInstructionOriginal(instr); } | 9639 EVALUATE(LPQ) { return DecodeInstructionOriginal(instr); } |
9330 | 9640 |
9331 EVALUATE(LLGH) { return DecodeInstructionOriginal(instr); } | 9641 EVALUATE(LLGH) { |
9642 DCHECK_OPCODE(LLGH); | |
9643 // Load Logical Halfword | |
9644 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9645 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9646 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9647 intptr_t d2_val = d2; | |
9648 uint16_t mem_val = ReadHU(b2_val + d2_val + x2_val, instr); | |
9649 set_register(r1, mem_val); | |
9650 return length; | |
9651 } | |
9332 | 9652 |
9333 EVALUATE(LLH) { return DecodeInstructionOriginal(instr); } | 9653 EVALUATE(LLH) { |
9654 DCHECK_OPCODE(LLH); | |
9655 // Load Logical Halfword | |
9656 DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); | |
9657 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9658 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
9659 intptr_t d2_val = d2; | |
9660 uint16_t mem_val = ReadHU(b2_val + d2_val + x2_val, instr); | |
9661 set_low_register(r1, mem_val); | |
9662 return length; | |
9663 } | |
9334 | 9664 |
9335 EVALUATE(ML) { return DecodeInstructionOriginal(instr); } | 9665 EVALUATE(ML) { return DecodeInstructionOriginal(instr); } |
9336 | 9666 |
9337 EVALUATE(DL) { return DecodeInstructionOriginal(instr); } | 9667 EVALUATE(DL) { return DecodeInstructionOriginal(instr); } |
9338 | 9668 |
9339 EVALUATE(ALC) { return DecodeInstructionOriginal(instr); } | 9669 EVALUATE(ALC) { return DecodeInstructionOriginal(instr); } |
9340 | 9670 |
9341 EVALUATE(SLB) { return DecodeInstructionOriginal(instr); } | 9671 EVALUATE(SLB) { return DecodeInstructionOriginal(instr); } |
9342 | 9672 |
9343 EVALUATE(LLGTAT) { return DecodeInstructionOriginal(instr); } | 9673 EVALUATE(LLGTAT) { return DecodeInstructionOriginal(instr); } |
(...skipping 19 matching lines...) Expand all Loading... | |
9363 EVALUATE(LFH) { return DecodeInstructionOriginal(instr); } | 9693 EVALUATE(LFH) { return DecodeInstructionOriginal(instr); } |
9364 | 9694 |
9365 EVALUATE(STFH) { return DecodeInstructionOriginal(instr); } | 9695 EVALUATE(STFH) { return DecodeInstructionOriginal(instr); } |
9366 | 9696 |
9367 EVALUATE(CHF) { return DecodeInstructionOriginal(instr); } | 9697 EVALUATE(CHF) { return DecodeInstructionOriginal(instr); } |
9368 | 9698 |
9369 EVALUATE(MVCDK) { return DecodeInstructionOriginal(instr); } | 9699 EVALUATE(MVCDK) { return DecodeInstructionOriginal(instr); } |
9370 | 9700 |
9371 EVALUATE(MVHHI) { return DecodeInstructionOriginal(instr); } | 9701 EVALUATE(MVHHI) { return DecodeInstructionOriginal(instr); } |
9372 | 9702 |
9373 EVALUATE(MVGHI) { return DecodeInstructionOriginal(instr); } | 9703 EVALUATE(MVGHI) { |
9704 DCHECK_OPCODE(MVGHI); | |
9705 // Move Integer (64) | |
9706 DECODE_SIL_INSTRUCTION(b1, d1, i2); | |
9707 int64_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9708 intptr_t src_addr = b1_val + d1; | |
9709 WriteDW(src_addr, i2); | |
9710 return length; | |
9711 } | |
9374 | 9712 |
9375 EVALUATE(MVHI) { return DecodeInstructionOriginal(instr); } | 9713 EVALUATE(MVHI) { |
9714 DCHECK_OPCODE(MVHI); | |
9715 // Move Integer (32) | |
9716 DECODE_SIL_INSTRUCTION(b1, d1, i2); | |
9717 int64_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9718 intptr_t src_addr = b1_val + d1; | |
9719 WriteW(src_addr, i2, instr); | |
9720 return length; | |
9721 } | |
9376 | 9722 |
9377 EVALUATE(CHHSI) { return DecodeInstructionOriginal(instr); } | 9723 EVALUATE(CHHSI) { return DecodeInstructionOriginal(instr); } |
9378 | 9724 |
9379 EVALUATE(CGHSI) { return DecodeInstructionOriginal(instr); } | 9725 EVALUATE(CGHSI) { return DecodeInstructionOriginal(instr); } |
9380 | 9726 |
9381 EVALUATE(CHSI) { return DecodeInstructionOriginal(instr); } | 9727 EVALUATE(CHSI) { return DecodeInstructionOriginal(instr); } |
9382 | 9728 |
9383 EVALUATE(CLFHSI) { return DecodeInstructionOriginal(instr); } | 9729 EVALUATE(CLFHSI) { return DecodeInstructionOriginal(instr); } |
9384 | 9730 |
9385 EVALUATE(TBEGIN) { return DecodeInstructionOriginal(instr); } | 9731 EVALUATE(TBEGIN) { return DecodeInstructionOriginal(instr); } |
9386 | 9732 |
9387 EVALUATE(TBEGINC) { return DecodeInstructionOriginal(instr); } | 9733 EVALUATE(TBEGINC) { return DecodeInstructionOriginal(instr); } |
9388 | 9734 |
9389 EVALUATE(LMG) { return DecodeInstructionOriginal(instr); } | 9735 EVALUATE(LMG) { |
9736 DCHECK_OPCODE(LMG); | |
9737 // Store Multiple 64-bits. | |
9738 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9739 int rb = b2; | |
9740 int offset = d2; | |
9390 | 9741 |
9391 EVALUATE(SRAG) { return DecodeInstructionOriginal(instr); } | 9742 // Regs roll around if r3 is less than r1. |
9743 // Artifically increase r3 by 16 so we can calculate | |
9744 // the number of regs stored properly. | |
9745 if (r3 < r1) r3 += 16; | |
9392 | 9746 |
9393 EVALUATE(SLAG) { return DecodeInstructionOriginal(instr); } | 9747 int64_t rb_val = (rb == 0) ? 0 : get_register(rb); |
9394 | 9748 |
9395 EVALUATE(SRLG) { return DecodeInstructionOriginal(instr); } | 9749 // Store each register in ascending order. |
9750 for (int i = 0; i <= r3 - r1; i++) { | |
9751 int64_t value = ReadDW(rb_val + offset + 8 * i); | |
9752 set_register((r1 + i) % 16, value); | |
9753 } | |
9754 return length; | |
9755 } | |
9396 | 9756 |
9397 EVALUATE(SLLG) { return DecodeInstructionOriginal(instr); } | 9757 EVALUATE(SRAG) { |
9758 DCHECK_OPCODE(SRAG); | |
9759 // 64-bit non-clobbering shift-left/right arithmetic | |
9760 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9761 // only takes rightmost 6 bits | |
9762 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9763 int shiftBits = (b2_val + d2) & 0x3F; | |
9764 int64_t r3_val = get_register(r3); | |
9765 intptr_t alu_out = 0; | |
9766 bool isOF = false; | |
9767 alu_out = r3_val >> shiftBits; | |
9768 set_register(r1, alu_out); | |
9769 SetS390ConditionCode<intptr_t>(alu_out, 0); | |
9770 SetS390OverflowCode(isOF); | |
9771 return length; | |
9772 } | |
9773 | |
9774 EVALUATE(SLAG) { | |
9775 DCHECK_OPCODE(SLAG); | |
9776 // 64-bit non-clobbering shift-left/right arithmetic | |
9777 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9778 // only takes rightmost 6 bits | |
9779 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9780 int shiftBits = (b2_val + d2) & 0x3F; | |
9781 int64_t r3_val = get_register(r3); | |
9782 intptr_t alu_out = 0; | |
9783 bool isOF = false; | |
9784 isOF = CheckOverflowForShiftLeft(r3_val, shiftBits); | |
9785 alu_out = r3_val << shiftBits; | |
9786 set_register(r1, alu_out); | |
9787 SetS390ConditionCode<intptr_t>(alu_out, 0); | |
9788 SetS390OverflowCode(isOF); | |
9789 return length; | |
9790 } | |
9791 | |
9792 EVALUATE(SRLG) { | |
9793 DCHECK_OPCODE(SRLG); | |
9794 // For SLLG/SRLG, the 64-bit third operand is shifted the number | |
9795 // of bits specified by the second-operand address, and the result is | |
9796 // placed at the first-operand location. Except for when the R1 and R3 | |
9797 // fields designate the same register, the third operand remains | |
9798 // unchanged in general register R3. | |
9799 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9800 // only takes rightmost 6 bits | |
9801 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9802 int shiftBits = (b2_val + d2) & 0x3F; | |
9803 // unsigned | |
9804 uint64_t r3_val = get_register(r3); | |
9805 uint64_t alu_out = 0; | |
9806 alu_out = r3_val >> shiftBits; | |
9807 set_register(r1, alu_out); | |
9808 return length; | |
9809 } | |
9810 | |
9811 EVALUATE(SLLG) { | |
9812 DCHECK_OPCODE(SLLG); | |
9813 // For SLLG/SRLG, the 64-bit third operand is shifted the number | |
9814 // of bits specified by the second-operand address, and the result is | |
9815 // placed at the first-operand location. Except for when the R1 and R3 | |
9816 // fields designate the same register, the third operand remains | |
9817 // unchanged in general register R3. | |
9818 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9819 // only takes rightmost 6 bits | |
9820 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9821 int shiftBits = (b2_val + d2) & 0x3F; | |
9822 // unsigned | |
9823 uint64_t r3_val = get_register(r3); | |
9824 uint64_t alu_out = 0; | |
9825 alu_out = r3_val << shiftBits; | |
9826 set_register(r1, alu_out); | |
9827 return length; | |
9828 } | |
9398 | 9829 |
9399 EVALUATE(CSY) { return DecodeInstructionOriginal(instr); } | 9830 EVALUATE(CSY) { return DecodeInstructionOriginal(instr); } |
9400 | 9831 |
9401 EVALUATE(RLLG) { return DecodeInstructionOriginal(instr); } | 9832 EVALUATE(RLLG) { |
9833 DCHECK_OPCODE(RLLG); | |
9834 // For SLLG/SRLG, the 64-bit third operand is shifted the number | |
9835 // of bits specified by the second-operand address, and the result is | |
9836 // placed at the first-operand location. Except for when the R1 and R3 | |
9837 // fields designate the same register, the third operand remains | |
9838 // unchanged in general register R3. | |
9839 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9840 // only takes rightmost 6 bits | |
9841 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
9842 int shiftBits = (b2_val + d2) & 0x3F; | |
9843 // unsigned | |
9844 uint64_t r3_val = get_register(r3); | |
9845 uint64_t alu_out = 0; | |
9846 uint64_t rotateBits = r3_val >> (64 - shiftBits); | |
9847 alu_out = (r3_val << shiftBits) | (rotateBits); | |
9848 set_register(r1, alu_out); | |
9849 return length; | |
9850 } | |
9402 | 9851 |
9403 EVALUATE(STMG) { return DecodeInstructionOriginal(instr); } | 9852 EVALUATE(STMG) { |
9853 DCHECK_OPCODE(STMG); | |
9854 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9855 int rb = b2; | |
9856 int offset = d2; | |
9857 | |
9858 // Regs roll around if r3 is less than r1. | |
9859 // Artifically increase r3 by 16 so we can calculate | |
9860 // the number of regs stored properly. | |
9861 if (r3 < r1) r3 += 16; | |
9862 | |
9863 int64_t rb_val = (rb == 0) ? 0 : get_register(rb); | |
9864 | |
9865 // Store each register in ascending order. | |
9866 for (int i = 0; i <= r3 - r1; i++) { | |
9867 int64_t value = get_register((r1 + i) % 16); | |
9868 WriteDW(rb_val + offset + 8 * i, value); | |
9869 } | |
9870 return length; | |
9871 } | |
9404 | 9872 |
9405 EVALUATE(STMH) { return DecodeInstructionOriginal(instr); } | 9873 EVALUATE(STMH) { return DecodeInstructionOriginal(instr); } |
9406 | 9874 |
9407 EVALUATE(STCMH) { return DecodeInstructionOriginal(instr); } | 9875 EVALUATE(STCMH) { return DecodeInstructionOriginal(instr); } |
9408 | 9876 |
9409 EVALUATE(STCMY) { return DecodeInstructionOriginal(instr); } | 9877 EVALUATE(STCMY) { return DecodeInstructionOriginal(instr); } |
9410 | 9878 |
9411 EVALUATE(CDSY) { return DecodeInstructionOriginal(instr); } | 9879 EVALUATE(CDSY) { return DecodeInstructionOriginal(instr); } |
9412 | 9880 |
9413 EVALUATE(CDSG) { return DecodeInstructionOriginal(instr); } | 9881 EVALUATE(CDSG) { return DecodeInstructionOriginal(instr); } |
9414 | 9882 |
9415 EVALUATE(BXHG) { return DecodeInstructionOriginal(instr); } | 9883 EVALUATE(BXHG) { return DecodeInstructionOriginal(instr); } |
9416 | 9884 |
9417 EVALUATE(BXLEG) { return DecodeInstructionOriginal(instr); } | 9885 EVALUATE(BXLEG) { return DecodeInstructionOriginal(instr); } |
9418 | 9886 |
9419 EVALUATE(ECAG) { return DecodeInstructionOriginal(instr); } | 9887 EVALUATE(ECAG) { return DecodeInstructionOriginal(instr); } |
9420 | 9888 |
9421 EVALUATE(TMY) { return DecodeInstructionOriginal(instr); } | 9889 EVALUATE(TMY) { |
9890 DCHECK_OPCODE(TMY); | |
9891 // Test Under Mask (Mem - Imm) (8) | |
9892 DECODE_SIY_INSTRUCTION(b1, d1, i2); | |
9893 int64_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9894 intptr_t d1_val = d1; | |
9895 intptr_t addr = b1_val + d1_val; | |
9896 uint8_t mem_val = ReadB(addr); | |
9897 uint8_t imm_val = i2; | |
9898 uint8_t selected_bits = mem_val & imm_val; | |
9899 // CC0: Selected bits are zero | |
9900 // CC1: Selected bits mixed zeros and ones | |
9901 // CC3: Selected bits all ones | |
9902 if (0 == selected_bits) { | |
9903 condition_reg_ = CC_EQ; // CC0 | |
9904 } else if (selected_bits == imm_val) { | |
9905 condition_reg_ = 0x1; // CC3 | |
9906 } else { | |
9907 condition_reg_ = 0x4; // CC1 | |
9908 } | |
9909 return length; | |
9910 } | |
9422 | 9911 |
9423 EVALUATE(MVIY) { return DecodeInstructionOriginal(instr); } | 9912 EVALUATE(MVIY) { return DecodeInstructionOriginal(instr); } |
9424 | 9913 |
9425 EVALUATE(NIY) { return DecodeInstructionOriginal(instr); } | 9914 EVALUATE(NIY) { return DecodeInstructionOriginal(instr); } |
9426 | 9915 |
9427 EVALUATE(CLIY) { return DecodeInstructionOriginal(instr); } | 9916 EVALUATE(CLIY) { |
9917 DCHECK_OPCODE(CLIY); | |
9918 DECODE_SIY_INSTRUCTION(b1, d1, i2); | |
9919 // Compare Immediate (Mem - Imm) (8) | |
9920 int64_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9921 intptr_t d1_val = d1; | |
9922 intptr_t addr = b1_val + d1_val; | |
9923 uint8_t mem_val = ReadB(addr); | |
9924 uint8_t imm_val = i2; | |
9925 SetS390ConditionCode<uint8_t>(mem_val, imm_val); | |
9926 return length; | |
9927 } | |
9428 | 9928 |
9429 EVALUATE(OIY) { return DecodeInstructionOriginal(instr); } | 9929 EVALUATE(OIY) { return DecodeInstructionOriginal(instr); } |
9430 | 9930 |
9431 EVALUATE(XIY) { return DecodeInstructionOriginal(instr); } | 9931 EVALUATE(XIY) { return DecodeInstructionOriginal(instr); } |
9432 | 9932 |
9433 EVALUATE(ASI) { return DecodeInstructionOriginal(instr); } | 9933 EVALUATE(ASI) { |
9934 DCHECK_OPCODE(ASI); | |
9935 // TODO(bcleung): Change all fooInstr->I2Value() to template functions. | |
9936 // The below static cast to 8 bit and then to 32 bit is necessary | |
9937 // because siyInstr->I2Value() returns a uint8_t, which a direct | |
9938 // cast to int32_t could incorrectly interpret. | |
9939 DECODE_SIY_INSTRUCTION(b1, d1, i2_unsigned); | |
9940 int8_t i2_8bit = static_cast<int8_t>(i2_unsigned); | |
9941 int32_t i2 = static_cast<int32_t>(i2_8bit); | |
9942 intptr_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9943 | |
9944 int d1_val = d1; | |
9945 intptr_t addr = b1_val + d1_val; | |
9946 | |
9947 int32_t mem_val = ReadW(addr, instr); | |
9948 bool isOF = CheckOverflowForIntAdd(mem_val, i2, int32_t); | |
9949 int32_t alu_out = mem_val + i2; | |
9950 SetS390ConditionCode<int32_t>(alu_out, 0); | |
9951 SetS390OverflowCode(isOF); | |
9952 WriteW(addr, alu_out, instr); | |
9953 return length; | |
9954 } | |
9434 | 9955 |
9435 EVALUATE(ALSI) { return DecodeInstructionOriginal(instr); } | 9956 EVALUATE(ALSI) { return DecodeInstructionOriginal(instr); } |
9436 | 9957 |
9437 EVALUATE(AGSI) { return DecodeInstructionOriginal(instr); } | 9958 EVALUATE(AGSI) { |
9959 DCHECK_OPCODE(AGSI); | |
9960 // TODO(bcleung): Change all fooInstr->I2Value() to template functions. | |
9961 // The below static cast to 8 bit and then to 32 bit is necessary | |
9962 // because siyInstr->I2Value() returns a uint8_t, which a direct | |
9963 // cast to int32_t could incorrectly interpret. | |
9964 DECODE_SIY_INSTRUCTION(b1, d1, i2_unsigned); | |
9965 int8_t i2_8bit = static_cast<int8_t>(i2_unsigned); | |
9966 int64_t i2 = static_cast<int64_t>(i2_8bit); | |
9967 intptr_t b1_val = (b1 == 0) ? 0 : get_register(b1); | |
9968 | |
9969 int d1_val = d1; | |
9970 intptr_t addr = b1_val + d1_val; | |
9971 | |
9972 int64_t mem_val = ReadDW(addr); | |
9973 int isOF = CheckOverflowForIntAdd(mem_val, i2, int64_t); | |
9974 int64_t alu_out = mem_val + i2; | |
9975 SetS390ConditionCode<uint64_t>(alu_out, 0); | |
9976 SetS390OverflowCode(isOF); | |
9977 WriteDW(addr, alu_out); | |
9978 return length; | |
9979 } | |
9438 | 9980 |
9439 EVALUATE(ALGSI) { return DecodeInstructionOriginal(instr); } | 9981 EVALUATE(ALGSI) { return DecodeInstructionOriginal(instr); } |
9440 | 9982 |
9441 EVALUATE(ICMH) { return DecodeInstructionOriginal(instr); } | 9983 EVALUATE(ICMH) { return DecodeInstructionOriginal(instr); } |
9442 | 9984 |
9443 EVALUATE(ICMY) { return DecodeInstructionOriginal(instr); } | 9985 EVALUATE(ICMY) { return DecodeInstructionOriginal(instr); } |
9444 | 9986 |
9445 EVALUATE(MVCLU) { return DecodeInstructionOriginal(instr); } | 9987 EVALUATE(MVCLU) { return DecodeInstructionOriginal(instr); } |
9446 | 9988 |
9447 EVALUATE(CLCLU) { return DecodeInstructionOriginal(instr); } | 9989 EVALUATE(CLCLU) { return DecodeInstructionOriginal(instr); } |
9448 | 9990 |
9449 EVALUATE(STMY) { return DecodeInstructionOriginal(instr); } | 9991 EVALUATE(STMY) { |
9992 DCHECK_OPCODE(STMY); | |
9993 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
9994 // Load/Store Multiple (32) | |
9995 int offset = d2; | |
9996 | |
9997 // Regs roll around if r3 is less than r1. | |
9998 // Artifically increase r3 by 16 so we can calculate | |
9999 // the number of regs stored properly. | |
10000 if (r3 < r1) r3 += 16; | |
10001 | |
10002 int32_t b2_val = (b2 == 0) ? 0 : get_low_register<int32_t>(b2); | |
10003 | |
10004 // Store each register in ascending order. | |
10005 for (int i = 0; i <= r3 - r1; i++) { | |
10006 int32_t value = get_low_register<int32_t>((r1 + i) % 16); | |
10007 WriteW(b2_val + offset + 4 * i, value, instr); | |
10008 } | |
10009 return length; | |
10010 } | |
9450 | 10011 |
9451 EVALUATE(LMH) { return DecodeInstructionOriginal(instr); } | 10012 EVALUATE(LMH) { return DecodeInstructionOriginal(instr); } |
9452 | 10013 |
9453 EVALUATE(LMY) { return DecodeInstructionOriginal(instr); } | 10014 EVALUATE(LMY) { |
10015 DCHECK_OPCODE(LMY); | |
10016 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
10017 // Load/Store Multiple (32) | |
10018 int offset = d2; | |
10019 | |
10020 // Regs roll around if r3 is less than r1. | |
10021 // Artifically increase r3 by 16 so we can calculate | |
10022 // the number of regs stored properly. | |
10023 if (r3 < r1) r3 += 16; | |
10024 | |
10025 int32_t b2_val = (b2 == 0) ? 0 : get_low_register<int32_t>(b2); | |
10026 | |
10027 // Store each register in ascending order. | |
10028 for (int i = 0; i <= r3 - r1; i++) { | |
10029 int32_t value = ReadW(b2_val + offset + 4 * i, instr); | |
10030 set_low_register((r1 + i) % 16, value); | |
10031 } | |
10032 return length; | |
10033 } | |
9454 | 10034 |
9455 EVALUATE(TP) { return DecodeInstructionOriginal(instr); } | 10035 EVALUATE(TP) { return DecodeInstructionOriginal(instr); } |
9456 | 10036 |
9457 EVALUATE(SRAK) { return DecodeInstructionOriginal(instr); } | 10037 EVALUATE(SRAK) { |
10038 DCHECK_OPCODE(SRAK); | |
10039 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
10040 // 32-bit non-clobbering shift-left/right arithmetic | |
10041 // only takes rightmost 6 bits | |
10042 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10043 int shiftBits = (b2_val + d2) & 0x3F; | |
10044 int32_t r3_val = get_low_register<int32_t>(r3); | |
10045 int32_t alu_out = 0; | |
10046 bool isOF = false; | |
10047 alu_out = r3_val >> shiftBits; | |
10048 set_low_register(r1, alu_out); | |
10049 SetS390ConditionCode<int32_t>(alu_out, 0); | |
10050 SetS390OverflowCode(isOF); | |
10051 return length; | |
10052 } | |
9458 | 10053 |
9459 EVALUATE(SLAK) { return DecodeInstructionOriginal(instr); } | 10054 EVALUATE(SLAK) { |
10055 DCHECK_OPCODE(SLAK); | |
10056 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
10057 // 32-bit non-clobbering shift-left/right arithmetic | |
10058 // only takes rightmost 6 bits | |
10059 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10060 int shiftBits = (b2_val + d2) & 0x3F; | |
10061 int32_t r3_val = get_low_register<int32_t>(r3); | |
10062 int32_t alu_out = 0; | |
10063 bool isOF = false; | |
10064 isOF = CheckOverflowForShiftLeft(r3_val, shiftBits); | |
10065 alu_out = r3_val << shiftBits; | |
10066 set_low_register(r1, alu_out); | |
10067 SetS390ConditionCode<int32_t>(alu_out, 0); | |
10068 SetS390OverflowCode(isOF); | |
10069 return length; | |
10070 } | |
9460 | 10071 |
9461 EVALUATE(SRLK) { return DecodeInstructionOriginal(instr); } | 10072 EVALUATE(SRLK) { |
10073 DCHECK_OPCODE(SRLK); | |
10074 // For SLLK/SRLL, the 32-bit third operand is shifted the number | |
10075 // of bits specified by the second-operand address, and the result is | |
10076 // placed at the first-operand location. Except for when the R1 and R3 | |
10077 // fields designate the same register, the third operand remains | |
10078 // unchanged in general register R3. | |
10079 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
10080 // only takes rightmost 6 bits | |
10081 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10082 int shiftBits = (b2_val + d2) & 0x3F; | |
10083 // unsigned | |
10084 uint32_t r3_val = get_low_register<uint32_t>(r3); | |
10085 uint32_t alu_out = 0; | |
10086 alu_out = r3_val >> shiftBits; | |
10087 set_low_register(r1, alu_out); | |
10088 return length; | |
10089 } | |
9462 | 10090 |
9463 EVALUATE(SLLK) { return DecodeInstructionOriginal(instr); } | 10091 EVALUATE(SLLK) { |
10092 DCHECK_OPCODE(SLLK); | |
10093 // For SLLK/SRLL, the 32-bit third operand is shifted the number | |
10094 // of bits specified by the second-operand address, and the result is | |
10095 // placed at the first-operand location. Except for when the R1 and R3 | |
10096 // fields designate the same register, the third operand remains | |
10097 // unchanged in general register R3. | |
10098 DECODE_RSY_A_INSTRUCTION(r1, r3, b2, d2); | |
10099 // only takes rightmost 6 bits | |
10100 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10101 int shiftBits = (b2_val + d2) & 0x3F; | |
10102 // unsigned | |
10103 uint32_t r3_val = get_low_register<uint32_t>(r3); | |
10104 uint32_t alu_out = 0; | |
10105 alu_out = r3_val << shiftBits; | |
10106 set_low_register(r1, alu_out); | |
10107 return length; | |
10108 } | |
9464 | 10109 |
9465 EVALUATE(LOCG) { return DecodeInstructionOriginal(instr); } | 10110 EVALUATE(LOCG) { return DecodeInstructionOriginal(instr); } |
9466 | 10111 |
9467 EVALUATE(STOCG) { return DecodeInstructionOriginal(instr); } | 10112 EVALUATE(STOCG) { return DecodeInstructionOriginal(instr); } |
9468 | 10113 |
9469 EVALUATE(LANG) { return DecodeInstructionOriginal(instr); } | 10114 EVALUATE(LANG) { return DecodeInstructionOriginal(instr); } |
9470 | 10115 |
9471 EVALUATE(LAOG) { return DecodeInstructionOriginal(instr); } | 10116 EVALUATE(LAOG) { return DecodeInstructionOriginal(instr); } |
9472 | 10117 |
9473 EVALUATE(LAXG) { return DecodeInstructionOriginal(instr); } | 10118 EVALUATE(LAXG) { return DecodeInstructionOriginal(instr); } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9521 EVALUATE(ALHSIK) { return DecodeInstructionOriginal(instr); } | 10166 EVALUATE(ALHSIK) { return DecodeInstructionOriginal(instr); } |
9522 | 10167 |
9523 EVALUATE(ALGHSIK) { return DecodeInstructionOriginal(instr); } | 10168 EVALUATE(ALGHSIK) { return DecodeInstructionOriginal(instr); } |
9524 | 10169 |
9525 EVALUATE(CGRB) { return DecodeInstructionOriginal(instr); } | 10170 EVALUATE(CGRB) { return DecodeInstructionOriginal(instr); } |
9526 | 10171 |
9527 EVALUATE(CGIB) { return DecodeInstructionOriginal(instr); } | 10172 EVALUATE(CGIB) { return DecodeInstructionOriginal(instr); } |
9528 | 10173 |
9529 EVALUATE(CIB) { return DecodeInstructionOriginal(instr); } | 10174 EVALUATE(CIB) { return DecodeInstructionOriginal(instr); } |
9530 | 10175 |
9531 EVALUATE(LDEB) { return DecodeInstructionOriginal(instr); } | 10176 EVALUATE(LDEB) { |
10177 DCHECK_OPCODE(LDEB); | |
10178 // Load Float | |
10179 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); | |
10180 int rb = b2; | |
10181 int rx = x2; | |
10182 int offset = d2; | |
10183 int64_t rb_val = (rb == 0) ? 0 : get_register(rb); | |
10184 int64_t rx_val = (rx == 0) ? 0 : get_register(rx); | |
10185 double ret = | |
10186 static_cast<double>(*reinterpret_cast<float*>(rx_val + rb_val + offset)); | |
10187 set_d_register_from_double(r1, ret); | |
10188 return length; | |
10189 } | |
9532 | 10190 |
9533 EVALUATE(LXDB) { return DecodeInstructionOriginal(instr); } | 10191 EVALUATE(LXDB) { return DecodeInstructionOriginal(instr); } |
9534 | 10192 |
9535 EVALUATE(LXEB) { return DecodeInstructionOriginal(instr); } | 10193 EVALUATE(LXEB) { return DecodeInstructionOriginal(instr); } |
9536 | 10194 |
9537 EVALUATE(MXDB) { return DecodeInstructionOriginal(instr); } | 10195 EVALUATE(MXDB) { return DecodeInstructionOriginal(instr); } |
9538 | 10196 |
9539 EVALUATE(KEB) { return DecodeInstructionOriginal(instr); } | 10197 EVALUATE(KEB) { return DecodeInstructionOriginal(instr); } |
9540 | 10198 |
9541 EVALUATE(CEB) { return DecodeInstructionOriginal(instr); } | 10199 EVALUATE(CEB) { return DecodeInstructionOriginal(instr); } |
(...skipping 11 matching lines...) Expand all Loading... | |
9553 EVALUATE(MSEB) { return DecodeInstructionOriginal(instr); } | 10211 EVALUATE(MSEB) { return DecodeInstructionOriginal(instr); } |
9554 | 10212 |
9555 EVALUATE(TCEB) { return DecodeInstructionOriginal(instr); } | 10213 EVALUATE(TCEB) { return DecodeInstructionOriginal(instr); } |
9556 | 10214 |
9557 EVALUATE(TCDB) { return DecodeInstructionOriginal(instr); } | 10215 EVALUATE(TCDB) { return DecodeInstructionOriginal(instr); } |
9558 | 10216 |
9559 EVALUATE(TCXB) { return DecodeInstructionOriginal(instr); } | 10217 EVALUATE(TCXB) { return DecodeInstructionOriginal(instr); } |
9560 | 10218 |
9561 EVALUATE(SQEB) { return DecodeInstructionOriginal(instr); } | 10219 EVALUATE(SQEB) { return DecodeInstructionOriginal(instr); } |
9562 | 10220 |
9563 EVALUATE(SQDB) { return DecodeInstructionOriginal(instr); } | 10221 EVALUATE(SQDB) { |
10222 DCHECK_OPCODE(SQDB); | |
10223 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); | |
10224 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10225 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10226 intptr_t d2_val = d2; | |
10227 double r1_val = get_double_from_d_register(r1); | |
10228 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10229 r1_val = std::sqrt(dbl_val); | |
10230 set_d_register_from_double(r1, r1_val); | |
10231 return length; | |
10232 } | |
9564 | 10233 |
9565 EVALUATE(MEEB) { return DecodeInstructionOriginal(instr); } | 10234 EVALUATE(MEEB) { return DecodeInstructionOriginal(instr); } |
9566 | 10235 |
9567 EVALUATE(KDB) { return DecodeInstructionOriginal(instr); } | 10236 EVALUATE(KDB) { return DecodeInstructionOriginal(instr); } |
9568 | 10237 |
9569 EVALUATE(CDB) { return DecodeInstructionOriginal(instr); } | 10238 EVALUATE(CDB) { |
10239 DCHECK_OPCODE(CDB); | |
9570 | 10240 |
9571 EVALUATE(ADB) { return DecodeInstructionOriginal(instr); } | 10241 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); |
10242 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10243 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10244 intptr_t d2_val = d2; | |
10245 double r1_val = get_double_from_d_register(r1); | |
10246 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10247 SetS390ConditionCode<double>(r1_val, dbl_val); | |
10248 return length; | |
10249 } | |
9572 | 10250 |
9573 EVALUATE(SDB) { return DecodeInstructionOriginal(instr); } | 10251 EVALUATE(ADB) { |
10252 DCHECK_OPCODE(ADB); | |
9574 | 10253 |
9575 EVALUATE(MDB) { return DecodeInstructionOriginal(instr); } | 10254 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); |
10255 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10256 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10257 intptr_t d2_val = d2; | |
10258 double r1_val = get_double_from_d_register(r1); | |
10259 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10260 r1_val += dbl_val; | |
10261 set_d_register_from_double(r1, r1_val); | |
10262 SetS390ConditionCode<double>(r1_val, 0); | |
10263 return length; | |
10264 } | |
9576 | 10265 |
9577 EVALUATE(DDB) { return DecodeInstructionOriginal(instr); } | 10266 EVALUATE(SDB) { |
10267 DCHECK_OPCODE(SDB); | |
10268 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); | |
10269 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10270 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10271 intptr_t d2_val = d2; | |
10272 double r1_val = get_double_from_d_register(r1); | |
10273 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10274 r1_val -= dbl_val; | |
10275 set_d_register_from_double(r1, r1_val); | |
10276 SetS390ConditionCode<double>(r1_val, 0); | |
10277 return length; | |
10278 } | |
10279 | |
10280 EVALUATE(MDB) { | |
10281 DCHECK_OPCODE(MDB); | |
10282 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); | |
10283 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10284 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10285 intptr_t d2_val = d2; | |
10286 double r1_val = get_double_from_d_register(r1); | |
10287 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10288 r1_val *= dbl_val; | |
10289 set_d_register_from_double(r1, r1_val); | |
10290 SetS390ConditionCode<double>(r1_val, 0); | |
10291 return length; | |
10292 } | |
10293 | |
10294 EVALUATE(DDB) { | |
10295 DCHECK_OPCODE(DDB); | |
10296 DECODE_RXE_INSTRUCTION(r1, b2, x2, d2); | |
10297 int64_t b2_val = (b2 == 0) ? 0 : get_register(b2); | |
10298 int64_t x2_val = (x2 == 0) ? 0 : get_register(x2); | |
10299 intptr_t d2_val = d2; | |
10300 double r1_val = get_double_from_d_register(r1); | |
10301 double dbl_val = ReadDouble(b2_val + x2_val + d2_val); | |
10302 r1_val /= dbl_val; | |
10303 set_d_register_from_double(r1, r1_val); | |
10304 SetS390ConditionCode<double>(r1_val, 0); | |
10305 return length; | |
10306 } | |
9578 | 10307 |
9579 EVALUATE(MADB) { return DecodeInstructionOriginal(instr); } | 10308 EVALUATE(MADB) { return DecodeInstructionOriginal(instr); } |
9580 | 10309 |
9581 EVALUATE(MSDB) { return DecodeInstructionOriginal(instr); } | 10310 EVALUATE(MSDB) { return DecodeInstructionOriginal(instr); } |
9582 | 10311 |
9583 EVALUATE(SLDT) { return DecodeInstructionOriginal(instr); } | 10312 EVALUATE(SLDT) { return DecodeInstructionOriginal(instr); } |
9584 | 10313 |
9585 EVALUATE(SRDT) { return DecodeInstructionOriginal(instr); } | 10314 EVALUATE(SRDT) { return DecodeInstructionOriginal(instr); } |
9586 | 10315 |
9587 EVALUATE(SLXT) { return DecodeInstructionOriginal(instr); } | 10316 EVALUATE(SLXT) { return DecodeInstructionOriginal(instr); } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9656 | 10385 |
9657 EVALUATE(CXZT) { return DecodeInstructionOriginal(instr); } | 10386 EVALUATE(CXZT) { return DecodeInstructionOriginal(instr); } |
9658 | 10387 |
9659 #undef EVALUATE | 10388 #undef EVALUATE |
9660 | 10389 |
9661 } // namespace internal | 10390 } // namespace internal |
9662 } // namespace v8 | 10391 } // namespace v8 |
9663 | 10392 |
9664 #endif // USE_SIMULATOR | 10393 #endif // USE_SIMULATOR |
9665 #endif // V8_TARGET_ARCH_S390 | 10394 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |