From 5784d064e7da1aadb40afccb998afa49ddc8e9e7 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Thu, 10 Oct 2019 20:44:47 -0700 Subject: [PATCH] Refactoring the ARM intrinsics to match API review and share code with x86 (#25508) * Rewriting the ARM64 HWIntrinsic JIT infrastructure to share with and mirror the x86 infrastructure where possible. * Lowercasing the hwintrinsicarm64 and hwintrinsiclistarm64 files. * Applying formatting patch. * Fixing up some names in the PAL and VM that were missed. * Adding support for AdvSimd.Add * Ensure impSpecialIntrinsic returns nullptr for unsupported base types. * Rewording various method headers and simplifying some code. * Fixing getEmitter to GetEmitter * Adding support for the ld1 instruction * Applying formatting patch * Clarifying a todo comment and removing a stray newline * Fixing the Arm64 impSpecialIntrinsic to not assert for helper intrinsics * Fixing some intrinsic signatures that were incorrect * Adding the initial template files for generating Arm HWIntrinsic tests * Generating the initial batch of Arm HWIntrinsic tests * Replace gtRegNum with GetRegNum() * Fixing the test template alignment checks for Arm * Regenerating the Arm HWIntrinsic tests * Fixing the namespace checked for Arm intrinsics * Changing Base to ArmBase and fixing some Arm hwintrinsic metadata * Fixing the arm emitter and lowering to not assert for hwintrinsics * Fixing the arm intrinsics to not set the number of vector elements for SIMDScalar intrinsics * Updating the AdvSimd.Abs tests to use negative input values * Regenerating the arm hwintrinsic tests * Fixing the arm hwintrinsic codegen to use the element size for simd scalar operations. * Fixing the arm scalar intrinsic tests to check for 0 on upper bits * Regenerating the ARM intrinsic tests * Fixing AdvSimd.AbsScalar and AdvSimd.AddScalar to be recursive * Marking AdvSimd.Arm64 and ArmBase.Arm64 as implemented * Ensure that AdvSimd.Arm64.Abs is marked as variable size Signed-off-by: dotnet-bot --- .../System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs | 2 +- .../shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index 1feea539ef0..0268c8bbd7a 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -44,7 +44,7 @@ namespace System.Runtime.Intrinsics.Arm /// float64x2_t vaddq_f64 (float64x2_t a, float64x2_t b) /// A64: FADD Vd.2D, Vn.2D, Vm.2D /// - public static Vector128 Add(Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } + public static Vector128 Add(Vector128 left, Vector128 right) { throw new PlatformNotSupportedException(); } } /// diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs index a2b946692a7..6e2a3325dfc 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -46,7 +46,7 @@ namespace System.Runtime.Intrinsics.Arm /// float64x2_t vaddq_f64 (float64x2_t a, float64x2_t b) /// A64: FADD Vd.2D, Vn.2D, Vm.2D /// - public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right); + public static Vector128 Add(Vector128 left, Vector128 right) => Add(left, right); } /// @@ -116,7 +116,7 @@ namespace System.Runtime.Intrinsics.Arm /// A32: VABS.F32 Sd, Sm /// A64: FABS Sd, Sn /// - public static Vector64 AbsScalar(Vector64 value) => Abs(value); + public static Vector64 AbsScalar(Vector64 value) => AbsScalar(value); /// /// uint8x8_t vadd_u8 (uint8x8_t a, uint8x8_t b) @@ -255,7 +255,7 @@ namespace System.Runtime.Intrinsics.Arm /// A32: VADD.F32 Sd, Sn, Sm /// A64: /// - public static Vector64 AddScalar(Vector64 left, Vector64 right) => Add(left, right); + public static Vector64 AddScalar(Vector64 left, Vector64 right) => AddScalar(left, right); /// /// uint8x8_t vld1_u8 (uint8_t const * ptr) -- 2.11.4.GIT