diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2024-08-08 17:07:24 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-08 17:07:24 -0300 |
| commit | 8d8983049ea23af0600e077b6389e2cd5de74c38 (patch) | |
| tree | 660d4ca7f1a562b738b114fcb1fa136766697598 /src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs | |
| parent | 7969fb6bbaf49a7a84df379d072b94286e4f7ada (diff) | |
Implement UQADD16, UQADD8, UQSUB16, UQSUB8, VQRDMULH, VSLI and VSWP Arm32 instructions (#7174)
Diffstat (limited to 'src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs')
| -rw-r--r-- | src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs b/src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs index dc2646a5..c807fc85 100644 --- a/src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs +++ b/src/ARMeilleure/Instructions/InstEmitSimdArithmetic32.cs @@ -1246,6 +1246,33 @@ namespace ARMeilleure.Instructions EmitVectorUnaryNarrowOp32(context, (op1) => EmitSatQ(context, op1, 8 << op.Size, signedSrc: true, signedDst: false), signed: true); } + public static void Vqrdmulh(ArmEmitterContext context) + { + OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp; + int eSize = 8 << op.Size; + + EmitVectorBinaryOpI32(context, (op1, op2) => + { + if (op.Size == 2) + { + op1 = context.SignExtend32(OperandType.I64, op1); + op2 = context.SignExtend32(OperandType.I64, op2); + } + + Operand res = context.Multiply(op1, op2); + res = context.Add(res, Const(res.Type, 1L << (eSize - 2))); + res = context.ShiftRightSI(res, Const(eSize - 1)); + res = EmitSatQ(context, res, eSize, signedSrc: true, signedDst: true); + + if (op.Size == 2) + { + res = context.ConvertI64ToI32(res); + } + + return res; + }, signed: true); + } + public static void Vqsub(ArmEmitterContext context) { OpCode32SimdReg op = (OpCode32SimdReg)context.CurrOp; |
