mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Common: Switch movss/d to auto SSE/AVX
This commit is contained in:
committed by
TellowKrinkle
parent
88515d58ab
commit
3599438e57
@@ -459,13 +459,15 @@ namespace x86Emitter
|
||||
extern void xMOVQZX(const xRegisterSSE& dst, const xIndirectVoid& src);
|
||||
extern void xMOVQZX(const xRegisterSSE& dst, const xRegisterSSE& src);
|
||||
|
||||
extern void xMOVSS(const xRegisterSSE& to, const xRegisterSSE& from);
|
||||
extern void xMOVSS(const xIndirectVoid& to, const xRegisterSSE& from);
|
||||
extern void xMOVSD(const xRegisterSSE& to, const xRegisterSSE& from);
|
||||
extern void xMOVSD(const xIndirectVoid& to, const xRegisterSSE& from);
|
||||
extern void xMOVSS(const xRegisterSSE& dst, const xRegisterSSE& src1, const xRegisterSSE& src2);
|
||||
static void xMOVSS(const xRegisterSSE& dst, const xRegisterSSE& src) { xMOVSS(dst, dst, src); }
|
||||
extern void xMOVSS(const xIndirectVoid& dst, const xRegisterSSE& src);
|
||||
extern void xMOVSD(const xRegisterSSE& dst, const xRegisterSSE& src1, const xRegisterSSE& src2);
|
||||
static void xMOVSD(const xRegisterSSE& dst, const xRegisterSSE& src) { xMOVSD(dst, dst, src); }
|
||||
extern void xMOVSD(const xIndirectVoid& dst, const xRegisterSSE& src);
|
||||
|
||||
extern void xMOVSSZX(const xRegisterSSE& to, const xIndirectVoid& from);
|
||||
extern void xMOVSDZX(const xRegisterSSE& to, const xIndirectVoid& from);
|
||||
extern void xMOVSSZX(const xRegisterSSE& dst, const xIndirectVoid& src);
|
||||
extern void xMOVSDZX(const xRegisterSSE& dst, const xIndirectVoid& src);
|
||||
|
||||
extern void xMOVNTDQA(const xRegisterSSE& to, const xIndirectVoid& from);
|
||||
extern void xMOVNTDQA(const xIndirectVoid& to, const xRegisterSSE& from);
|
||||
|
||||
@@ -809,16 +809,25 @@ namespace x86Emitter
|
||||
//
|
||||
|
||||
#define IMPLEMENT_xMOVS(ssd, prefix) \
|
||||
__fi void xMOV##ssd(const xRegisterSSE& to, const xRegisterSSE& from) \
|
||||
__fi void xMOV##ssd(const xRegisterSSE& dst, const xRegisterSSE& src1, const xRegisterSSE& src2) \
|
||||
{ \
|
||||
if (to != from) \
|
||||
xOpWrite0F(prefix, 0x10, to, from); \
|
||||
if (src1 == src2) \
|
||||
return xMOVAPS(dst, src1); \
|
||||
SIMDInstructionInfo op = SIMDInstructionInfo(0x10).prefix(); \
|
||||
const xRegisterSSE* psrc = &src2; \
|
||||
const xRegisterSSE* pdst = &dst; \
|
||||
if (x86Emitter::use_avx && src2.IsExtended() && !dst.IsExtended()) \
|
||||
{ \
|
||||
op.opcode = 0x11; \
|
||||
std::swap(psrc, pdst); \
|
||||
} \
|
||||
EmitSIMD(op, *pdst, src1, *psrc); \
|
||||
} \
|
||||
__fi void xMOV##ssd##ZX(const xRegisterSSE& to, const xIndirectVoid& from) { xOpWrite0F(prefix, 0x10, to, from); } \
|
||||
__fi void xMOV##ssd(const xIndirectVoid& to, const xRegisterSSE& from) { xOpWrite0F(prefix, 0x11, from, to); }
|
||||
__fi void xMOV##ssd##ZX(const xRegisterSSE& dst, const xIndirectVoid& src) { EmitSIMD(SIMDInstructionInfo(0x10).prefix().mov(), dst, dst, src); } \
|
||||
__fi void xMOV##ssd (const xIndirectVoid& dst, const xRegisterSSE& src) { EmitSIMD(SIMDInstructionInfo(0x11).prefix().mov(), src, src, dst); }
|
||||
|
||||
IMPLEMENT_xMOVS(SS, 0xf3)
|
||||
IMPLEMENT_xMOVS(SD, 0xf2)
|
||||
IMPLEMENT_xMOVS(SS, pf3)
|
||||
IMPLEMENT_xMOVS(SD, pf2)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Non-temporal movs only support a register as a target (ie, load form only, no stores)
|
||||
|
||||
Reference in New Issue
Block a user