Add FMADD and FMSUB instructions
This commit is contained in:
parent
768b573772
commit
79f028e410
3 changed files with 37 additions and 2 deletions
|
@ -258,6 +258,20 @@ namespace ChocolArm64.Instruction
|
|||
|
||||
public static void Fdiv_S(AILEmitterCtx Context) => EmitScalarOp(Context, OpCodes.Div);
|
||||
|
||||
public static void Fmadd_S(AILEmitterCtx Context)
|
||||
{
|
||||
AOpCodeSimdReg Op = (AOpCodeSimdReg)Context.CurrOp;
|
||||
|
||||
Context.EmitLdvecsf(Op.Ra);
|
||||
Context.EmitLdvecsf(Op.Rn);
|
||||
Context.EmitLdvecsf(Op.Rm);
|
||||
|
||||
Context.Emit(OpCodes.Mul);
|
||||
Context.Emit(OpCodes.Add);
|
||||
|
||||
Context.EmitStvecsf(Op.Rd);
|
||||
}
|
||||
|
||||
public static void Fmax_S(AILEmitterCtx Context) => EmitMathOp3(Context, nameof(Math.Max));
|
||||
public static void Fmin_S(AILEmitterCtx Context) => EmitMathOp3(Context, nameof(Math.Min));
|
||||
|
||||
|
@ -327,6 +341,23 @@ namespace ChocolArm64.Instruction
|
|||
Context.EmitStvec(Op.Rd);
|
||||
}
|
||||
|
||||
public static void Fmsub_S(AILEmitterCtx Context)
|
||||
{
|
||||
AOpCodeSimdReg Op = (AOpCodeSimdReg)Context.CurrOp;
|
||||
|
||||
Context.EmitLdvecsf(Op.Ra);
|
||||
Context.EmitLdvecsf(Op.Rn);
|
||||
|
||||
Context.Emit(OpCodes.Neg);
|
||||
|
||||
Context.EmitLdvecsf(Op.Rm);
|
||||
|
||||
Context.Emit(OpCodes.Mul);
|
||||
Context.Emit(OpCodes.Sub);
|
||||
|
||||
Context.EmitStvecsf(Op.Rd);
|
||||
}
|
||||
|
||||
public static void Fmul_S(AILEmitterCtx Context) => EmitScalarOp(Context, OpCodes.Mul);
|
||||
|
||||
public static void Fneg_S(AILEmitterCtx Context) => EmitScalarOp(Context, OpCodes.Neg);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue