From 282e1005d961bd4225a3936fec284a0afa6e74e8 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Wed, 26 Apr 2023 17:26:26 +0200 Subject: [PATCH] [mono] Add back OP_XOP_OVR_X_X for arm64 And also add missing intrinsic attributes. This addresses feedback from https://github.com/dotnet/runtime/pull/85390 --- .../Runtime/Intrinsics/Wasm/PackedSimd.cs | 83 +++++++++++++++++++ src/mono/mono/mini/mini-llvm.c | 12 +-- 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs index 3cf27182b55e9..479151a8f54f5 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Wasm/PackedSimd.cs @@ -857,251 +857,312 @@ public abstract class PackedSimd /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.or /// + [Intrinsic] public static Vector128 Or(Vector128 left, Vector128 right) => Or(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.xor /// + [Intrinsic] public static Vector128 Xor(Vector128 left, Vector128 right) => Xor(left, right); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.not /// + [Intrinsic] public static Vector128 Not(Vector128 value) => Not(value); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.andnot /// + [Intrinsic] public static Vector128 AndNot(Vector128 left, Vector128 right) => AndNot(left, right); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// v128.bitselect /// + [Intrinsic] public static Vector128 BitwiseSelect(Vector128 left, Vector128 right, Vector128 select) => BitwiseSelect(left, right, select); /// /// i8x16.popcnt /// + [Intrinsic] public static Vector128 PopCount(Vector128 value) => PopCount(value); // Boolean horizontal reductions @@ -1109,91 +1170,113 @@ public abstract class PackedSimd /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// v128.any_true /// + [Intrinsic] public static bool AnyTrue(Vector128 value) => AnyTrue(value); /// /// i8x16.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i8x16.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i16x8.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i16x8.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i32x4.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i32x4.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i64x2.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i64x2.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i32x4.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); /// /// i32x4.all_true /// + [Intrinsic] public static bool AllTrue(Vector128 value) => AllTrue(value); // Bitmask extraction diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c index 7371ca215d1d3..3b9065fe77a79 100644 --- a/src/mono/mono/mini/mini-llvm.c +++ b/src/mono/mono/mini/mini-llvm.c @@ -7781,6 +7781,12 @@ MONO_RESTORE_WARNING values [ins->dreg] = result; break; } + case OP_XOP_OVR_X_X: { + IntrinsicId iid = (IntrinsicId) ins->inst_c0; + llvm_ovr_tag_t ovr_tag = ovr_tag_from_mono_vector_class (ins->klass); + values [ins->dreg] = call_overloaded_intrins (ctx, iid, ovr_tag, &lhs, ""); + break; + } #endif #if defined(TARGET_X86) || defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_WASM) case OP_EXTRACTX_U2: @@ -8704,12 +8710,6 @@ MONO_RESTORE_WARNING values [ins->dreg] = call_intrins (ctx, id, args, ""); break; } - case OP_XOP_OVR_X_X: { - IntrinsicId iid = (IntrinsicId) ins->inst_c0; - llvm_ovr_tag_t ovr_tag = ovr_tag_from_mono_vector_class (ins->klass); - values [ins->dreg] = call_overloaded_intrins (ctx, iid, ovr_tag, &lhs, ""); - break; - } #endif #if defined(TARGET_X86) || defined(TARGET_AMD64)