keep working on PLN facotrize
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="StringHashMultiplexer"
|
||||
// Project: StgSharp
|
||||
@@ -71,7 +71,7 @@ namespace StgSharp.Collections
|
||||
{
|
||||
int hash;
|
||||
fixed (char* cPtr = obj.AsSpan()) {
|
||||
hash = NativeIntrinsic.Intrinsic.city_hash_simplify(cPtr, obj.Length);
|
||||
hash = NativeIntrinsic.Context.city_hash_simplify(cPtr, obj.Length);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace StgSharp.Collections
|
||||
{
|
||||
int hash;
|
||||
fixed (char* cPtr = obj.AsSpan()) {
|
||||
hash = NativeIntrinsic.Intrinsic.city_hash_simplify(cPtr, obj.Length);
|
||||
hash = NativeIntrinsic.Context.city_hash_simplify(cPtr, obj.Length);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace StgSharp.HighPerformance
|
||||
{
|
||||
ReadOnlySpan<char> nameSpan = Name.AsSpan();
|
||||
fixed (char* cptr = nameSpan) {
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(cptr, Name.Length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(cptr, Name.Length);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="UnsafeCompute"
|
||||
// Project: StgSharp
|
||||
@@ -35,19 +35,19 @@ namespace StgSharp.HighPerformance
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int CityHashSimplify(char* span, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(span, length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(span, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int CityHashSimplify(char* span, int begin, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.city_hash_simplify(span + begin, length);
|
||||
return NativeIntrinsic.Context.city_hash_simplify(span + begin, length);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe int IndexOfCharPair(char* source, int pairValue, int length)
|
||||
{
|
||||
return NativeIntrinsic.Intrinsic.index_pair(source, pairValue, length);
|
||||
return NativeIntrinsic.Context.index_pair(source, pairValue, length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace StgSharp.Internal.Intrinsic
|
||||
public delegate* unmanaged[Cdecl]<MatrixPanel*, void> f32_clear_panel;
|
||||
public delegate* unmanaged[Cdecl]<Vector4*, Vector4*, void> f32_normalize_3; //f32_normalize_3
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, void*, void> f32_panel_fma; //f32_panel_fma
|
||||
public delegate* unmanaged[Cdecl]<void*, ulong, ulong, ulong, void> f32_pivot; //f32_panel_mul
|
||||
public delegate* unmanaged[Cdecl]<void*, void*, int, int, int, int, void> f32_store_panel; //f32_store_panel
|
||||
public delegate* unmanaged[Cdecl]<int, ulong> factorial_simd; //factorial_simd
|
||||
public delegate* unmanaged[Cdecl]<char*, int, int, int> index_pair; //index_pair
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace StgSharp.Internal
|
||||
|
||||
public static IntrinsicLevel IntrinsicLevel { get; set; }
|
||||
|
||||
internal static IntrinsicContext Intrinsic
|
||||
internal static IntrinsicContext Context
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => _intrinsicContext;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Matrix44"
|
||||
// Project: StgSharp
|
||||
@@ -169,7 +169,7 @@ namespace StgSharp.Mathematics.Graphic
|
||||
internal unsafe void InternalTranspose(ref Matrix44 transpose)
|
||||
{
|
||||
fixed (MatrixKernel<float>* source = &this.kernel, target = &transpose.kernel) {
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_transpose(source, target);
|
||||
NativeIntrinsic.Context.f32_buffer_transpose(source, target);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ namespace StgSharp.Mathematics.Graphic
|
||||
public static unsafe Matrix44 operator -(Matrix44 left, Matrix44 right)
|
||||
{
|
||||
Matrix44 ret = new();
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_sub(&left, &right, &ret, 1);
|
||||
NativeIntrinsic.Context.f32_buffer_sub(&left, &right, &ret, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace StgSharp.Mathematics.Graphic
|
||||
public static unsafe Matrix44 operator +(Matrix44 left, Matrix44 right)
|
||||
{
|
||||
Matrix44 ret = new();
|
||||
NativeIntrinsic.Intrinsic.f32_buffer_add(&left, &right, &ret, 1);
|
||||
NativeIntrinsic.Context.f32_buffer_add(&left, &right, &ret, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// file="Factorial"
|
||||
// Project: StgSharp
|
||||
@@ -55,7 +55,7 @@ namespace StgSharp.Mathematics
|
||||
return factorialResult[n];
|
||||
}
|
||||
if (n < 30) {
|
||||
return NativeIntrinsic.Intrinsic.factorial_simd(n);
|
||||
return NativeIntrinsic.Context.factorial_simd(n);
|
||||
}
|
||||
double
|
||||
dn = n,
|
||||
|
||||
Reference in New Issue
Block a user