From fbf23f1cb21033fc2473672b003b4e534cf32760 Mon Sep 17 00:00:00 2001 From: Alexandre Mutel Date: Wed, 16 Nov 2022 09:13:48 +0100 Subject: [PATCH] Fix cast for Vector64 arguments --- .../HardwareIntrinsics/IntrinsicsModuleBase.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Kalk.Core/Modules/HardwareIntrinsics/IntrinsicsModuleBase.cs b/src/Kalk.Core/Modules/HardwareIntrinsics/IntrinsicsModuleBase.cs index 2045de7..b5f10cc 100644 --- a/src/Kalk.Core/Modules/HardwareIntrinsics/IntrinsicsModuleBase.cs +++ b/src/Kalk.Core/Modules/HardwareIntrinsics/IntrinsicsModuleBase.cs @@ -153,6 +153,22 @@ private T ToArg(int argIndex, object value, int align = 0) where T : u var dimension = targetSize / baseElementSize; if (dimension == 1) { + // Handle Vector64 + if (typeof(System.Runtime.Intrinsics.Vector64) == typeof(T)) + { + var tValue = Engine.ToObject(argIndex, value); + return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue)); + } + if (typeof(System.Runtime.Intrinsics.Vector64) == typeof(T)) + { + var tValue = Engine.ToObject(argIndex, value); + return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue)); + } + if (typeof(System.Runtime.Intrinsics.Vector64) == typeof(T)) + { + var tValue = Engine.ToObject(argIndex, value); + return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue)); + } return Engine.ToObject(argIndex, value); } else