library/src/decoders/x86ASM/BP-x86InstDecode.cc
// Determines if an instruction is +i encoded for floating
// point operations.
Determines if an instruction is +i encoded for floating
point operations.
Determines if an instruction is + i encoded for floating point operations .
int X86_32_IsInstructionFloatingPointPlusEncoded(P_X86_32_DECODED_INSTRUCTION partialDecode){
	if(partialDecode == NULL)
		return false;
	switch((unsigned char ) partialDecode->instruction->binOpcode[0]){
		case 0xD8:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
				case 0xd0:
					return true;
				P
				case 0xd8:
					return true;
				case 0xe0:
					return true;
				R
				case 0xe8:
					return true;
				case 0xf0:
					return true;
				R
				case 0xf8:
					return true;
			}
			break;
		case 0xD9:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
			}
			break;
		case 0xDA:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
				case 0xd0:
					return true;
				case 0xd8:
					return true;
			}
			break;
		case 0xDB:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
				case 0xd0:
					return true;
				case 0xd8:
					return true;
				case 0xe8:
					return true;
				case 0xf0:
					return true;
			}
		case 0xDC:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
				case 0xe0:
					return true;
				case 0xe8:
					return true;
				case 0xf0:
					return true;
				case 0xf8:
					return true;
			}
		case 0xDD:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xd0:
					return true;
				case 0xd8:
					return true;
				case 0xe0:
					return true;
				case 0xe8:
					return true;
			}
		case 0xDE:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xc0:
					return true;
				case 0xc8:
					return true;
				case 0xe0:
					return true;
				case 0xe8:
					return true;
				case 0xf0:
					return true;
				case 0xf8:
					return true;
			}
		case 0xDF:
			switch(partialDecode->instruction->binOpcode[1]){
				case 0xe8:
					return true;
				case 0xf0:
					return true;
			}
	}
}
int X86_32_IsInstructionFloatingPointPlusEncoded ( P_X86_32_DECODED_INSTRUCTION partialDecode ) { if ( partialDecode == NULL ) return false ; switch ( ( unsigned char ) partialDecode -> instruction -> binOpcode [ 0 ] ) { case 0xD8 : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; case 0xd0 : return true ; case 0xd8 : return true ; case 0xe0 : return true ; case 0xe8 : return true ; case 0xf0 : return true ; case 0xf8 : return true ; } break ; case 0xD9 : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; } break ; case 0xDA : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; case 0xd0 : return true ; case 0xd8 : return true ; } break ; case 0xDB : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; case 0xd0 : return true ; case 0xd8 : return true ; case 0xe8 : return true ; case 0xf0 : return true ; } case 0xDC : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; case 0xe0 : return true ; case 0xe8 : return true ; case 0xf0 : return true ; case 0xf8 : return true ; } case 0xDD : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xd0 : return true ; case 0xd8 : return true ; case 0xe0 : return true ; case 0xe8 : return true ; } case 0xDE : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xc0 : return true ; case 0xc8 : return true ; case 0xe0 : return true ; case 0xe8 : return true ; case 0xf0 : return true ; case 0xf8 : return true ; } case 0xDF : switch ( partialDecode -> instruction -> binOpcode [ 1 ] ) { case 0xe8 : return true ; case 0xf0 : return true ; } } }
Determines if an instruction is +i encoded for floating
point operations.
Determines if an instruction is + i encoded for floating point operations .
// potential 2 byte opcodes maximum // match first byte first, then check second bytes // First primary, FADD // FADD // FMUL // FCOM // FCOMP // FSUB // FSUBR // FDIV // FDIVR // FLD // FLD // FLD // FLD // FLD // FLD