daily update on 20240226 by nitload youmu

This commit is contained in:
YoumuLiu
2024-02-27 00:43:29 +08:00
parent a2241a5a58
commit 06e39f7a31
543 changed files with 230273 additions and 21423 deletions
+8 -12
View File
@@ -1,12 +1,11 @@
#include "./include/StgSharpC.h"
#include "StgSharpC.h"
#include "ssgc_internal.h"
#include <stdio.h>
SSCAPI __inline void _cdecl transpose3to2(matrix3map* source, matrix2map* target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->m[0][0]), ALIGN(source->m[0][1]), _MM_SHUFFLE(1, 0, 1, 0));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), *defaultVecPtr, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), zeroVec, _MM_SHUFFLE(1, 0, 1, 0));
target->colum[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->colum[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
@@ -16,21 +15,20 @@ SSCAPI __inline void _cdecl transpose3to3(matrix3map* source, matrix3map* target
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->m[0][0]), ALIGN(source->m[0][1]), _MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->m[0][0]), ALIGN(source->m[0][1]), _MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), *defaultVecPtr, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->m[0][2]), *defaultVecPtr, _MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), zeroVec, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->m[0][2]), zeroVec, _MM_SHUFFLE(3, 2, 3, 2));
target->colum[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->colum[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
target->colum[2] = _mm_shuffle_ps(t1, t3, _MM_SHUFFLE(2, 0, 2, 0));
}
SSCAPI __inline void _cdecl transpose3to4(matrix3map* source, matrix4map* target)
{
__m128 t0 = _mm_shuffle_ps(ALIGN(source->m[0][0]), ALIGN(source->m[0][1]), _MM_SHUFFLE(1, 0, 1, 0));
__m128 t1 = _mm_shuffle_ps(ALIGN(source->m[0][0]), ALIGN(source->m[0][1]), _MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), *defaultVecPtr, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->m[0][2]), *defaultVecPtr, _MM_SHUFFLE(3, 2, 3, 2));
__m128 t2 = _mm_shuffle_ps(ALIGN(source->m[0][2]), zeroVec, _MM_SHUFFLE(1, 0, 1, 0));
__m128 t3 = _mm_shuffle_ps(ALIGN(source->m[0][2]), zeroVec, _MM_SHUFFLE(3, 2, 3, 2));
target->colum[0] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(2, 0, 2, 0));
target->colum[1] = _mm_shuffle_ps(t0, t2, _MM_SHUFFLE(3, 1, 3, 1));
@@ -40,7 +38,6 @@ SSCAPI __inline void _cdecl transpose3to4(matrix3map* source, matrix4map* target
SSCAPI _inline float _cdecl det_mat3_internal(__m128 const c0, __m128 const c1, __m128 const c2)
{
//let adding row aligned
__m128 addc1 = _mm_shuffle_ps(c1, c1, _MM_SHUFFLE(3, 0, 2, 1));
__m128 addc2 = _mm_shuffle_ps(c2, c2, _MM_SHUFFLE(3, 1, 0, 2));
@@ -63,7 +60,6 @@ SSCAPI _inline float _cdecl det_mat3_internal(__m128 const c0, __m128 const c1,
__m128 ret = _mm_hadd_ps(cache, cache); //element 1 add element 2
ret = _mm_add_ps(ret, cache); //(e1 add e2) add element 3
return ret.m128_f32[2];
}
@@ -74,4 +70,4 @@ SSCAPI _inline float _cdecl det_mat3(matrix3map* mat)
mat->colum[1],
mat->colum[2]
);
}
}