Lines Matching refs:CurByte
73 void EmitByte(unsigned char C, unsigned &CurByte, raw_ostream &OS) const {
75 ++CurByte;
78 void EmitConstant(uint64_t Val, unsigned Size, unsigned &CurByte,
82 EmitByte(Val & 255, CurByte, OS);
89 unsigned &CurByte, raw_ostream &OS,
100 unsigned &CurByte, raw_ostream &OS) const {
101 EmitByte(ModRMByte(3, RegOpcodeFld, GetX86RegNum(ModRMReg)), CurByte, OS);
105 unsigned &CurByte, raw_ostream &OS) const {
107 EmitByte(ModRMByte(SS, Index, Base), CurByte, OS);
113 uint64_t TSFlags, unsigned &CurByte, raw_ostream &OS,
119 void EmitVEXOpcodePrefix(uint64_t TSFlags, unsigned &CurByte, int MemOperand,
123 void EmitSegmentOverridePrefix(uint64_t TSFlags, unsigned &CurByte,
127 void EmitOpcodePrefix(uint64_t TSFlags, unsigned &CurByte, int MemOperand,
190 unsigned &CurByte, raw_ostream &OS,
199 EmitConstant(DispOp.getImm()+ImmOffset, Size, CurByte, OS);
212 ImmOffset = CurByte;
231 Fixups.push_back(MCFixup::Create(CurByte, Expr, FixupKind));
232 EmitConstant(0, Size, CurByte, OS);
237 uint64_t TSFlags, unsigned &CurByte,
250 EmitByte(ModRMByte(0, RegOpcodeField, 5), CurByte, OS);
268 CurByte, OS, Fixups, -ImmSize);
290 EmitByte(ModRMByte(0, RegOpcodeField, 5), CurByte, OS);
291 EmitImmediate(Disp, 4, FK_Data_4, CurByte, OS, Fixups);
300 EmitByte(ModRMByte(0, RegOpcodeField, BaseRegNo), CurByte, OS);
306 EmitByte(ModRMByte(1, RegOpcodeField, BaseRegNo), CurByte, OS);
307 EmitImmediate(Disp, 1, FK_Data_1, CurByte, OS, Fixups);
312 EmitByte(ModRMByte(2, RegOpcodeField, BaseRegNo), CurByte, OS);
313 EmitImmediate(Disp, 4, MCFixupKind(X86::reloc_signed_4byte), CurByte, OS,
327 EmitByte(ModRMByte(0, RegOpcodeField, 4), CurByte, OS);
331 EmitByte(ModRMByte(2, RegOpcodeField, 4), CurByte, OS);
338 EmitByte(ModRMByte(0, RegOpcodeField, 4), CurByte, OS);
341 EmitByte(ModRMByte(1, RegOpcodeField, 4), CurByte, OS);
345 EmitByte(ModRMByte(2, RegOpcodeField, 4), CurByte, OS);
360 EmitSIBByte(SS, IndexRegNo, 5, CurByte, OS);
367 EmitSIBByte(SS, IndexRegNo, GetX86RegNum(Base), CurByte, OS);
372 EmitImmediate(Disp, 1, FK_Data_1, CurByte, OS, Fixups);
374 EmitImmediate(Disp, 4, MCFixupKind(X86::reloc_signed_4byte), CurByte, OS,
380 void X86MCCodeEmitter::EmitVEXOpcodePrefix(uint64_t TSFlags, unsigned &CurByte,
558 EmitSegmentOverridePrefix(TSFlags, CurByte, MemOperand, MI, OS);
574 EmitByte(0xC5, CurByte, OS);
575 EmitByte(LastByte | (VEX_R << 7), CurByte, OS);
580 EmitByte(0xC4, CurByte, OS);
581 EmitByte(VEX_R << 7 | VEX_X << 6 | VEX_B << 5 | VEX_5M, CurByte, OS);
582 EmitByte(LastByte | (VEX_W << 7), CurByte, OS);
681 unsigned &CurByte, int MemOperand,
692 case X86::CS: EmitByte(0x2E, CurByte, OS); break;
693 case X86::SS: EmitByte(0x36, CurByte, OS); break;
694 case X86::DS: EmitByte(0x3E, CurByte, OS); break;
695 case X86::ES: EmitByte(0x26, CurByte, OS); break;
696 case X86::FS: EmitByte(0x64, CurByte, OS); break;
697 case X86::GS: EmitByte(0x65, CurByte, OS); break;
702 EmitByte(0x64, CurByte, OS);
705 EmitByte(0x65, CurByte, OS);
714 void X86MCCodeEmitter::EmitOpcodePrefix(uint64_t TSFlags, unsigned &CurByte,
721 EmitByte(0xF0, CurByte, OS);
724 EmitSegmentOverridePrefix(TSFlags, CurByte, MemOperand, MI, OS);
728 EmitByte(0xF3, CurByte, OS);
733 EmitByte(0x67, CurByte, OS);
737 EmitByte(0x66, CurByte, OS);
752 EmitByte(0xF2, CurByte, OS);
756 EmitByte(0xF3, CurByte, OS);
760 EmitByte(0xF2, CurByte, OS);
763 case X86II::D8: EmitByte(0xD8, CurByte, OS); break;
764 case X86II::D9: EmitByte(0xD9, CurByte, OS); break;
765 case X86II::DA: EmitByte(0xDA, CurByte, OS); break;
766 case X86II::DB: EmitByte(0xDB, CurByte, OS); break;
767 case X86II::DC: EmitByte(0xDC, CurByte, OS); break;
768 case X86II::DD: EmitByte(0xDD, CurByte, OS); break;
769 case X86II::DE: EmitByte(0xDE, CurByte, OS); break;
770 case X86II::DF: EmitByte(0xDF, CurByte, OS); break;
777 EmitByte(0x40 | REX, CurByte, OS);
782 EmitByte(0x0F, CurByte, OS);
788 EmitByte(0x38, CurByte, OS);
791 EmitByte(0x3A, CurByte, OS);
794 EmitByte(0xA6, CurByte, OS);
797 EmitByte(0xA7, CurByte, OS);
824 unsigned CurByte = 0;
843 EmitOpcodePrefix(TSFlags, CurByte, MemoryOperand, MI, Desc, OS);
845 EmitVEXOpcodePrefix(TSFlags, CurByte, MemoryOperand, MI, Desc, OS);
862 EmitByte(BaseOpcode, CurByte, OS);
866 EmitByte(BaseOpcode, CurByte, OS);
869 CurByte, OS, Fixups);
870 EmitImmediate(MI.getOperand(CurOp++), 1, FK_Data_1, CurByte, OS, Fixups);
873 EmitByte(BaseOpcode, CurByte, OS);
876 CurByte, OS, Fixups);
877 EmitImmediate(MI.getOperand(CurOp++), 2, FK_Data_2, CurByte, OS, Fixups);
881 EmitByte(BaseOpcode + GetX86RegNum(MI.getOperand(CurOp++)), CurByte, OS);
885 EmitByte(BaseOpcode, CurByte, OS);
887 GetX86RegNum(MI.getOperand(CurOp+1)), CurByte, OS);
892 EmitByte(BaseOpcode, CurByte, OS);
900 TSFlags, CurByte, OS, Fixups);
905 EmitByte(BaseOpcode, CurByte, OS);
912 GetX86RegNum(MI.getOperand(CurOp)), CurByte, OS);
924 EmitByte(BaseOpcode, CurByte, OS);
927 TSFlags, CurByte, OS, Fixups);
938 EmitByte(BaseOpcode, CurByte, OS);
941 CurByte, OS);
947 EmitByte(BaseOpcode, CurByte, OS);
949 TSFlags, CurByte, OS, Fixups);
953 EmitByte(BaseOpcode, CurByte, OS);
954 EmitByte(0xC1, CurByte, OS);
957 EmitByte(BaseOpcode, CurByte, OS);
958 EmitByte(0xC2, CurByte, OS);
961 EmitByte(BaseOpcode, CurByte, OS);
962 EmitByte(0xC3, CurByte, OS);
965 EmitByte(BaseOpcode, CurByte, OS);
966 EmitByte(0xC4, CurByte, OS);
969 EmitByte(BaseOpcode, CurByte, OS);
970 EmitByte(0xC8, CurByte, OS);
973 EmitByte(BaseOpcode, CurByte, OS);
974 EmitByte(0xC9, CurByte, OS);
977 EmitByte(BaseOpcode, CurByte, OS);
978 EmitByte(0xE8, CurByte, OS);
981 EmitByte(BaseOpcode, CurByte, OS);
982 EmitByte(0xF0, CurByte, OS);
985 EmitByte(BaseOpcode, CurByte, OS);
986 EmitByte(0xF8, CurByte, OS);
989 EmitByte(BaseOpcode, CurByte, OS);
990 EmitByte(0xF9, CurByte, OS);
993 EmitByte(BaseOpcode, CurByte, OS);
994 EmitByte(0xD0, CurByte, OS);
997 EmitByte(BaseOpcode, CurByte, OS);
998 EmitByte(0xD1, CurByte, OS);
1013 EmitImmediate(MCOperand::CreateImm(RegNum), 1, FK_Data_1, CurByte, OS,
1027 CurByte, OS, Fixups);
1032 EmitByte(X86II::getBaseOpcodeFor(TSFlags), CurByte, OS);