diff --git a/src/s390/assembler-s390.cc b/src/s390/assembler-s390.cc index a448947307..36ab3a4b17 100644 --- a/src/s390/assembler-s390.cc +++ b/src/s390/assembler-s390.cc @@ -3012,6 +3012,21 @@ bool Assembler::IsNop(SixByteInstr instr, int type) { return ((instr & 0xffff) == 0x1800); // lr r0,r0 } +// dummy instruction reserved for special use. +void Assembler::dumy(int r1, int x2, int b2, int d2) { +#if defined(USE_SIMULATOR) + int op = 0xE353; + uint64_t code = (static_cast(op & 0xFF00)) * B32 | + (static_cast(r1) & 0xF) * B36 | + (static_cast(x2) & 0xF) * B32 | + (static_cast(b2) & 0xF) * B28 | + (static_cast(d2 & 0x0FFF)) * B16 | + (static_cast(d2 & 0x0FF000)) >> 4 | + (static_cast(op & 0x00FF)); + emit6bytes(code); +#endif +} + void Assembler::GrowBuffer(int needed) { if (!own_buffer_) FATAL("external code buffer is too small"); diff --git a/src/s390/assembler-s390.h b/src/s390/assembler-s390.h index 60b45fbd2f..10cbaa8f0d 100644 --- a/src/s390/assembler-s390.h +++ b/src/s390/assembler-s390.h @@ -1224,6 +1224,8 @@ class Assembler : public AssemblerBase { void nop(int type = 0); // 0 is the default non-marking type. + void dumy(int r1, int x2, int b2, int d2); + // Check the code size generated from label to here. int SizeOfCodeGeneratedSince(Label* label) { return pc_offset() - label->pos(); diff --git a/src/s390/constants-s390.h b/src/s390/constants-s390.h index 9dfb32c7e7..1cfc0b7da7 100644 --- a/src/s390/constants-s390.h +++ b/src/s390/constants-s390.h @@ -915,7 +915,8 @@ enum Opcode { XSCH = 0xB276, // Cancel Subchannel XY = 0xE357, // Exclusive Or (32) ZAP = 0xF8, // Zero And Add - BKPT = 0x0001 // GDB Software Breakpoint + BKPT = 0x0001, // GDB Software Breakpoint + DUMY = 0xE353 // Special dummy opcode }; // Instruction encoding bits and masks. diff --git a/src/s390/disasm-s390.cc b/src/s390/disasm-s390.cc index 26079b9992..5f2f4011a7 100644 --- a/src/s390/disasm-s390.cc +++ b/src/s390/disasm-s390.cc @@ -1052,6 +1052,9 @@ bool Decoder::DecodeSixByte(Instruction* instr) { Opcode opcode = instr->S390OpcodeValue(); switch (opcode) { + case DUMY: + Format(instr, "dumy\t'r1, 'd2 ( 'r2d, 'r3 )"); + break; case LLILF: Format(instr, "llilf\t'r1,'i7"); break; diff --git a/src/s390/simulator-s390.cc b/src/s390/simulator-s390.cc index 74d37bc20a..df4c02dfeb 100644 --- a/src/s390/simulator-s390.cc +++ b/src/s390/simulator-s390.cc @@ -743,6 +743,7 @@ void Simulator::EvalTableInit() { EvalTable[i] = &Simulator::Evaluate_Unknown; } + EvalTable[DUMY] = &Simulator::Evaluate_DUMY; EvalTable[BKPT] = &Simulator::Evaluate_BKPT; EvalTable[SPM] = &Simulator::Evaluate_SPM; EvalTable[BALR] = &Simulator::Evaluate_BALR; @@ -6058,6 +6059,12 @@ int Simulator::Evaluate_Unknown(Instruction* instr) { return 0; } +EVALUATE(DUMY) { + DCHECK_OPCODE(DUMY); + // dummy instruction does nothing. + return 6; +} + EVALUATE(CLR) { DCHECK_OPCODE(CLR); DECODE_RR_INSTRUCTION(r1, r2); diff --git a/src/s390/simulator-s390.h b/src/s390/simulator-s390.h index 1ce6bf776b..66730b5d74 100644 --- a/src/s390/simulator-s390.h +++ b/src/s390/simulator-s390.h @@ -522,6 +522,7 @@ class Simulator { static void EvalTableInit(); #define EVALUATE(name) int Evaluate_##name(Instruction* instr) + EVALUATE(DUMY); EVALUATE(BKPT); EVALUATE(SPM); EVALUATE(BALR);