Daily update on 20230505 by nitload youmu, confuse on OpenGL
This commit is contained in:
@@ -6,7 +6,6 @@ namespace StgSharp.Math
|
||||
{
|
||||
public static partial class Calc
|
||||
{
|
||||
private static m128 sqrtCache;
|
||||
|
||||
public static unsafe float Sqrt(float x)
|
||||
{
|
||||
@@ -21,7 +20,7 @@ namespace StgSharp.Math
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException();
|
||||
throw new ArgumentOutOfRangeException("Input is smaller than zero!");
|
||||
}
|
||||
if (x == 0)
|
||||
{
|
||||
@@ -71,18 +70,6 @@ namespace StgSharp.Math
|
||||
float result = *(float*)&e;
|
||||
result = (result + x / result) / 2;
|
||||
return (result + x / result) / 2;
|
||||
/**/
|
||||
/*
|
||||
fixed (m128* p = &sqrtCache)
|
||||
{
|
||||
sqrtCache.float0 = x;
|
||||
return (SSE.Sqrtss(p)).float0;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
[DllImport("xmmintrin.h",EntryPoint = "_mm_sqrt_ss")]
|
||||
public static extern m128 Sqrtss(m128 a);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user