You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Will effect all tests as the byte order of components would change.
Could also have properties which fall at the original offsets and give different names to ABCD
/// <summary>/// A single <see cref="System.Numerics.Vector{double}"/> or dual <see cref="System.Numerics.Vector4"/>./// Contains 4 <see cref="Vector4Half"/>/// </summary>[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit,Size=Vector8Float.Size)]publicstructVector8Float{constintSize=sizeof(float)*8;/// <summary>/// 4 Doubles/// </summary>[System.Runtime.InteropServices.FieldOffset(00)]publicSystem.Numerics.Vector<double>Vector;/// <summary>/// 4 Floats/// </summary>[System.Runtime.InteropServices.FieldOffset(00)]publicSystem.Numerics.Vector4High;[System.Runtime.InteropServices.FieldOffset(00)]publicfloatD;[System.Runtime.InteropServices.FieldOffset(04)]publicfloatA;[System.Runtime.InteropServices.FieldOffset(08)]publicfloatB;[System.Runtime.InteropServices.FieldOffset(12)]publicfloatC;/// <summary>/// 4 Floats/// </summary>[System.Runtime.InteropServices.FieldOffset(16)]publicSystem.Numerics.Vector4Low;[System.Runtime.InteropServices.FieldOffset(16)]publicfloatW;[System.Runtime.InteropServices.FieldOffset(20)]publicfloatX;[System.Runtime.InteropServices.FieldOffset(24)]publicfloatY;[System.Runtime.InteropServices.FieldOffset(28)]publicfloatZ;/// <summary>/// 4 Halfs/// </summary>[System.Runtime.InteropServices.FieldOffset(00)]publicVector4HalfP;/// <summary>/// 4 Halfs/// </summary>[System.Runtime.InteropServices.FieldOffset(08)]publicVector4HalfQ;/// <summary>/// 4 Halfs/// </summary>[System.Runtime.InteropServices.FieldOffset(16)]publicVector4HalfR;/// <summary>/// 4 Halfs/// </summary>[System.Runtime.InteropServices.FieldOffset(24)]publicVector4HalfS;/// <summary>/// Gets or Sets the Raw Binary data assoicated with the instance (32 bytes)/// </summary>publicSystem.Span<byte>RawBytes{[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]get{returnSystem.Runtime.InteropServices.MemoryMarshal.CreateSpan(refSystem.Runtime.CompilerServices.Unsafe.As<System.Numerics.Vector<double>,byte>(refVector),Vector8Float.Size);}[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]set{value.CopyTo(RawBytes);}}/// <summary>/// Access elements by offset/// </summary>/// <param name="index"></param>/// <returns></returns>publicfloatthis[intindex]{get{switch(index){case0:returnD;case1:returnA;case2:returnB;case3:returnC;case4:returnW;case5:returnX;case6:returnY;case7:returnZ;default:thrownewSystem.ArgumentOutOfRangeException(nameof(index));}}}publicVector8Float(float[]eight):this(){//Todo profile if the runtime optomizes load asm for this or if RawBytes copy is better//High = new System.Numerics.Vector4(eight[0], eight[1], eight[2], eight[3]);//Low = new System.Numerics.Vector4(eight[4], eight[5], eight[6], eight[7]);//Warning these are shifted [0] = 3, //This means we have to change the variables used in the arc / circle math because///they depend on a predefined order abcdwxyz//this order is dabcwxyzvarc=System.Runtime.InteropServices.MemoryMarshal.CreateSpan(refSystem.Runtime.CompilerServices.Unsafe.As<float,byte>(refeight[0]),eight.Length*sizeof(float));c.CopyTo(RawBytes);}/// <summary>/// </summary>/// <param name="four"></param>publicVector8Float(double[]four):this(){High=Low=default;Vector=newSystem.Numerics.Vector<double>(four);}/// <summary>/// </summary>/// <param name="x"></param>/// <param name="y"></param>/// <param name="z"></param>/// <param name="w"></param>publicVector8Float(doublex,doubley,doublez,doublew):this(newdouble[]{x,y,z,w}){}/// <summary>/// </summary>/// <param name="a"></param>/// <param name="b"></param>/// <param name="c"></param>/// <param name="d"></param>publicVector8Float(floata,floatb,floatc,floatd):this(newfloat[]{a,b,c,d}){}/// <summary>/// </summary>/// <param name="a"></param>/// <param name="b"></param>/// <param name="c"></param>/// <param name="d"></param>/// <param name="x"></param>/// <param name="y"></param>/// <param name="z"></param>/// <param name="w"></param>publicVector8Float(floata,floatb,floatc,floatd,floatx,floaty,floatz,floatw):this(newfloat[]{a,b,c,d,x,y,z,w}){}/// <summary>/// /// </summary>/// <param name="high"></param>/// <param name="low"></param>publicVector8Float(System.Numerics.Vector4high,System.Numerics.Vector4low):this(){Vector=default;High=high;Low=low;}publicoverridestringToString()=>string.Join(" ",High.ToString(),Low.ToString());}
The text was updated successfully, but these errors were encountered:
Will effect all tests as the byte order of components would change.
Could also have properties which fall at the original offsets and give different names to ABCD
The text was updated successfully, but these errors were encountered: