Jit_Integer: Add trivial AndWithMask cases

Add cases to handle all one and all zero masks.
This commit is contained in:
MerryMage 2020-12-26 23:57:07 +00:00
parent ce599f9f46
commit bea6a86893
1 changed files with 6 additions and 1 deletions

View File

@ -194,7 +194,12 @@ void Jit64::ComputeRC(preg_t preg, bool needs_test, bool needs_sext)
// flags. // flags.
void Jit64::AndWithMask(X64Reg reg, u32 mask) void Jit64::AndWithMask(X64Reg reg, u32 mask)
{ {
if (mask == 0xff) if (mask == 0xffffffff)
return;
if (mask == 0)
XOR(32, R(reg), R(reg));
else if (mask == 0xff)
MOVZX(32, 8, reg, R(reg)); MOVZX(32, 8, reg, R(reg));
else if (mask == 0xffff) else if (mask == 0xffff)
MOVZX(32, 16, reg, R(reg)); MOVZX(32, 16, reg, R(reg));