Merge pull request #9364 from MerryMage/AndWithMask

Jit_Integer: Add trivial AndWithMask cases
This commit is contained in:
JosJuice 2020-12-27 12:45:34 +01:00 committed by GitHub
commit 74ba993b4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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));