aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/Instructions
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-09-10 22:51:00 -0300
committerGitHub <noreply@github.com>2022-09-10 22:51:00 -0300
commitf468db76028086a6645856383fecdf8180b04dd1 (patch)
treecb296f05888eae9fa04d386391525d37e9031192 /ARMeilleure/Instructions
parentc5f1d1749aeb4a1fff8f7552b949f652eaefe52a (diff)
Implement Thumb (32-bit) memory (ordered), multiply, extension and bitfield instructions (#3687)1.1.261
* Implement Thumb (32-bit) memory (ordered), multiply and bitfield instructions * Remove public from interface * Fix T32 BL immediate and implement signed and unsigned extend instructions
Diffstat (limited to 'ARMeilleure/Instructions')
-rw-r--r--ARMeilleure/Instructions/InstEmitAlu32.cs10
-rw-r--r--ARMeilleure/Instructions/InstEmitAluHelper.cs2
-rw-r--r--ARMeilleure/Instructions/InstEmitMemoryEx32.cs6
-rw-r--r--ARMeilleure/Instructions/InstEmitMul32.cs24
4 files changed, 21 insertions, 21 deletions
diff --git a/ARMeilleure/Instructions/InstEmitAlu32.cs b/ARMeilleure/Instructions/InstEmitAlu32.cs
index a612bdf2..31d8a02c 100644
--- a/ARMeilleure/Instructions/InstEmitAlu32.cs
+++ b/ARMeilleure/Instructions/InstEmitAlu32.cs
@@ -74,7 +74,7 @@ namespace ARMeilleure.Instructions
public static void Bfc(ArmEmitterContext context)
{
- OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
+ IOpCode32AluBf op = (IOpCode32AluBf)context.CurrOp;
Operand d = GetIntA32(context, op.Rd);
Operand res = context.BitwiseAnd(d, Const(~op.DestMask));
@@ -84,7 +84,7 @@ namespace ARMeilleure.Instructions
public static void Bfi(ArmEmitterContext context)
{
- OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
+ IOpCode32AluBf op = (IOpCode32AluBf)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand d = GetIntA32(context, op.Rd);
@@ -185,7 +185,7 @@ namespace ARMeilleure.Instructions
public static void Movt(ArmEmitterContext context)
{
- OpCode32AluImm16 op = (OpCode32AluImm16)context.CurrOp;
+ IOpCode32AluImm16 op = (IOpCode32AluImm16)context.CurrOp;
Operand d = GetIntA32(context, op.Rd);
Operand imm = Const(op.Immediate << 16); // Immeditate value as top halfword.
@@ -389,7 +389,7 @@ namespace ARMeilleure.Instructions
public static void Sbfx(ArmEmitterContext context)
{
- OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
+ IOpCode32AluBf op = (IOpCode32AluBf)context.CurrOp;
var msb = op.Lsb + op.Msb; // For this instruction, the msb is actually a width.
@@ -484,7 +484,7 @@ namespace ARMeilleure.Instructions
public static void Ubfx(ArmEmitterContext context)
{
- OpCode32AluBf op = (OpCode32AluBf)context.CurrOp;
+ IOpCode32AluBf op = (IOpCode32AluBf)context.CurrOp;
var msb = op.Lsb + op.Msb; // For this instruction, the msb is actually a width.
diff --git a/ARMeilleure/Instructions/InstEmitAluHelper.cs b/ARMeilleure/Instructions/InstEmitAluHelper.cs
index a487895b..88991f7d 100644
--- a/ARMeilleure/Instructions/InstEmitAluHelper.cs
+++ b/ARMeilleure/Instructions/InstEmitAluHelper.cs
@@ -205,7 +205,7 @@ namespace ARMeilleure.Instructions
return Const(op.Immediate);
}
- case OpCode32AluImm16 op: return Const(op.Immediate);
+ case IOpCode32AluImm16 op: return Const(op.Immediate);
case IOpCode32AluRsImm op: return GetMShiftedByImmediate(context, op, setCarry);
case IOpCode32AluRsReg op: return GetMShiftedByReg(context, op, setCarry);
diff --git a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs
index c2326cde..c0b6fc39 100644
--- a/ARMeilleure/Instructions/InstEmitMemoryEx32.cs
+++ b/ARMeilleure/Instructions/InstEmitMemoryEx32.cs
@@ -172,13 +172,13 @@ namespace ARMeilleure.Instructions
context.BranchIfTrue(lblBigEndian, GetFlag(PState.EFlag));
SetIntA32(context, op.Rt, valueLow);
- SetIntA32(context, op.Rt | 1, valueHigh);
+ SetIntA32(context, op.Rt2, valueHigh);
context.Branch(lblEnd);
context.MarkLabel(lblBigEndian);
- SetIntA32(context, op.Rt | 1, valueLow);
+ SetIntA32(context, op.Rt2, valueLow);
SetIntA32(context, op.Rt, valueHigh);
context.MarkLabel(lblEnd);
@@ -195,7 +195,7 @@ namespace ARMeilleure.Instructions
// Split the result into 2 words (based on endianness)
Operand lo = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt));
- Operand hi = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt | 1));
+ Operand hi = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rt2));
Operand lblBigEndian = Label();
Operand lblEnd = Label();
diff --git a/ARMeilleure/Instructions/InstEmitMul32.cs b/ARMeilleure/Instructions/InstEmitMul32.cs
index 868a1f42..0822f92c 100644
--- a/ARMeilleure/Instructions/InstEmitMul32.cs
+++ b/ARMeilleure/Instructions/InstEmitMul32.cs
@@ -25,7 +25,7 @@ namespace ARMeilleure.Instructions
public static void Mla(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetAluN(context);
Operand m = GetAluM(context);
@@ -43,7 +43,7 @@ namespace ARMeilleure.Instructions
public static void Mls(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetAluN(context);
Operand m = GetAluM(context);
@@ -71,7 +71,7 @@ namespace ARMeilleure.Instructions
private static void EmitSmmul(ArmEmitterContext context, MullFlags flags)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = context.SignExtend32(OperandType.I64, GetIntA32(context, op.Rn));
Operand m = context.SignExtend32(OperandType.I64, GetIntA32(context, op.Rm));
@@ -99,7 +99,7 @@ namespace ARMeilleure.Instructions
public static void Smla__(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);
@@ -142,7 +142,7 @@ namespace ARMeilleure.Instructions
public static void Smlal__(ArmEmitterContext context)
{
- OpCode32AluUmull op = (OpCode32AluUmull)context.CurrOp;
+ IOpCode32AluUmull op = (IOpCode32AluUmull)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);
@@ -180,7 +180,7 @@ namespace ARMeilleure.Instructions
public static void Smlaw_(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);
@@ -210,7 +210,7 @@ namespace ARMeilleure.Instructions
public static void Smul__(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);
@@ -240,7 +240,7 @@ namespace ARMeilleure.Instructions
public static void Smull(ArmEmitterContext context)
{
- OpCode32AluUmull op = (OpCode32AluUmull)context.CurrOp;
+ IOpCode32AluUmull op = (IOpCode32AluUmull)context.CurrOp;
Operand n = context.SignExtend32(OperandType.I64, GetIntA32(context, op.Rn));
Operand m = context.SignExtend32(OperandType.I64, GetIntA32(context, op.Rm));
@@ -261,7 +261,7 @@ namespace ARMeilleure.Instructions
public static void Smulw_(ArmEmitterContext context)
{
- OpCode32AluMla op = (OpCode32AluMla)context.CurrOp;
+ IOpCode32AluMla op = (IOpCode32AluMla)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);
@@ -285,7 +285,7 @@ namespace ARMeilleure.Instructions
public static void Umaal(ArmEmitterContext context)
{
- OpCode32AluUmull op = (OpCode32AluUmull)context.CurrOp;
+ IOpCode32AluUmull op = (IOpCode32AluUmull)context.CurrOp;
Operand n = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rn));
Operand m = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rm));
@@ -310,7 +310,7 @@ namespace ARMeilleure.Instructions
public static void Umull(ArmEmitterContext context)
{
- OpCode32AluUmull op = (OpCode32AluUmull)context.CurrOp;
+ IOpCode32AluUmull op = (IOpCode32AluUmull)context.CurrOp;
Operand n = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rn));
Operand m = context.ZeroExtend32(OperandType.I64, GetIntA32(context, op.Rm));
@@ -331,7 +331,7 @@ namespace ARMeilleure.Instructions
private static void EmitMlal(ArmEmitterContext context, bool signed)
{
- OpCode32AluUmull op = (OpCode32AluUmull)context.CurrOp;
+ IOpCode32AluUmull op = (IOpCode32AluUmull)context.CurrOp;
Operand n = GetIntA32(context, op.Rn);
Operand m = GetIntA32(context, op.Rm);