Lines Matching defs:instr

75   int FormatRegister(Instruction* instr, const char* option);
76 int FormatFloatingRegister(Instruction* instr, const char* option);
77 int FormatMask(Instruction* instr, const char* option);
78 int FormatDisplacement(Instruction* instr, const char* option);
79 int FormatImmediate(Instruction* instr, const char* option);
80 int FormatOption(Instruction* instr, const char* option);
81 void Format(Instruction* instr, const char* format);
82 void Unknown(Instruction* instr);
83 void UnknownFormat(Instruction* instr, const char* opcname);
85 bool DecodeSpecial(Instruction* instr);
86 bool DecodeGeneric(Instruction* instr);
145 int Decoder::FormatRegister(Instruction* instr, const char* format) {
149 int reg = instr->Bits<SixByteInstr, int>(39, 36);
153 int reg = instr->Bits<SixByteInstr, int>(35, 32);
165 int reg = instr->Bits<SixByteInstr, int>(31, 28);
169 int reg = instr->Bits<SixByteInstr, int>(27, 24);
173 int reg = instr->Bits<SixByteInstr, int>(23, 20);
177 int reg = instr->Bits<SixByteInstr, int>(19, 16);
181 int reg = instr->Bits<SixByteInstr, int>(15, 12);
189 int Decoder::FormatFloatingRegister(Instruction* instr, const char* format) {
194 RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
199 RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
204 RRDInstruction* rrdinstr = reinterpret_cast<RRDInstruction*>(instr);
209 RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
214 RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
219 VRR_E_Instruction* vrreinstr = reinterpret_cast<VRR_E_Instruction*>(instr);
232 int Decoder::FormatOption(Instruction* instr, const char* format) {
235 if (instr->Bit(10) == 1) {
241 if (instr->Bit(0) == 1) {
249 return FormatRegister(instr, format);
252 return FormatFloatingRegister(instr, format);
255 return FormatImmediate(instr, format);
258 int32_t value = instr->Bits(15, 0);
265 if (instr->Bit(0) == 1) {
272 if (instr->Bit(1) == 1) {
281 int off = ((instr->Bits(25, 2)) << 8) >> 6;
284 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
287 int off = ((instr->Bits(15, 2)) << 18) >> 16;
290 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
295 return FormatMask(instr, format);
299 return FormatDisplacement(instr, format);
309 int Decoder::FormatMask(Instruction* instr, const char* format) {
313 value = reinterpret_cast<RRInstruction*>(instr)->R1Value();
318 value = reinterpret_cast<RXInstruction*>(instr)->B2Value();
323 value = reinterpret_cast<RRFInstruction*>(instr)->M4Value();
328 value = reinterpret_cast<VRR_C_Instruction*>(instr)->M4Value();
333 value = reinterpret_cast<VRR_C_Instruction*>(instr)->M5Value();
338 value = reinterpret_cast<VRR_C_Instruction*>(instr)->M6Value();
347 int Decoder::FormatDisplacement(Instruction* instr, const char* format) {
351 RSInstruction* rsinstr = reinterpret_cast<RSInstruction*>(instr);
358 RXYInstruction* rxyinstr = reinterpret_cast<RXYInstruction*>(instr);
364 SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
370 SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
376 int32_t value = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
383 int Decoder::FormatImmediate(Instruction* instr, const char* format) {
387 RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
393 RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
399 IInstruction* iinstr = reinterpret_cast<IInstruction*>(instr);
405 RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
414 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
417 RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
426 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
429 RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
435 RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
441 SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
447 RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
453 RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
459 RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
465 SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
471 SILInstruction* silinstr = reinterpret_cast<SILInstruction*>(instr);
477 RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
486 converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
496 void Decoder::Format(Instruction* instr, const char* format) {
500 format += FormatOption(instr, format);
513 Unknown(instr); \
517 // For currently unimplemented decodings the disassembler calls Unknown(instr)
519 void Decoder::Unknown(Instruction* instr) { Format(instr, "unknown"); }
522 // UnknownFormat(instr) which will just print opcode name of the
524 void Decoder::UnknownFormat(Instruction* instr, const char* name) {
527 Format(instr, buffer);
535 bool Decoder::DecodeSpecial(Instruction* instr) {
536 Opcode opcode = instr->S390OpcodeValue();
539 Format(instr, "bkpt");
542 Format(instr, "dumy\t'r1, 'd2 ( 'r2d, 'r3 )");
546 Format(instr, "ldr\t'f1,'f2");
549 Format(instr, "bcr\t'm1,'r2");
552 Format(instr, "or\t'r1,'r2");
555 Format(instr, "cr\t'r1,'r2");
558 Format(instr, "mr\t'r1,'r2");
561 Format(instr, "her\t'r1,'r2");
565 Format(instr, "bras\t'r1,'i1");
569 Format(instr, "mdbr\t'f5,'f6");
572 Format(instr, "sdbr\t'f5,'f6");
575 Format(instr, "adbr\t'f5,'f6");
578 Format(instr, "cdbr\t'f5,'f6");
581 Format(instr, "meebr\t'f5,'f6");
584 Format(instr, "sqdbr\t'f5,'f6");
587 Format(instr, "sqebr\t'f5,'f6");
590 Format(instr, "lcdbr\t'f5,'f6");
593 Format(instr, "lcebr\t'f5,'f6");
596 Format(instr, "ltebr\t'f5,'f6");
599 Format(instr, "ldebr\t'f5,'f6");
602 Format(instr, "cebr\t'f5,'f6");
605 Format(instr, "aebr\t'f5,'f6");
608 Format(instr, "sebr\t'f5,'f6");
611 Format(instr, "debr\t'f5,'f6");
614 Format(instr, "ltdbr\t'f5,'f6");
617 Format(instr, "ldgr\t'f5,'f6");
620 Format(instr, "ddbr\t'f5,'f6");
623 Format(instr, "lzdr\t'f5");
627 Format(instr, "fiebra\t'f5,'m2,'f6,'m3");
630 Format(instr, "fidbra\t'f5,'m2,'f6,'m3");
634 Format(instr, "ic\t'r1,'d1('r2d,'r3)");
637 Format(instr, "al\t'r1,'d1('r2d,'r3)");
640 Format(instr, "le\t'f1,'d1('r2d,'r3)");
643 Format(instr, "ld\t'f1,'d1('r2d,'r3)");
646 Format(instr, "ste\t'f1,'d1('r2d,'r3)");
649 Format(instr, "std\t'f1,'d1('r2d,'r3)");
655 Format(instr, "trap4");
659 Format(instr, "cfi\t'r1,'i2");
662 Format(instr, "cgfi\t'r1,'i2");
665 Format(instr, "afi\t'r1,'i2");
668 Format(instr, "agfi\t'r1,'i2");
671 Format(instr, "msfi\t'r1,'i2");
674 Format(instr, "msgfi\t'r1,'i2");
677 Format(instr, "alsih\t'r1,'i2");
680 Format(instr, "alsihn\t'r1,'i2");
683 Format(instr, "cih\t'r1,'i2");
686 Format(instr, "aih\t'r1,'i2");
689 Format(instr, "lgfi\t'r1,'i2");
693 Format(instr, "asi\t'd2('r3),'ic");
696 Format(instr, "agsi\t'd2('r3),'ic");
700 Format(instr, "lt\t'r1,'d2('r2d,'r3)");
703 Format(instr, "ldy\t'f1,'d2('r2d,'r3)");
706 Format(instr, "ley\t'f1,'d2('r2d,'r3)");
709 Format(instr, "stdy\t'f1,'d2('r2d,'r3)");
712 Format(instr, "stey\t'f1,'d2('r2d,'r3)");
716 Format(instr, "ldeb\t'f1,'d2('r2d,'r3)");
726 bool Decoder::DecodeGeneric(Instruction* instr) {
727 Opcode opcode = instr->S390OpcodeValue();
732 Format(instr, #name "\t'r1,'r2"); \
740 Format(instr, #name "\t'r1,'r2,'d1('r3)"); \
747 Format(instr, #name "\t'r1,'r2,'i4"); \
754 Format(instr, #name "\t'r1,'i1"); \
761 Format(instr, #name "\t'r1,'i4"); \
768 Format(instr, #name "\t'm1,'i4"); \
775 Format(instr, #name "\t'r5,'r6"); \
782 Format(instr, #name "\t'r5,'r6,'r3"); \
789 Format(instr, #name "\t'r5,'r6,'m2"); \
796 Format(instr, #name "\t'r5,'m2,'f6"); \
803 Format(instr, #name "\t'r1,'d1('r2d,'r3)"); \
810 Format(instr, #name "\t'm1,'d1('r2d,'r3)"); \
817 Format(instr, #name "\t'f3,'f5,'f6"); \
824 Format(instr, #name "\t'd1('r3),'i8"); \
832 Format(instr, #name "\t'f1,'f2,'m4,'m5,'m6"); \
839 Format(instr, #name "\t'f1,'f2,'f3,'m4,'m6"); \
846 Format(instr, #name "\t'f1,'f2,'f3,'m4"); \
853 Format(instr, #name "\t'f1,'f2,'f3,'f4,'m5,'m3"); \
860 Format(instr, #name "\t'f1,'r1,'r2"); \
867 Format(instr, #name "\t'f1,'d1('r2d,'r3),'m4"); \
874 Format(instr, #name "\t'f1,'f2,'d1('r3),'m4"); \
881 Format(instr, #name "\t'f1,'r2,'d1('r3),'m4"); \
888 Format(instr, #name "\t'r1,'f2,'d1('r3),'m4"); \
895 Format(instr, #name "\t'f1,'i1,'m4"); \
902 Format(instr, #name "\t'f1,'f2,'i1,'m4"); \
909 Format(instr, #name "\t'r1,'i7"); \
916 Format(instr, #name "\t'r1,'ie"); \
923 Format(instr, #name "\t'm1,'ie"); \
930 Format(instr, #name "\t'd2('r3),'i8"); \
937 Format(instr, #name "\t'r1,'r2,'i1"); \
944 Format(instr, #name "\t'r1,'r2,'i4"); \
951 Format(instr, #name "\t'r1,'r2,'i9,'ia,'ib"); \
958 Format(instr, #name "\t'r1,'r2,'d2('r3)"); \
965 Format(instr, #name "\t'm2,'r1,'d2('r3)"); \
972 Format(instr, #name "\t'r1,'d2('r2d,'r3)"); \
979 Format(instr, #name "\t'm1,'d2('r2d,'r3)"); \
986 Format(instr, #name "\t'f1,'d1('r2d, 'r3)"); \
993 Format(instr, #name "\t'd3('r3),'id"); \
1000 Format(instr, #name "\t'd3('i8,'r3),'d4('r7)"); \
1013 Instruction* instr = Instruction::At(instr_ptr);
1014 int instrLength = instr->InstructionLength();
1020 instr->InstructionBits<TwoByteInstr>());
1024 instr->InstructionBits<FourByteInstr>());
1028 instr->InstructionBits<SixByteInstr>());
1031 bool decoded = DecodeSpecial(instr);
1032 if (!decoded) decoded = DecodeGeneric(instr);
1033 if (!decoded) Unknown(instr);