aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Instructions/InstEmitHelper.cs
diff options
context:
space:
mode:
authormerry <git@mary.rs>2022-02-11 20:51:03 +0000
committerGitHub <noreply@github.com>2022-02-11 17:51:03 -0300
commitce71f9144e1575c432bb009755f01466cd685fbf (patch)
tree3f8355b47553388367ec4f0d478e1a70d37fd493 /ARMeilleure/Instructions/InstEmitHelper.cs
parentf861f0bca2767f74478bc444a7a057d05cc96638 (diff)
InstEmitMemory32: Literal loads always have word-aligned PC (#3104)1.1.26
Diffstat (limited to 'ARMeilleure/Instructions/InstEmitHelper.cs')
-rw-r--r--ARMeilleure/Instructions/InstEmitHelper.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/ARMeilleure/Instructions/InstEmitHelper.cs b/ARMeilleure/Instructions/InstEmitHelper.cs
index 0479c380..d1b9de84 100644
--- a/ARMeilleure/Instructions/InstEmitHelper.cs
+++ b/ARMeilleure/Instructions/InstEmitHelper.cs
@@ -47,6 +47,20 @@ namespace ARMeilleure.Instructions
}
}
+ public static Operand GetIntA32AlignedPC(ArmEmitterContext context, int regIndex)
+ {
+ if (regIndex == RegisterAlias.Aarch32Pc)
+ {
+ OpCode32 op = (OpCode32)context.CurrOp;
+
+ return Const((int)(op.GetPc() & 0xfffffffc));
+ }
+ else
+ {
+ return Register(GetRegisterAlias(context.Mode, regIndex), RegisterType.Integer, OperandType.I32);
+ }
+ }
+
public static Operand GetVecA32(int regIndex)
{
return Register(regIndex, RegisterType.Vector, OperandType.V128);