Daily update on 20250312-074647 by Nitload Youmu. Additional Message : Change: Temp not want to compile RULE and PROCEDURE

Add: Add factory method to generate more kind of binary operator node
Add: more SIMD intrinsic C function

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-12 07:46:48 +08:00
parent 16b813646d
commit 9647c2c68a
29 changed files with 645 additions and 244 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ namespace StgSharp.Internal
public unsafe byte[] GetBytes()
{
byte[] ret = new byte[16];
fixed( Vector4* vptr = &data.Vec ) {
fixed( M128* vptr = &data ) {
byte* bptr = ( byte* )vptr;
for( int i = 0; i < 15; i++ ) {
ret[ i ] = *bptr;
+13 -13
View File
@@ -48,11 +48,11 @@ namespace StgSharp.HighPerformance
{
[FieldOffset( 0 )] internal fixed byte Buffer[ 16 ];
[FieldOffset( 0 )] internal Vector4 Vec;
[FieldOffset( 0 )] internal Vector128<byte> Vec;
internal M128( Vector4 v )
{
Vec = v;
Vec = v.AsVector128().AsByte();
}
public ref T AsRef<T>() where T: struct, INumber<T>
@@ -77,7 +77,7 @@ namespace StgSharp.HighPerformance
public T Read<T>( int index ) where T: struct, INumber<T>
{
fixed( Vector4* p = &Vec ) {
fixed( byte* p = Buffer ) {
#pragma warning disable CS8500
return *( ( T* )p + index );
#pragma warning restore CS8500
@@ -123,61 +123,61 @@ namespace StgSharp.HighPerformance
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<byte>( M128 m )
{
return m.Vec.AsVector128().As<float, byte>();
return m.Vec.As<byte, byte>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<double>( M128 m )
{
return m.Vec.AsVector128().As<float, double>();
return m.Vec.As<byte, double>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<float>( M128 m )
{
return m.Vec.AsVector128().As<float, float>();
return m.Vec.As<byte, float>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<int>( M128 m )
{
return m.Vec.AsVector128().As<float, int>();
return m.Vec.As<byte, int>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<long>( M128 m )
{
return m.Vec.AsVector128().As<float, long>();
return m.Vec.As<byte, long>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<sbyte>( M128 m )
{
return m.Vec.AsVector128().As<float, sbyte>();
return m.Vec.As<byte, sbyte>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<short>( M128 m )
{
return m.Vec.AsVector128().As<float, short>();
return m.Vec.As<byte, short>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<uint>( M128 m )
{
return m.Vec.AsVector128().As<float, uint>();
return m.Vec.As<byte, uint>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<ulong>( M128 m )
{
return m.Vec.AsVector128().As<float, ulong>();
return m.Vec.As<byte, ulong>();
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static explicit operator Vector128<ushort>( M128 m )
{
return m.Vec.AsVector128().As<float, ushort>();
return m.Vec.As<byte, ushort>();
}
}
-1
View File
@@ -30,7 +30,6 @@
//-----------------------------------------------------------------------
using StgSharp.Graphics;
using StgSharp.Graphics.OpenGL;
using StgSharp.Internal.OpenGL;
using System;
using System.Collections.Generic;
@@ -58,6 +58,9 @@ namespace StgSharp.Internal.Intrinsic
public delegate* unmanaged[Cdecl]<ColumnSet4*, Vector4*, Vector4*, void> dot_43;
public delegate* unmanaged[Cdecl]<char*, int, int, int> index_pair;
public delegate* unmanaged[Cdecl]<Vector4*, Vector4*, void> normalize_v3;
public delegate* unmanaged[Cdecl]<ColumnSet2*, ColumnSet2*, ColumnSet2*, void> sub_mat_2;
public delegate* unmanaged[Cdecl]<ColumnSet3*, ColumnSet3*, ColumnSet3*, void> sub_mat_3;
public delegate* unmanaged[Cdecl]<ColumnSet4*, ColumnSet4*, ColumnSet4*, void> sub_mat_4;
public delegate* unmanaged[Cdecl]<ColumnSet2*, ColumnSet3*, void> transpose23;
public delegate* unmanaged[Cdecl]<ColumnSet2*, ColumnSet4*, void> transpose24;
public delegate* unmanaged[Cdecl]<ColumnSet3*, ColumnSet2*, void> transpose32;
+31 -24
View File
@@ -37,11 +37,12 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( 2 * 2 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( 2 * 2 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix22 : IMat
{
[FieldOffset( 2 * 2 * 4 * sizeof( float ) )]
internal bool isTransposed = false;
@@ -50,12 +51,6 @@ namespace StgSharp.Math
[FieldOffset( 2 * 4 * sizeof( float ) )]
internal ColumnSet2 _transpose;
public Matrix22()
{
Unsafe.SkipInit( out this );
isTransposed = false;
}
internal Matrix22( ColumnSet2 mat )
{
this._mat = mat;
@@ -63,15 +58,21 @@ namespace StgSharp.Math
internal Matrix22( Vector4 c0, Vector4 c1 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
_mat.colum0 = c0;
_mat.colum1 = c1;
}
public Matrix22()
{
Unsafe.SkipInit( out this );
isTransposed = false;
}
public Matrix22( float a00, float a01, float a10, float a11 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
_mat.colum0 = new Vector4( a00, a10, 0, 0 );
_mat.colum1 = new Vector4( a01, a11, 0, 0 );
@@ -105,22 +106,17 @@ namespace StgSharp.Math
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe Matrix22 operator +(Matrix22 left, Matrix22 right)
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix22 operator -(
Matrix22 left,
Matrix22 right )
{
Matrix22 ret = new Matrix22();
InternalIO.Intrinsic.add_mat_2( &left._mat, &right._mat, &ret._mat );
InternalIO.Intrinsic.sub_mat_2( &left._mat, &right._mat,
&ret._mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix22 operator -( Matrix22 left, Matrix22 right )
{
return new Matrix22(
left._mat.colum0 + right._mat.colum0,
left._mat.colum1 + right._mat.colum1 );
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix22 operator *( Matrix22 mat, float value )
{
@@ -137,7 +133,7 @@ namespace StgSharp.Math
Vector4.Dot( left._transpose.colum0, right._mat.colum1 ),
Vector4.Dot( left._transpose.colum1, right._mat.colum0 ),
Vector4.Dot( left._transpose.colum1, right._mat.colum1 ));
Vector4.Dot( left._transpose.colum1, right._mat.colum1 ) );
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -167,7 +163,7 @@ namespace StgSharp.Math
Vector4.Dot( left._transpose.colum1, right.mat.colum0 ),
Vector4.Dot( left._transpose.colum1, right.mat.colum1 ),
Vector4.Dot( left._transpose.colum1, right.mat.colum2 ),
Vector4.Dot( left._transpose.colum1, right.mat.colum3 ));
Vector4.Dot( left._transpose.colum1, right.mat.colum3 ) );
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -177,5 +173,16 @@ namespace StgSharp.Math
mat._mat.colum0 / value, mat._mat.colum1 / value );
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix22 operator +(
Matrix22 left,
Matrix22 right )
{
Matrix22 ret = new Matrix22();
InternalIO.Intrinsic.add_mat_2( &left._mat, &right._mat,
&ret._mat );
return ret;
}
}
}
+27 -22
View File
@@ -38,9 +38,9 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( ( 3 + 2 ) * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( ( 3 + 2 ) * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix23 : IMat
{
@@ -48,12 +48,6 @@ namespace StgSharp.Math
[FieldOffset( 3 * 4 * sizeof( float ) )] internal ColumnSet2 _transpose;
[FieldOffset( 0 )] internal ColumnSet3 _mat;
public Matrix23()
{
Unsafe.SkipInit( out _mat);
Unsafe.SkipInit(out _transpose);
}
internal Matrix23( Vector4 c0, Vector4 c1, Vector4 c2 )
{
_mat.colum0 = c0;
@@ -61,13 +55,19 @@ namespace StgSharp.Math
_mat.colum2 = c2;
}
public Matrix23()
{
Unsafe.SkipInit( out _mat );
Unsafe.SkipInit( out _transpose );
}
public Matrix23(
float a00,
float a01,
float a02,
float a10,
float a11,
float a12 )
float a00,
float a01,
float a02,
float a10,
float a11,
float a12 )
{
_mat.colum0 = new Vector4( a00, a10, 0, 0 );
_mat.colum1 = new Vector4( a01, a11, 0, 0 );
@@ -122,12 +122,14 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix23 operator -( Matrix23 left, Matrix23 right )
public static unsafe Matrix23 operator -(
Matrix23 left,
Matrix23 right )
{
return new Matrix23(
left._mat.colum0 - right._mat.colum0,
left._mat.colum1 - right._mat.colum1,
left._mat.colum2 - right._mat.colum2 );
Matrix23 ret = new Matrix23();
InternalIO.Intrinsic.sub_mat_3( &left._mat, &right._mat,
&ret._mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -189,10 +191,13 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix23 operator +( Matrix23 left, Matrix23 right )
public static unsafe Matrix23 operator +(
Matrix23 left,
Matrix23 right )
{
Matrix23 ret = new Matrix23();
InternalIO.Intrinsic.add_mat_3(&left._mat, &right._mat, &ret._mat);
InternalIO.Intrinsic.add_mat_3( &left._mat, &right._mat,
&ret._mat );
return ret;
}
+31 -28
View File
@@ -38,11 +38,12 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( ( 4 + 2 ) * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( ( 4 + 2 ) * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix24 : IMat
{
[FieldOffset( 6 * 4 * sizeof( float ) )] internal bool isTransposed;
[FieldOffset( 4 * 4 * sizeof( float ) )] internal ColumnSet2 transpose;
@@ -53,15 +54,9 @@ namespace StgSharp.Math
[FieldOffset( 32 )] public Vec2 Colum2;
[FieldOffset( 48 )] public Vec2 Colum3;
public Matrix24()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix24( Vector4 c0, Vector4 c1, Vector4 c2, Vector4 c3 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
@@ -69,17 +64,23 @@ namespace StgSharp.Math
mat.colum3 = c3;
}
public Matrix24(
float a00,
float a01,
float a02,
float a03,
float a10,
float a11,
float a12,
float a13 )
public Matrix24()
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
}
public Matrix24(
float a00,
float a01,
float a02,
float a03,
float a10,
float a11,
float a12,
float a13 )
{
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, 0, 0 );
mat.colum1 = new Vector4( a01, a11, 0, 0 );
@@ -141,13 +142,13 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix24 operator -( Matrix24 left, Matrix24 right )
public static unsafe Matrix24 operator -(
Matrix24 left,
Matrix24 right )
{
return new Matrix24(
left.mat.colum0 - right.mat.colum0,
left.mat.colum1 - right.mat.colum1,
left.mat.colum2 - right.mat.colum2,
left.mat.colum3 - right.mat.colum3 );
Matrix24 ret = new Matrix24();
InternalIO.Intrinsic.sub_mat_4( &left.mat, &right.mat, &ret.mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -209,10 +210,12 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix24 operator +( Matrix24 left, Matrix24 right )
public static unsafe Matrix24 operator +(
Matrix24 left,
Matrix24 right )
{
Matrix24 ret = new Matrix24();
InternalIO.Intrinsic.add_mat_4(&left.mat,&right.mat,&ret.mat);
InternalIO.Intrinsic.add_mat_4( &left.mat, &right.mat, &ret.mat );
return ret;
}
+22 -20
View File
@@ -38,9 +38,9 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( 5 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( 5 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix32 : IMat
{
@@ -52,29 +52,29 @@ namespace StgSharp.Math
[FieldOffset( 0 )] internal Vec3 colum0;
[FieldOffset( 4 * 4 )] internal Vec3 colum1;
public Matrix32()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix32( Vector4 c0, Vector4 c1 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
}
public unsafe Matrix32(
float a00,
float a01,
float a10,
float a11,
float a20,
float a21 )
public Matrix32()
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
}
public unsafe Matrix32(
float a00,
float a01,
float a10,
float a11,
float a20,
float a21 )
{
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, a20, 0 );
mat.colum1 = new Vector4( a01, a11, a21, 0 );
@@ -209,10 +209,12 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix32 operator +( Matrix32 left, Matrix32 right )
public static unsafe Matrix32 operator +(
Matrix32 left,
Matrix32 right )
{
Matrix32 ret = new Matrix32();
InternalIO.Intrinsic.add_mat_2(&left.mat, &right.mat, &ret.mat);
InternalIO.Intrinsic.add_mat_2( &left.mat, &right.mat, &ret.mat );
return ret;
}
+31 -28
View File
@@ -38,9 +38,9 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( 6 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( 6 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix33 : IMat
{
@@ -52,33 +52,33 @@ namespace StgSharp.Math
[FieldOffset( 1 * 4 * sizeof( float ) )] public Vec3 Colum1;
[FieldOffset( 2 * 4 * sizeof( float ) )] public Vec3 Colum2;
public Matrix33()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix33( Vector4 c0, Vector4 c1, Vector4 c2 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
mat.colum2 = c2;
}
public Matrix33(
float a00,
float a01,
float a02,
float a10,
float a11,
float a12,
float a20,
float a21,
float a22 )
public Matrix33()
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
}
public Matrix33(
float a00,
float a01,
float a02,
float a10,
float a11,
float a12,
float a20,
float a21,
float a22 )
{
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, a20, 0 );
mat.colum1 = new Vector4( a01, a11, a21, 0 );
@@ -140,12 +140,13 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix33 operator -( Matrix33 left, Matrix33 right )
public static unsafe Matrix33 operator -(
Matrix33 left,
Matrix33 right )
{
return new Matrix33(
left.mat.colum0 - right.mat.colum0,
left.mat.colum1 - right.mat.colum1,
left.mat.colum2 + right.mat.colum2 );
Matrix33 ret = new Matrix33();
InternalIO.Intrinsic.sub_mat_3( &left.mat, &right.mat, &ret.mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -229,10 +230,12 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix33 operator +( Matrix33 left, Matrix33 right )
public static unsafe Matrix33 operator +(
Matrix33 left,
Matrix33 right )
{
Matrix33 ret = new Matrix33();
InternalIO.Intrinsic.add_mat_3(&left.mat, &right.mat, &ret.mat);
InternalIO.Intrinsic.add_mat_3( &left.mat, &right.mat, &ret.mat );
return ret;
}
+34 -33
View File
@@ -39,9 +39,9 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( 7 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( 7 * 4 * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix34 : IMat
{
@@ -55,12 +55,6 @@ namespace StgSharp.Math
[FieldOffset( 2 * 4 * sizeof( float ) )] public Vec3 Colum2;
[FieldOffset( 3 * 4 * sizeof( float ) )] public Vec3 Colum3;
public Matrix34()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix34( ColumnSet4 mat )
{
Unsafe.SkipInit( out this );
@@ -70,7 +64,7 @@ namespace StgSharp.Math
internal Matrix34( Vector4 c0, Vector4 c1, Vector4 c2, Vector4 c3 )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
@@ -78,21 +72,27 @@ namespace StgSharp.Math
mat.colum3 = c3;
}
public Matrix34(
float a00,
float a01,
float a02,
float a03,
float a10,
float a11,
float a12,
float a13,
float a20,
float a21,
float a22,
float a23 )
public Matrix34()
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
}
public Matrix34(
float a00,
float a01,
float a02,
float a03,
float a10,
float a11,
float a12,
float a13,
float a20,
float a21,
float a22,
float a23 )
{
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, a20, 0 );
mat.colum0 = new Vector4( a01, a11, a21, 0 );
@@ -147,13 +147,13 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix34 operator -( Matrix34 left, Matrix34 right )
public static unsafe Matrix34 operator -(
Matrix34 left,
Matrix34 right )
{
return new Matrix34(
left.mat.colum0 - right.mat.colum0,
left.mat.colum1 - right.mat.colum1,
left.mat.colum2 - right.mat.colum2,
left.mat.colum3 - right.mat.colum3 );
Matrix34 ret = new Matrix34();
InternalIO.Intrinsic.sub_mat_4( &left.mat, &right.mat, &ret.mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -227,12 +227,13 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix34 operator +( Matrix34 left, Matrix34 right )
public static unsafe Matrix34 operator +(
Matrix34 left,
Matrix34 right )
{
Matrix34 ret = new Matrix34();
InternalIO.Intrinsic.add_mat_4(&left.mat,&right.mat,&ret.mat);
InternalIO.Intrinsic.add_mat_4( &left.mat, &right.mat, &ret.mat );
return ret;
}
}
+32 -32
View File
@@ -38,9 +38,9 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(
LayoutKind.Explicit,
Size = ( ( 16 + 8 ) * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
LayoutKind.Explicit,
Size = ( ( 16 + 8 ) * sizeof( float ) ) + sizeof( bool ),
Pack = 16 )]
public struct Matrix42 : IMat
{
@@ -49,38 +49,38 @@ namespace StgSharp.Math
[FieldOffset( 0 )] internal ColumnSet2 mat;
[FieldOffset( 8 * sizeof( float ) )] internal ColumnSet4 transpose;
public Matrix42()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix42( ColumnSet2 mat )
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
this.mat = mat;
}
internal Matrix42( Vector4 c0, Vector4 c1 )
{
Unsafe.SkipInit(out this);
isTransposed= false;
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
}
public Matrix42(
float a00,
float a01,
float a10,
float a11,
float a20,
float a21,
float a30,
float a31 )
public Matrix42()
{
Unsafe.SkipInit(out this);
Unsafe.SkipInit( out this );
isTransposed = false;
}
public Matrix42(
float a00,
float a01,
float a10,
float a11,
float a20,
float a21,
float a30,
float a31 )
{
Unsafe.SkipInit( out this );
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, a20, a30 );
mat.colum1 = new Vector4( a01, a11, a21, a31 );
@@ -141,12 +141,12 @@ namespace StgSharp.Math
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix42 operator -(
Matrix42 left,
Matrix42 right )
Matrix42 left,
Matrix42 right )
{
return new Matrix42(
left.mat.colum0 - right.mat.colum0,
left.mat.colum0 - right.mat.colum0 );
Matrix42 ret = new Matrix42();
InternalIO.Intrinsic.sub_mat_2( &left.mat, &right.mat, &ret.mat );
return ret;
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
@@ -231,12 +231,12 @@ namespace StgSharp.Math
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static unsafe Matrix42 operator +(
Matrix42 left,
Matrix42 right )
Matrix42 left,
Matrix42 right )
{
return new Matrix42(
left.mat.colum0 + right.mat.colum0,
left.mat.colum0 + right.mat.colum0 );
Matrix42 ret = new Matrix42();
InternalIO.Intrinsic.add_mat_2( &left.mat, &right.mat, &ret.mat );
return ret;
}
}