daily update on 20240828 by nitload youmu, autotexture added

This commit is contained in:
Nitload
2024-08-28 10:58:31 +08:00
parent d082071f2d
commit 1ee4e4a42f
586 changed files with 60910 additions and 123106 deletions
+16 -57
View File
@@ -6,102 +6,61 @@ INCLUDELIB OLDNAMES
PUBLIC normalize
; Function compile flags: /Ogtpy
; File D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\vector.c
; COMDAT normalize
_TEXT SEGMENT
source$ = 8
target$ = 16
normalize PROC ; COMDAT
; 6 : // 计算source的长度的平方
; 7 : __m128 a_length_sq = _mm_mul_ps(*source, *source); // 向量点乘自身
; File D:\NitloadIndustry\Ñо¿ÏîÄ¿\1-Flagship\TH2020\ProjectFile\Ô´´úÂë\StgSharpC\vector.c
; Line 7
00000 0f 10 11 movups xmm2, XMMWORD PTR [rcx]
00003 0f 28 ca movaps xmm1, xmm2
00006 0f 59 ca mulps xmm1, xmm2
; 8 : a_length_sq = _mm_add_ps(a_length_sq, _mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
; Line 8
00009 0f 28 c1 movaps xmm0, xmm1
0000c 0f c6 c1 b1 shufps xmm0, xmm1, 177 ; 000000b1H
00010 0f 58 c8 addps xmm1, xmm0
; 9 : a_length_sq = _mm_add_ss(a_length_sq, _mm_shuffle_ps(a_length_sq, a_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
; Line 9
00013 0f 28 c1 movaps xmm0, xmm1
00016 0f c6 c1 0e shufps xmm0, xmm1, 14
0001a f3 0f 58 c8 addss xmm1, xmm0
; 10 :
; 11 : // 归一化向量source
; 12 : __m128 a_inv_length = _mm_rsqrt_ps(a_length_sq); // 计算source长度的倒数平方根
; Line 12
0001e 0f 52 d9 rsqrtps xmm3, xmm1
; 13 : *source = _mm_mul_ps(*source, a_inv_length); // 用source乘以其长度的倒数平方根得到单位向量
; Line 13
00021 0f 59 da mulps xmm3, xmm2
00024 0f 11 19 movups XMMWORD PTR [rcx], xmm3
; 14 :
; 15 : // 计算target与source的点积
; 16 : __m128 dot_product = _mm_mul_ps(*target, *source);
; Line 16
00027 0f 28 cb movaps xmm1, xmm3
0002a 0f 10 12 movups xmm2, XMMWORD PTR [rdx]
0002d 0f 59 ca mulps xmm1, xmm2
; 17 : dot_product = _mm_add_ps(dot_product, _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(2, 3, 0, 1)));
; Line 17
00030 0f 28 c1 movaps xmm0, xmm1
00033 0f c6 c1 b1 shufps xmm0, xmm1, 177 ; 000000b1H
00037 0f 58 c8 addps xmm1, xmm0
; 18 : dot_product = _mm_add_ss(dot_product, _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(0, 0, 3, 2)));
; Line 18
0003a 0f 28 c1 movaps xmm0, xmm1
0003d 0f c6 c1 0e shufps xmm0, xmm1, 14
00041 f3 0f 58 c8 addss xmm1, xmm0
; 19 :
; 20 : // 从target中减去source的方向分量,使其垂直于source
; 21 : __m128 b_orthogonal = _mm_sub_ps(*target, _mm_mul_ps(*source, dot_product));
; Line 21
00045 0f 59 cb mulps xmm1, xmm3
00048 0f 5c d1 subps xmm2, xmm1
; 22 :
; 23 : // 归一化向量b_orthogonal
; 24 : __m128 b_length_sq = _mm_mul_ps(b_orthogonal, b_orthogonal);
; Line 24
0004b 0f 28 ca movaps xmm1, xmm2
0004e 0f 59 ca mulps xmm1, xmm2
; 25 : b_length_sq = _mm_add_ps(b_length_sq, _mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(2, 3, 0, 1)));
; Line 25
00051 0f 28 c1 movaps xmm0, xmm1
00054 0f c6 c1 b1 shufps xmm0, xmm1, 177 ; 000000b1H
00058 0f 58 c8 addps xmm1, xmm0
; 26 : b_length_sq = _mm_add_ss(b_length_sq, _mm_shuffle_ps(b_length_sq, b_length_sq, _MM_SHUFFLE(0, 0, 3, 2)));
; Line 26
0005b 0f 28 c1 movaps xmm0, xmm1
0005e 0f c6 c1 0e shufps xmm0, xmm1, 14
00062 f3 0f 58 c8 addss xmm1, xmm0
; 27 :
; 28 : __m128 b_inv_length = _mm_rsqrt_ps(b_length_sq);
; Line 28
00066 0f 52 c9 rsqrtps xmm1, xmm1
; 29 : *target = _mm_mul_ps(b_orthogonal, b_inv_length);
; Line 29
00069 0f 59 ca mulps xmm1, xmm2
0006c 0f 11 0a movups XMMWORD PTR [rdx], xmm1
; 30 :
; 31 : }
; Line 31
0006f c3 ret 0
normalize ENDP
_TEXT ENDS