From 46dc89f8dd7fc6fa75d3255a49e89a4615e1e504 Mon Sep 17 00:00:00 2001
From: Lordmau5 <mail@lordmau5.com>
Date: Tue, 12 Jun 2018 14:29:16 +0200
Subject: [PATCH] Implement Fabs_V (#146)

---
 ChocolArm64/AOpCodeTable.cs                        | 1 +
 ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/ChocolArm64/AOpCodeTable.cs b/ChocolArm64/AOpCodeTable.cs
index 3500fba0b5..5bddc3b990 100644
--- a/ChocolArm64/AOpCodeTable.cs
+++ b/ChocolArm64/AOpCodeTable.cs
@@ -206,6 +206,7 @@ namespace ChocolArm64
             SetA64("0>101110000xxxxx0<xxx0xxxxxxxxxx", AInstEmit.Ext_V,         typeof(AOpCodeSimdExt));
             SetA64("011111101x1xxxxx110101xxxxxxxxxx", AInstEmit.Fabd_S,        typeof(AOpCodeSimdReg));
             SetA64("000111100x100000110000xxxxxxxxxx", AInstEmit.Fabs_S,        typeof(AOpCodeSimd));
+            SetA64("0>0011101<100000111110xxxxxxxxxx", AInstEmit.Fabs_V,        typeof(AOpCodeSimd));
             SetA64("000111100x1xxxxx001010xxxxxxxxxx", AInstEmit.Fadd_S,        typeof(AOpCodeSimdReg));
             SetA64("0>0011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Fadd_V,        typeof(AOpCodeSimdReg));
             SetA64("0>1011100<1xxxxx110101xxxxxxxxxx", AInstEmit.Faddp_V,       typeof(AOpCodeSimdReg));
diff --git a/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs b/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs
index 0dfe0bd318..5aea6b0455 100644
--- a/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs
+++ b/ChocolArm64/Instruction/AInstEmitSimdArithmetic.cs
@@ -309,6 +309,14 @@ namespace ChocolArm64.Instruction
             });
         }
 
+        public static void Fabs_V(AILEmitterCtx Context)
+        {
+            EmitVectorUnaryOpF(Context, () =>
+            {
+                EmitUnaryMathCall(Context, nameof(Math.Abs));
+            });
+        }
+
         public static void Fadd_S(AILEmitterCtx Context)
         {
             if (AOptimizations.UseSse2)