Skip to content

Commit

Permalink
Fix cast for Vector64 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Nov 16, 2022
1 parent 79bab50 commit fbf23f1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Kalk.Core/Modules/HardwareIntrinsics/IntrinsicsModuleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,22 @@ protected IntrinsicsModuleBase(string name) : base(name)
var dimension = targetSize / baseElementSize;
if (dimension == 1)
{
// Handle Vector64
if (typeof(System.Runtime.Intrinsics.Vector64<long>) == typeof(T))
{
var tValue = Engine.ToObject<long>(argIndex, value);
return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue));
}
if (typeof(System.Runtime.Intrinsics.Vector64<ulong>) == typeof(T))
{
var tValue = Engine.ToObject<ulong>(argIndex, value);
return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue));
}
if (typeof(System.Runtime.Intrinsics.Vector64<double>) == typeof(T))
{
var tValue = Engine.ToObject<double>(argIndex, value);
return (T)(object)(System.Runtime.Intrinsics.Vector64.Create(tValue));
}
return Engine.ToObject<T>(argIndex, value);
}
else
Expand Down

0 comments on commit fbf23f1

Please sign in to comment.