Skip to content

Commit

Permalink
ARMeilleure: Allow TPIDR2_EL0 to be set properly (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeWarnut authored Dec 2, 2024
1 parent 6b5cb15 commit 17483aa
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ARMeilleure/Instructions/InstEmitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static void Msr(ArmEmitterContext context)
EmitSetTpidrEl0(context);
return;
case 0b11_011_1101_0000_101:
EmitGetTpidr2El0(context);
EmitSetTpidr2El0(context);
return;

default:
Expand Down Expand Up @@ -291,5 +291,16 @@ private static void EmitSetTpidrEl0(ArmEmitterContext context)

context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidrEl0Offset())), value);
}

private static void EmitSetTpidr2El0(ArmEmitterContext context)
{
OpCodeSystem op = (OpCodeSystem)context.CurrOp;

Operand value = GetIntOrZR(context, op.Rt);

Operand nativeContext = context.LoadArgument(OperandType.I64, 0);

context.Store(context.Add(nativeContext, Const((ulong)NativeContext.GetTpidr2El0Offset())), value);
}
}
}

0 comments on commit 17483aa

Please sign in to comment.