s390: introduce DUMY opcode for special use.

BUG=

R=joransiu@ca.ibm.com, michael_dawson@ca.ibm.com, bjaideep@ca.ibm.com

Review-Url: https://codereview.chromium.org/2522283003
Cr-Commit-Position: refs/heads/master@{#41238}
This commit is contained in:
jyan 2016-11-23 17:31:03 -08:00 committed by Commit bot
parent 92c77a5739
commit 5ae3dccad0
6 changed files with 30 additions and 1 deletions

View File

@ -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<uint64_t>(op & 0xFF00)) * B32 |
(static_cast<uint64_t>(r1) & 0xF) * B36 |
(static_cast<uint64_t>(x2) & 0xF) * B32 |
(static_cast<uint64_t>(b2) & 0xF) * B28 |
(static_cast<uint64_t>(d2 & 0x0FFF)) * B16 |
(static_cast<uint64_t>(d2 & 0x0FF000)) >> 4 |
(static_cast<uint64_t>(op & 0x00FF));
emit6bytes(code);
#endif
}
void Assembler::GrowBuffer(int needed) {
if (!own_buffer_) FATAL("external code buffer is too small");

View File

@ -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();

View File

@ -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.

View File

@ -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;

View File

@ -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);

View File

@ -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);