daily uodate on 20240411 by nitload youmu, camera complete
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.39.33523.0
|
||||
|
||||
include listing.inc
|
||||
|
||||
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); // 向量点乘自身
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
||||
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长度的倒数平方根
|
||||
|
||||
0001e 0f 52 d9 rsqrtps xmm3, xmm1
|
||||
|
||||
; 13 : *source = _mm_mul_ps(*source, a_inv_length); // 用source乘以其长度的倒数平方根得到单位向量
|
||||
|
||||
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);
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
||||
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));
|
||||
|
||||
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);
|
||||
|
||||
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)));
|
||||
|
||||
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)));
|
||||
|
||||
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);
|
||||
|
||||
00066 0f 52 c9 rsqrtps xmm1, xmm1
|
||||
|
||||
; 29 : *target = _mm_mul_ps(b_orthogonal, b_inv_length);
|
||||
|
||||
00069 0f 59 ca mulps xmm1, xmm2
|
||||
0006c 0f 11 0a movups XMMWORD PTR [rdx], xmm1
|
||||
|
||||
; 30 :
|
||||
; 31 : }
|
||||
|
||||
0006f c3 ret 0
|
||||
normalize ENDP
|
||||
_TEXT ENDS
|
||||
END
|
||||
Reference in New Issue
Block a user