Rename IoType to VarType

This commit is contained in:
gdkchan 2019-02-25 13:13:47 -03:00
commit 4ab1fb031c
6 changed files with 16 additions and 18 deletions

View file

@ -39,7 +39,6 @@ namespace ChocolArm64.Instructions
context.EmitLdc_I(op.Position + 4); context.EmitLdc_I(op.Position + 4);
context.EmitStint(RegisterAlias.Lr); context.EmitStint(RegisterAlias.Lr);
context.EmitStoreState();
EmitCall(context, op.Imm); EmitCall(context, op.Imm);
} }

View file

@ -65,7 +65,6 @@ namespace ChocolArm64.Instructions
} }
context.EmitStint(GetBankedRegisterAlias(context.Mode, RegisterAlias.Aarch32Lr)); context.EmitStint(GetBankedRegisterAlias(context.Mode, RegisterAlias.Aarch32Lr));
context.EmitStoreState();
//If x is true, then this is a branch with link and exchange. //If x is true, then this is a branch with link and exchange.
//In this case we need to swap the mode between Arm <-> Thumb. //In this case we need to swap the mode between Arm <-> Thumb.

View file

@ -39,7 +39,7 @@ namespace ChocolArm64.Translation
} }
else if (emitter is ILOpCodeLoad ld && ILMethodBuilder.IsRegIndex(ld.Index)) else if (emitter is ILOpCodeLoad ld && ILMethodBuilder.IsRegIndex(ld.Index))
{ {
switch (ld.IoType) switch (ld.VarType)
{ {
case VarType.Flag: IntInputs |= ((1L << ld.Index) << 32) & ~_intAwOutputs; break; case VarType.Flag: IntInputs |= ((1L << ld.Index) << 32) & ~_intAwOutputs; break;
case VarType.Int: IntInputs |= (1L << ld.Index) & ~_intAwOutputs; break; case VarType.Int: IntInputs |= (1L << ld.Index) & ~_intAwOutputs; break;
@ -48,7 +48,7 @@ namespace ChocolArm64.Translation
} }
else if (emitter is ILOpCodeStore st && ILMethodBuilder.IsRegIndex(st.Index)) else if (emitter is ILOpCodeStore st && ILMethodBuilder.IsRegIndex(st.Index))
{ {
switch (st.IoType) switch (st.VarType)
{ {
case VarType.Flag: IntOutputs |= (1L << st.Index) << 32; break; case VarType.Flag: IntOutputs |= (1L << st.Index) << 32; break;
case VarType.Int: IntOutputs |= 1L << st.Index; break; case VarType.Int: IntOutputs |= 1L << st.Index; break;

View file

@ -644,19 +644,19 @@ namespace ChocolArm64.Translation
Stloc(index, VarType.Flag); Stloc(index, VarType.Flag);
} }
private void Ldloc(int index, VarType ioType) private void Ldloc(int index, VarType varType)
{ {
_ilBlock.Add(new ILOpCodeLoad(index, ioType, CurrOp.RegisterSize)); _ilBlock.Add(new ILOpCodeLoad(index, varType, CurrOp.RegisterSize));
} }
private void Ldloc(int index, VarType ioType, RegisterSize registerSize) private void Ldloc(int index, VarType varType, RegisterSize registerSize)
{ {
_ilBlock.Add(new ILOpCodeLoad(index, ioType, registerSize)); _ilBlock.Add(new ILOpCodeLoad(index, varType, registerSize));
} }
private void Stloc(int index, VarType ioType) private void Stloc(int index, VarType varType)
{ {
_ilBlock.Add(new ILOpCodeStore(index, ioType, CurrOp.RegisterSize)); _ilBlock.Add(new ILOpCodeStore(index, varType, CurrOp.RegisterSize));
} }
public void EmitCallPropGet(Type objType, string propName) public void EmitCallPropGet(Type objType, string propName)

View file

@ -7,20 +7,20 @@ namespace ChocolArm64.Translation
{ {
public int Index { get; } public int Index { get; }
public VarType IoType { get; } public VarType VarType { get; }
public RegisterSize RegisterSize { get; } public RegisterSize RegisterSize { get; }
public ILOpCodeLoad(int index, VarType ioType, RegisterSize registerSize = 0) public ILOpCodeLoad(int index, VarType varType, RegisterSize registerSize = 0)
{ {
Index = index; Index = index;
IoType = ioType; VarType = varType;
RegisterSize = registerSize; RegisterSize = registerSize;
} }
public void Emit(ILMethodBuilder context) public void Emit(ILMethodBuilder context)
{ {
switch (IoType) switch (VarType)
{ {
case VarType.Arg: context.Generator.EmitLdarg(Index); break; case VarType.Arg: context.Generator.EmitLdarg(Index); break;

View file

@ -7,20 +7,20 @@ namespace ChocolArm64.Translation
{ {
public int Index { get; } public int Index { get; }
public VarType IoType { get; } public VarType VarType { get; }
public RegisterSize RegisterSize { get; } public RegisterSize RegisterSize { get; }
public ILOpCodeStore(int index, VarType ioType, RegisterSize registerSize = 0) public ILOpCodeStore(int index, VarType varType, RegisterSize registerSize = 0)
{ {
Index = index; Index = index;
IoType = ioType; VarType = varType;
RegisterSize = registerSize; RegisterSize = registerSize;
} }
public void Emit(ILMethodBuilder context) public void Emit(ILMethodBuilder context)
{ {
switch (IoType) switch (VarType)
{ {
case VarType.Arg: context.Generator.EmitStarg(Index); break; case VarType.Arg: context.Generator.EmitStarg(Index); break;