Index: src/s390/simulator-s390.cc |
diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc |
index df4c02dfeb2d71f0099f9c51cfa0b1d8a7dcc3ce..4e2fcf7d8b9b49cb660631d42a75d58d85a6529c 100644 |
--- a/src/s390/simulator-s390.cc |
+++ b/src/s390/simulator-s390.cc |
@@ -743,6 +743,11 @@ void Simulator::EvalTableInit() { |
EvalTable[i] = &Simulator::Evaluate_Unknown; |
} |
+#define CREATE_EVALUATE_TABLE(name, op_name, op_value) \ |
+ EvalTable[op_name] = &Simulator::Evaluate_##op_name; |
+ VRR_C_OPCODE_LIST(CREATE_EVALUATE_TABLE); |
+#undef CREATE_EVALUATE_TABLE |
+ |
EvalTable[DUMY] = &Simulator::Evaluate_DUMY; |
EvalTable[BKPT] = &Simulator::Evaluate_BKPT; |
EvalTable[SPM] = &Simulator::Evaluate_SPM; |
@@ -6050,6 +6055,15 @@ uintptr_t Simulator::PopAddress() { |
int d2 = AS(RXEInstruction)->D2Value(); \ |
int length = 6; |
+#define DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4) \ |
+ int r1 = AS(VRR_C_Instruction)->R1Value(); \ |
+ int r2 = AS(VRR_C_Instruction)->R2Value(); \ |
+ int r3 = AS(VRR_C_Instruction)->R3Value(); \ |
+ int m6 = AS(VRR_C_Instruction)->M6Value(); \ |
+ int m5 = AS(VRR_C_Instruction)->M5Value(); \ |
+ int m4 = AS(VRR_C_Instruction)->M4Value(); \ |
+ int length = 6; |
+ |
#define GET_ADDRESS(index_reg, base_reg, offset) \ |
(((index_reg) == 0) ? 0 : get_register(index_reg)) + \ |
(((base_reg) == 0) ? 0 : get_register(base_reg)) + offset |
@@ -6059,10 +6073,75 @@ int Simulator::Evaluate_Unknown(Instruction* instr) { |
return 0; |
} |
+EVALUATE(VFA) { |
+ DCHECK_OPCODE(VFA); |
+ DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4); |
+ USE(m6); |
+ USE(m5); |
+ USE(m4); |
+ DCHECK(m5 == 8); |
+ DCHECK(m4 == 3); |
+ double r2_val = get_double_from_d_register(r2); |
+ double r3_val = get_double_from_d_register(r3); |
+ double r1_val = r2_val + r3_val; |
+ set_d_register_from_double(r1, r1_val); |
+ return length; |
+} |
+ |
+EVALUATE(VFS) { |
+ DCHECK_OPCODE(VFS); |
+ DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4); |
+ USE(m6); |
+ USE(m5); |
+ USE(m4); |
+ DCHECK(m5 == 8); |
+ DCHECK(m4 == 3); |
+ double r2_val = get_double_from_d_register(r2); |
+ double r3_val = get_double_from_d_register(r3); |
+ double r1_val = r2_val - r3_val; |
+ set_d_register_from_double(r1, r1_val); |
+ return length; |
+} |
+ |
+EVALUATE(VFM) { |
+ DCHECK_OPCODE(VFM); |
+ DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4); |
+ USE(m6); |
+ USE(m5); |
+ USE(m4); |
+ DCHECK(m5 == 8); |
+ DCHECK(m4 == 3); |
+ double r2_val = get_double_from_d_register(r2); |
+ double r3_val = get_double_from_d_register(r3); |
+ double r1_val = r2_val * r3_val; |
+ set_d_register_from_double(r1, r1_val); |
+ return length; |
+} |
+ |
+EVALUATE(VFD) { |
+ DCHECK_OPCODE(VFD); |
+ DECODE_VRR_C_INSTRUCTION(r1, r2, r3, m6, m5, m4); |
+ USE(m6); |
+ USE(m5); |
+ USE(m4); |
+ DCHECK(m5 == 8); |
+ DCHECK(m4 == 3); |
+ double r2_val = get_double_from_d_register(r2); |
+ double r3_val = get_double_from_d_register(r3); |
+ double r1_val = r2_val / r3_val; |
+ set_d_register_from_double(r1, r1_val); |
+ return length; |
+} |
+ |
EVALUATE(DUMY) { |
DCHECK_OPCODE(DUMY); |
+ DECODE_RXY_A_INSTRUCTION(r1, x2, b2, d2); |
+ USE(r1); |
+ USE(x2); |
+ USE(b2); |
+ USE(d2); |
// dummy instruction does nothing. |
- return 6; |
+ return length; |
} |
EVALUATE(CLR) { |