Пример #1
0
void fpuLoadControl(void *Variable)
{
#ifdef USEX64
    PUTDST16(RecompPos, 0xB849);
    PUTDST64(RecompPos, Variable);
    PUTDST8(RecompPos, 0x41);
    PUTDST16(RecompPos, 0x28D9);
#else
    PUTDST16(RecompPos, 0x2DD9);
    PUTDST32(RecompPos, Variable);
#endif
}
Пример #2
0
void fpuExchange(int Reg)
{
    switch (Reg) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC8D9);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC9D9);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xCAD9);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xCBD9);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xCCD9);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xCDD9);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xCED9);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xCFD9);
	break;
    }
}
Пример #3
0
void fpuAddRegPop(int *StackPos, int x86reg)
{
    *StackPos = (*StackPos + 1) & 7;
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC0DE);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC1DE);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xC2DE);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xC3DE);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xC4DE);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xC5DE);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xC6DE);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xC7DE);
	break;
    }
}
Пример #4
0
void fpuDivRegPop(int x86reg)
{
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xF8DE);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xF9DE);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xFADE);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xFBDE);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xFCDE);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xFDDE);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xFEDE);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xFFDE);
	break;
    }
}
Пример #5
0
void fpuSubRegPop(int x86reg)
{
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xE8DE);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xE9DE);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xEADE);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xEBDE);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xECDE);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xEDDE);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xEEDE);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xEFDE);
	break;
    }
}
Пример #6
0
void fpuSubReg(int x86reg)
{
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xE0D8);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xE1D8);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xE2D8);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xE3D8);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xE4D8);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xE5D8);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xE6D8);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xE7D8);
	break;
	break;
    }
}
Пример #7
0
void fpuLoadReg(int *StackPos, int Reg)
{
    *StackPos = (*StackPos - 1) & 7;
    switch (Reg) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC0D9);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC1D9);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xC2D9);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xC3D9);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xC4D9);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xC5D9);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xC6D9);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xC7D9);
	break;
	break;
    }
}
Пример #8
0
void fpuComReg(int x86reg, uint32_t Pop)
{
    int s = (Pop == 1) ? 0x0800 : 0x0000;

    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xD0D8 | s);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xD1D8 | s);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xD2D8 | s);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xD3D8 | s);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xD4D8 | s);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xD5D8 | s);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xD6D8 | s);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xD7D8 | s);
	break;
    }
}
Пример #9
0
void fpuDivReg(int Reg)
{
    switch (Reg) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xF0D8);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xF1D8);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xF2D8);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xF3D8);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xF4D8);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xF5D8);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xF6D8);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xF7D8);
	break;
    }
}
Пример #10
0
void fpuAddReg(int x86reg)
{
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC0D8);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC1D8);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xC2D8);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xC3D8);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xC4D8);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xC5D8);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xC6D8);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xC7D8);
	break;
    }
}
Пример #11
0
void fpuMulRegPop(int x86reg)
{
    switch (x86reg & 0xf) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC8DE);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC9DE);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xCADE);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xCBDE);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xCCDE);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xCDDE);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xCEDE);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xCFDE);
	break;
    }
}
Пример #12
0
void fpuFree(int Reg)
{
    switch (Reg) {
    case x86_ST0:
	PUTDST16(RecompPos, 0xC0DD);
	break;
    case x86_ST1:
	PUTDST16(RecompPos, 0xC1DD);
	break;
    case x86_ST2:
	PUTDST16(RecompPos, 0xC2DD);
	break;
    case x86_ST3:
	PUTDST16(RecompPos, 0xC3DD);
	break;
    case x86_ST4:
	PUTDST16(RecompPos, 0xC4DD);
	break;
    case x86_ST5:
	PUTDST16(RecompPos, 0xC5DD);
	break;
    case x86_ST6:
	PUTDST16(RecompPos, 0xC6DD);
	break;
    case x86_ST7:
	PUTDST16(RecompPos, 0xC7DD);
	break;
    }
}
Пример #13
0
void SseMoveAlignedN64MemToReg(int sseReg, int AddrReg) {
	BYTE x86Command = 0;

	CPU_Message("      movaps %s, xmmword ptr [Dmem+%s]",sse_Name(sseReg), x86_Name(AddrReg));

	switch (sseReg) {
	case x86_XMM0: x86Command = 0x80; break;
	case x86_XMM1: x86Command = 0x88; break;
	case x86_XMM2: x86Command = 0x90; break;
	case x86_XMM3: x86Command = 0x98; break;
	case x86_XMM4: x86Command = 0xA0; break;
	case x86_XMM5: x86Command = 0xA8; break;
	case x86_XMM6: x86Command = 0xB0; break;
	case x86_XMM7: x86Command = 0xB8; break;
	}	
	switch (AddrReg) {
	case x86_EAX: x86Command += 0x00; break;
	case x86_EBX: x86Command += 0x03; break;
	case x86_ECX: x86Command += 0x01; break;
	case x86_EDX: x86Command += 0x02; break;
	case x86_ESI: x86Command += 0x06; break;
	case x86_EDI: x86Command += 0x07; break;
	case x86_ESP: x86Command += 0x04; break;
	case x86_EBP: x86Command += 0x05; break;
	}

	PUTDST16(RecompPos,0x280f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, RSPInfo.DMEM);
}
Пример #14
0
void SseShuffleReg(int Dest, int Source, BYTE Immed) {
	BYTE x86Command = 0;

	CPU_Message("      shufps %s, %s, %02X", sse_Name(Dest), sse_Name(Source), Immed);

	switch (Dest) {
	case x86_XMM0: x86Command = 0x00; break;
	case x86_XMM1: x86Command = 0x08; break;
	case x86_XMM2: x86Command = 0x10; break;
	case x86_XMM3: x86Command = 0x18; break;
	case x86_XMM4: x86Command = 0x20; break;
	case x86_XMM5: x86Command = 0x28; break;
	case x86_XMM6: x86Command = 0x30; break;
	case x86_XMM7: x86Command = 0x38; break;
	}
	switch (Source) {
	case x86_XMM0: x86Command += 0x00; break;
	case x86_XMM1: x86Command += 0x01; break;
	case x86_XMM2: x86Command += 0x02; break;
	case x86_XMM3: x86Command += 0x03; break;
	case x86_XMM4: x86Command += 0x04; break;
	case x86_XMM5: x86Command += 0x05; break;
	case x86_XMM6: x86Command += 0x06; break;
	case x86_XMM7: x86Command += 0x07; break;
	}
	PUTDST16(RecompPos,0xC60f);
	PUTDST8(RecompPos, 0xC0 | x86Command);
	PUTDST8(RecompPos, Immed);
}
Пример #15
0
void SseXorRegToReg(int Dest, int Source) {
	BYTE x86Command = 0;

	CPU_Message("      xorps %s, %s", sse_Name(Dest), sse_Name(Source));

	switch (Dest) {
	case x86_XMM0: x86Command = 0x00; break;
	case x86_XMM1: x86Command = 0x08; break;
	case x86_XMM2: x86Command = 0x10; break;
	case x86_XMM3: x86Command = 0x18; break;
	case x86_XMM4: x86Command = 0x20; break;
	case x86_XMM5: x86Command = 0x28; break;
	case x86_XMM6: x86Command = 0x30; break;
	case x86_XMM7: x86Command = 0x38; break;
	}
	switch (Source) {
	case x86_XMM0: x86Command += 0x00; break;
	case x86_XMM1: x86Command += 0x01; break;
	case x86_XMM2: x86Command += 0x02; break;
	case x86_XMM3: x86Command += 0x03; break;
	case x86_XMM4: x86Command += 0x04; break;
	case x86_XMM5: x86Command += 0x05; break;
	case x86_XMM6: x86Command += 0x06; break;
	case x86_XMM7: x86Command += 0x07; break;
	}
	PUTDST16(RecompPos,0x570f);
	PUTDST8(RecompPos, 0xC0 | x86Command);
}
Пример #16
0
void MmxUnpackHighWord(int Dest, int Source) {
	BYTE x86Command = 0;

	CPU_Message("      punpckhwd %s, %s", mmx_Name(Dest), mmx_Name(Source));

	switch (Dest) {
	case x86_MM0: x86Command = 0 << 3; break;
	case x86_MM1: x86Command = 1 << 3; break;
	case x86_MM2: x86Command = 2 << 3; break;
	case x86_MM3: x86Command = 3 << 3; break;
	case x86_MM4: x86Command = 4 << 3; break;
	case x86_MM5: x86Command = 5 << 3; break;
	case x86_MM6: x86Command = 6 << 3; break;
	case x86_MM7: x86Command = 7 << 3; break;
	}
	switch (Source) {
	case x86_MM0: x86Command |= 0; break;
	case x86_MM1: x86Command |= 1; break;
	case x86_MM2: x86Command |= 2; break;
	case x86_MM3: x86Command |= 3; break;
	case x86_MM4: x86Command |= 4; break;
	case x86_MM5: x86Command |= 5; break;
	case x86_MM6: x86Command |= 6; break;
	case x86_MM7: x86Command |= 7; break;
	}
	PUTDST16(RecompPos,0x690f);
	PUTDST8(RecompPos, 0xC0 | x86Command);
}
Пример #17
0
void MmxCompareGreaterWordRegToReg(int Dest, int Source) {
	BYTE x86Command = 0;

	CPU_Message("      pcmpgtw %s, %s", mmx_Name(Dest), mmx_Name(Source));

	switch (Dest) {
	case x86_MM0: x86Command = 0 << 3; break;
	case x86_MM1: x86Command = 1 << 3; break;
	case x86_MM2: x86Command = 2 << 3; break;
	case x86_MM3: x86Command = 3 << 3; break;
	case x86_MM4: x86Command = 4 << 3; break;
	case x86_MM5: x86Command = 5 << 3; break;
	case x86_MM6: x86Command = 6 << 3; break;
	case x86_MM7: x86Command = 7 << 3; break;
	}
	switch (Source) {
	case x86_MM0: x86Command |= 0; break;
	case x86_MM1: x86Command |= 1; break;
	case x86_MM2: x86Command |= 2; break;
	case x86_MM3: x86Command |= 3; break;
	case x86_MM4: x86Command |= 4; break;
	case x86_MM5: x86Command |= 5; break;
	case x86_MM6: x86Command |= 6; break;
	case x86_MM7: x86Command |= 7; break;
	}
	PUTDST16(RecompPos,0x650f);
	PUTDST8(RecompPos, 0xC0 | x86Command);
}
Пример #18
0
void fpuLoadQword(int *StackPos, void *Variable)
{
    *StackPos = (*StackPos - 1) & 7;
    BreakPoint();
    PUTDST16(RecompPos, 0x05DD);
    PUTDST32(RecompPos, Variable);
}
Пример #19
0
void fpuLoadIntegerQword(int *StackPos, void *Variable)
{
    *StackPos = (*StackPos - 1) & 7;
    BreakPoint();
    PUTDST16(RecompPos, 0x2DDF);
    PUTDST32(RecompPos, Variable);
}
Пример #20
0
void fpuStoreIntegerDword(int *StackPos, void *Variable, uint32_t pop)
{
    if (pop) {
	*StackPos = (*StackPos + 1) & 7;
    }
    BreakPoint();
    PUTDST16(RecompPos, (pop == 0) ? 0x15DB : 0x1DDB);
    PUTDST32(RecompPos, Variable);
}
Пример #21
0
void fpuStoreIntegerQword(int *StackPos, void *Variable, uint32_t pop)
{
    if (pop) {
	*StackPos = (*StackPos + 1) & 7;
    }
    BreakPoint();
    PUTDST16(RecompPos, (pop == 0) ? 0x35DF : 0x3DDF);
    PUTDST32(RecompPos, Variable);
    if (!pop) {
	BreakPoint();
    }
}
Пример #22
0
void MmxPmulhwRegToVariable(int Dest, void * Variable, char * VariableName) {
	BYTE x86Command = 0;

	CPU_Message("      pmulhw %s, [%s]", mmx_Name(Dest), VariableName);

	switch (Dest) {
	case x86_MM0: x86Command = 0x05; break;
	case x86_MM1: x86Command = 0x0D; break;
	case x86_MM2: x86Command = 0x15; break;
	case x86_MM3: x86Command = 0x1D; break;
	case x86_MM4: x86Command = 0x25; break;
	case x86_MM5: x86Command = 0x2D; break;
	case x86_MM6: x86Command = 0x35; break;
	case x86_MM7: x86Command = 0x3D; break;
	}
	PUTDST16(RecompPos,0xe50f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, Variable);
}
Пример #23
0
void SseMoveUnalignedVariableToReg(void *Variable, char *VariableName, int sseReg) {
	BYTE x86Command = 0;

	CPU_Message("      movups %s, xmmword ptr [%s]",sse_Name(sseReg), VariableName);

	switch (sseReg) {
	case x86_XMM0: x86Command = 0x05; break;
	case x86_XMM1: x86Command = 0x0D; break;
	case x86_XMM2: x86Command = 0x15; break;
	case x86_XMM3: x86Command = 0x1D; break;
	case x86_XMM4: x86Command = 0x25; break;
	case x86_XMM5: x86Command = 0x2D; break;
	case x86_XMM6: x86Command = 0x35; break;
	case x86_XMM7: x86Command = 0x3D; break;
	}	

	PUTDST16(RecompPos,0x100f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, Variable);
}
Пример #24
0
void SseMoveAlignedRegToVariable(int sseReg, void *Variable, char *VariableName) {
	BYTE x86Command = 0;

	CPU_Message("      movaps xmmword ptr [%s], %s",VariableName, sse_Name(sseReg));

	switch (sseReg) {
	case x86_XMM0: x86Command = 0x05; break;
	case x86_XMM1: x86Command = 0x0D; break;
	case x86_XMM2: x86Command = 0x15; break;
	case x86_XMM3: x86Command = 0x1D; break;
	case x86_XMM4: x86Command = 0x25; break;
	case x86_XMM5: x86Command = 0x2D; break;
	case x86_XMM6: x86Command = 0x35; break;
	case x86_XMM7: x86Command = 0x3D; break;
	}	

	PUTDST16(RecompPos,0x290f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, Variable);
}
Пример #25
0
void MmxMoveQwordVariableToReg(int Dest, void *Variable, char *VariableName) {
	BYTE x86Command = 0;

	CPU_Message("      movq %s, qword ptr [%s]",mmx_Name(Dest), VariableName);

	switch (Dest) {
	case x86_MM0: x86Command = 0x05; break;
	case x86_MM1: x86Command = 0x0D; break;
	case x86_MM2: x86Command = 0x15; break;
	case x86_MM3: x86Command = 0x1D; break;
	case x86_MM4: x86Command = 0x25; break;
	case x86_MM5: x86Command = 0x2D; break;
	case x86_MM6: x86Command = 0x35; break;
	case x86_MM7: x86Command = 0x3D; break;
	}	

	PUTDST16(RecompPos,0x6f0f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, Variable);
}
Пример #26
0
void MmxPsrawImmed(int Dest, BYTE Immed) {
	BYTE x86Command = 0;

	CPU_Message("      psraw %s, %i", mmx_Name(Dest), Immed);

	switch (Dest) {
	case x86_MM0: x86Command = 0xE0; break;
	case x86_MM1: x86Command = 0xE1; break;
	case x86_MM2: x86Command = 0xE2; break;
	case x86_MM3: x86Command = 0xE3; break;
	case x86_MM4: x86Command = 0xE4; break;
	case x86_MM5: x86Command = 0xE5; break;
	case x86_MM6: x86Command = 0xE6; break;
	case x86_MM7: x86Command = 0xE7; break;
	}	

	PUTDST16(RecompPos,0x710f);
	PUTDST8(RecompPos, x86Command);
	PUTDST8(RecompPos, Immed);
}
Пример #27
0
void MmxPsllwImmed(int Dest, BYTE Immed) {
	BYTE x86Command = 0;

	CPU_Message("      psllw %s, %i", mmx_Name(Dest), Immed);

	switch (Dest) {
	case x86_MM0: x86Command = 0xF0; break;
	case x86_MM1: x86Command = 0xF1; break;
	case x86_MM2: x86Command = 0xF2; break;
	case x86_MM3: x86Command = 0xF3; break;
	case x86_MM4: x86Command = 0xF4; break;
	case x86_MM5: x86Command = 0xF5; break;
	case x86_MM6: x86Command = 0xF6; break;
	case x86_MM7: x86Command = 0xF7; break;
	}	

	PUTDST16(RecompPos,0x710f);
	PUTDST8(RecompPos, x86Command);
	PUTDST8(RecompPos, Immed);
}
Пример #28
0
void MmxShuffleMemoryToReg(int Dest, void * Variable, char * VariableName, BYTE Immed) {
	BYTE x86Command = 0;

	CPU_Message("      pshufw %s, [%s], %02X", mmx_Name(Dest), VariableName, Immed);

	switch (Dest) {
	case x86_MM0: x86Command = 0x05; break;
	case x86_MM1: x86Command = 0x0D; break;
	case x86_MM2: x86Command = 0x15; break;
	case x86_MM3: x86Command = 0x1D; break;
	case x86_MM4: x86Command = 0x25; break;
	case x86_MM5: x86Command = 0x2D; break;
	case x86_MM6: x86Command = 0x35; break;
	case x86_MM7: x86Command = 0x3D; break;
	}

	PUTDST16(RecompPos,0x700f);
	PUTDST8(RecompPos, x86Command);
	PUTDSTPTR(RecompPos, Variable);
	PUTDST8(RecompPos, Immed);	
}
Пример #29
0
void fpuDivQwordReverse(void *Variable)
{
    BreakPoint();
    PUTDST16(RecompPos, 0x3DDC);
    PUTDST32(RecompPos, Variable);
}
Пример #30
0
void fpuSubQword(void *Variable)
{
    BreakPoint();
    PUTDST16(RecompPos, 0x25DC);
    PUTDST32(RecompPos, Variable);
}