mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-27 17:07:10 +02:00
Arm64: Simplify TryEncodeBitMask and use for constants (#4328)
* Arm64: Simplify TryEncodeBitMask * CodeGenerator: Use TryEncodeBitMask in GenerateConstantCopy * Ptc: Bump version
This commit is contained in:
parent
1b8b0b4aa3
commit
363f3b5491
5 changed files with 81 additions and 107 deletions
|
@ -1303,7 +1303,15 @@ namespace ARMeilleure.CodeGen.Arm64
|
|||
|
||||
private static void GenerateConstantCopy(CodeGenContext context, Operand dest, ulong value)
|
||||
{
|
||||
if (value != 0)
|
||||
if (value == 0)
|
||||
{
|
||||
context.Assembler.Mov(dest, Register(ZrRegister, dest.Type));
|
||||
}
|
||||
else if (CodeGenCommon.TryEncodeBitMask(dest.Type, value, out _, out _, out _))
|
||||
{
|
||||
context.Assembler.Orr(dest, Register(ZrRegister, dest.Type), Const(dest.Type, (long)value));
|
||||
}
|
||||
else
|
||||
{
|
||||
int hw = 0;
|
||||
bool first = true;
|
||||
|
@ -1328,10 +1336,6 @@ namespace ARMeilleure.CodeGen.Arm64
|
|||
value >>= 16;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Assembler.Mov(dest, Register(ZrRegister, dest.Type));
|
||||
}
|
||||
}
|
||||
|
||||
private static void GenerateAtomicCas(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue