@@ -11774,6 +11774,17 @@ public static Vector512<T> Invoke(Vector512<T> t)
11774
11774
11775
11775
public static Vector128<T> Invoke(Vector128<T> x)
11776
11776
{
11777
+ #if NET9_0_OR_GREATER
11778
+ if (typeof(T) == typeof(double))
11779
+ {
11780
+ return Vector128.Log2(x.AsDouble()).As<double, T>();
11781
+ }
11782
+ else
11783
+ {
11784
+ Debug.Assert(typeof(T) == typeof(float));
11785
+ return Vector128.Log2(x.AsSingle()).As<float, T>();
11786
+ }
11787
+ #else
11777
11788
if (typeof(T) == typeof(double))
11778
11789
{
11779
11790
return Log2OperatorDouble.Invoke(x.AsDouble()).As<double, T>();
@@ -11783,10 +11794,22 @@ public static Vector128<T> Invoke(Vector128<T> x)
11783
11794
Debug.Assert(typeof(T) == typeof(float));
11784
11795
return Log2OperatorSingle.Invoke(x.AsSingle()).As<float, T>();
11785
11796
}
11797
+ #endif
11786
11798
}
11787
11799
11788
11800
public static Vector256<T> Invoke(Vector256<T> x)
11789
11801
{
11802
+ #if NET9_0_OR_GREATER
11803
+ if (typeof(T) == typeof(double))
11804
+ {
11805
+ return Vector256.Log2(x.AsDouble()).As<double, T>();
11806
+ }
11807
+ else
11808
+ {
11809
+ Debug.Assert(typeof(T) == typeof(float));
11810
+ return Vector256.Log2(x.AsSingle()).As<float, T>();
11811
+ }
11812
+ #else
11790
11813
if (typeof(T) == typeof(double))
11791
11814
{
11792
11815
return Log2OperatorDouble.Invoke(x.AsDouble()).As<double, T>();
@@ -11796,10 +11819,22 @@ public static Vector256<T> Invoke(Vector256<T> x)
11796
11819
Debug.Assert(typeof(T) == typeof(float));
11797
11820
return Log2OperatorSingle.Invoke(x.AsSingle()).As<float, T>();
11798
11821
}
11822
+ #endif
11799
11823
}
11800
11824
11801
11825
public static Vector512<T> Invoke(Vector512<T> x)
11802
11826
{
11827
+ #if NET9_0_OR_GREATER
11828
+ if (typeof(T) == typeof(double))
11829
+ {
11830
+ return Vector512.Log2(x.AsDouble()).As<double, T>();
11831
+ }
11832
+ else
11833
+ {
11834
+ Debug.Assert(typeof(T) == typeof(float));
11835
+ return Vector512.Log2(x.AsSingle()).As<float, T>();
11836
+ }
11837
+ #else
11803
11838
if (typeof(T) == typeof(double))
11804
11839
{
11805
11840
return Log2OperatorDouble.Invoke(x.AsDouble()).As<double, T>();
@@ -11809,9 +11844,11 @@ public static Vector512<T> Invoke(Vector512<T> x)
11809
11844
Debug.Assert(typeof(T) == typeof(float));
11810
11845
return Log2OperatorSingle.Invoke(x.AsSingle()).As<float, T>();
11811
11846
}
11847
+ #endif
11812
11848
}
11813
11849
}
11814
11850
11851
+ #if !NET9_0_OR_GREATER
11815
11852
/// <summary>double.Log2(x)</summary>
11816
11853
internal readonly struct Log2OperatorDouble : IUnaryOperator<double>
11817
11854
{
@@ -12396,6 +12433,7 @@ public static Vector512<float> Invoke(Vector512<float> x)
12396
12433
);
12397
12434
}
12398
12435
}
12436
+ #endif
12399
12437
12400
12438
[MethodImpl(MethodImplOptions.AggressiveInlining)]
12401
12439
private static Vector128<T> ElementWiseSelect<T>(Vector128<T> mask, Vector128<T> left, Vector128<T> right)
0 commit comments