354 lines
11 KiB
Plaintext
354 lines
11 KiB
Plaintext
; Listing generated by Microsoft (R) Optimizing Compiler Version 19.39.33523.0
|
|
|
|
include listing.inc
|
|
|
|
INCLUDELIB MSVCRTD
|
|
INCLUDELIB OLDNAMES
|
|
|
|
_DATA SEGMENT
|
|
COMM infolog:BYTE:0200H
|
|
_DATA ENDS
|
|
msvcjmc SEGMENT
|
|
__A19B9DB6_ssgc_framework@h DB 01H
|
|
__5BC5AF51_mmintrin@h DB 01H
|
|
__4B783B3C_concurrencysal@h DB 01H
|
|
__137BB1BE_sal@h DB 01H
|
|
__805F4069_vadefs@h DB 01H
|
|
__1EAACA9B_vcruntime@h DB 01H
|
|
__1B0272D9_corecrt@h DB 01H
|
|
__45DED006_corecrt_malloc@h DB 01H
|
|
__FA77ED4C_malloc@h DB 01H
|
|
__9E7FA6CF_xmmintrin@h DB 01H
|
|
__0ED14FEE_winpackagefamily@h DB 01H
|
|
__F92EF742_winapifamily@h DB 01H
|
|
__22E515EB_sdkddkver@h DB 01H
|
|
__1227BCE2_excpt@h DB 01H
|
|
__CC8D90C0_stdarg@h DB 01H
|
|
__29F49F40_specstrings_undef@h DB 01H
|
|
__D0F42932_specstrings_strict@h DB 01H
|
|
__F00405FD_sdv_driverspecs@h DB 01H
|
|
__173E09CA_driverspecs@h DB 01H
|
|
__9A452361_specstrings@h DB 01H
|
|
__74484FB3_corecrt_wctype@h DB 01H
|
|
__1EC467ED_ctype@h DB 01H
|
|
__98517906_kernelspecs@h DB 01H
|
|
__D3497022_basetsd@h DB 01H
|
|
__61CC25A1_errno@h DB 01H
|
|
__0504B279_vcruntime_string@h DB 01H
|
|
__E4C945B4_corecrt_memcpy_s@h DB 01H
|
|
__8EAFF484_corecrt_memory@h DB 01H
|
|
__6490AEC5_corecrt_wstring@h DB 01H
|
|
__E8295E1E_string@h DB 01H
|
|
__7FCB5136_guiddef@h DB 01H
|
|
__FF8A9E11_pshpack4@h DB 01H
|
|
__D5438902_poppack@h DB 01H
|
|
__FB07E2A3_pshpack2@h DB 01H
|
|
__F6906775_pshpack8@h DB 01H
|
|
__F9415CFA_pshpack1@h DB 01H
|
|
__E58C6F1C_apiset@h DB 01H
|
|
__A5C52262_ktmtypes@h DB 01H
|
|
__FBBA8F9D_winnt@h DB 01H
|
|
__A32D3D2C_minwindef@h DB 01H
|
|
__7D798299_windef@h DB 01H
|
|
__9AE108E9_apisetcconv@h DB 01H
|
|
__9CE53D2C_minwinbase@h DB 01H
|
|
__5D0AA210_apiquery2@h DB 01H
|
|
__4DD4E726_processenv@h DB 01H
|
|
__3575CC96_fileapi@h DB 01H
|
|
__8EA220E6_fileapifromapp@h DB 01H
|
|
__BF9B31FE_debugapi@h DB 01H
|
|
__C3AFE134_utilapiset@h DB 01H
|
|
__76F69E51_handleapi@h DB 01H
|
|
__7E63D784_errhandlingapi@h DB 01H
|
|
__FFA7003C_fibersapi@h DB 01H
|
|
__8971CECF_namedpipeapi@h DB 01H
|
|
__46C9D8A6_profileapi@h DB 01H
|
|
__98D4F0A3_heapapi@h DB 01H
|
|
__50EF2A88_ioapiset@h DB 01H
|
|
__92EA1464_synchapi@h DB 01H
|
|
__A53D8AED_interlockedapi@h DB 01H
|
|
__B506CAAF_processthreadsapi@h DB 01H
|
|
__FF735694_sysinfoapi@h DB 01H
|
|
__29589789_memoryapi@h DB 01H
|
|
__E9C7A663_enclaveapi@h DB 01H
|
|
__D035F9F7_threadpoollegacyapiset@h DB 01H
|
|
__C899130C_threadpoolapiset@h DB 01H
|
|
__E0441EE7_jobapi@h DB 01H
|
|
__CEF86838_jobapi2@h DB 01H
|
|
__35AC6B9A_wow64apiset@h DB 01H
|
|
__C8AE41A5_libloaderapi@h DB 01H
|
|
__CC9E232D_securitybaseapi@h DB 01H
|
|
__C9D0C9B8_namespaceapi@h DB 01H
|
|
__30FF9CAD_systemtopologyapi@h DB 01H
|
|
__4D358795_processtopologyapi@h DB 01H
|
|
__40446D10_securityappcontainer@h DB 01H
|
|
__3A952EDF_realtimeapiset@h DB 01H
|
|
__F4865F4B_winerror@h DB 01H
|
|
__53C1BD93_timezoneapi@h DB 01H
|
|
__1FFBEDBF_winbase@h DB 01H
|
|
__43D3FA34_wingdi@h DB 01H
|
|
__D24A7391_tvout@h DB 01H
|
|
__7713A6C8_winuser@h DB 01H
|
|
__0B345F71_datetimeapi@h DB 01H
|
|
__9AC6960C_winnls@h DB 01H
|
|
__973A40A8_stringapiset@h DB 01H
|
|
__CC46FEE2_wincontypes@h DB 01H
|
|
__97D70BE1_consoleapi@h DB 01H
|
|
__27EC5E18_consoleapi2@h DB 01H
|
|
__262E342F_consoleapi3@h DB 01H
|
|
__641DCD70_wincon@h DB 01H
|
|
__5A96C7A7_verrsrc@h DB 01H
|
|
__B69C6FF2_winver@h DB 01H
|
|
__7AEB8C37_reason@h DB 01H
|
|
__59F1A8A9_winreg@h DB 01H
|
|
__EE0E2B7F_wnnc@h DB 01H
|
|
__DCDB7054_winnetwk@h DB 01H
|
|
__81DDEDE3_stralign@h DB 01H
|
|
__2134D1B4_winsvc@h DB 01H
|
|
__11C07376_mcx@h DB 01H
|
|
__577CE3E7_ime_cmodes@h DB 01H
|
|
__1E72C31E_imm@h DB 01H
|
|
__E15BF856_windows@h DB 01H
|
|
__61B03275_ssgc_internal@h DB 01H
|
|
__F8522E0F_stdint@h DB 01H
|
|
__874AB8BA_khrplatform@h DB 01H
|
|
__8DCB230D_gl@h DB 01H
|
|
__5F89FF5A_wgl@h DB 01H
|
|
__13F5961F_stddef@h DB 01H
|
|
__B47D1049_glfw3@h DB 01H
|
|
__FB1D2F03_emmintrin@h DB 01H
|
|
__24BC478A_pmmintrin@h DB 01H
|
|
__94653408_tmmintrin@h DB 01H
|
|
__BD5E218B_smmintrin@h DB 01H
|
|
__D83CA847_nmmintrin@h DB 01H
|
|
__0D875209_wmmintrin@h DB 01H
|
|
__C6131F0E_zmmintrin@h DB 01H
|
|
__F107BDC4_immintrin@h DB 01H
|
|
__44420885_corecrt_stdio_config@h DB 01H
|
|
__AB601D8D_corecrt_wstdio@h DB 01H
|
|
__C1EC35D3_stdio@h DB 01H
|
|
__FD6DBD68_corecrt_search@h DB 01H
|
|
__E2E33A61_corecrt_wstdlib@h DB 01H
|
|
__46240030_limits@h DB 01H
|
|
__6E5ACABA_stdlib@h DB 01H
|
|
__5274102E_stb_image@h DB 01H
|
|
__CE2BBC10_StgSharpC@h DB 01H
|
|
__ABB5A48E_vector@c DB 01H
|
|
msvcjmc ENDS
|
|
PUBLIC normalize
|
|
PUBLIC __JustMyCode_Default
|
|
EXTRN _RTC_InitBase:PROC
|
|
EXTRN _RTC_Shutdown:PROC
|
|
EXTRN __CheckForDebuggerJustMyCode:PROC
|
|
; COMDAT pdata
|
|
pdata SEGMENT
|
|
$pdata$normalize DD imagerel $LN3
|
|
DD imagerel $LN3+378
|
|
DD imagerel $unwind$normalize
|
|
pdata ENDS
|
|
; COMDAT rtc$TMZ
|
|
rtc$TMZ SEGMENT
|
|
_RTC_Shutdown.rtc$TMZ DQ FLAT:_RTC_Shutdown
|
|
rtc$TMZ ENDS
|
|
; COMDAT rtc$IMZ
|
|
rtc$IMZ SEGMENT
|
|
_RTC_InitBase.rtc$IMZ DQ FLAT:_RTC_InitBase
|
|
rtc$IMZ ENDS
|
|
; COMDAT xdata
|
|
xdata SEGMENT
|
|
$unwind$normalize DD 025051801H
|
|
DD 01132318H
|
|
DD 0700c0041H
|
|
DD 0500bH
|
|
xdata ENDS
|
|
; Function compile flags: /Odt
|
|
; COMDAT __JustMyCode_Default
|
|
_TEXT SEGMENT
|
|
__JustMyCode_Default PROC ; COMDAT
|
|
00000 c2 00 00 ret 0
|
|
__JustMyCode_Default ENDP
|
|
_TEXT ENDS
|
|
; Function compile flags: /Odtp /RTCsu /ZI
|
|
; File D:\NitloadIndustry\研究项目\1-Flagship\TH2020\ProjectFile\源代码\StgSharpC\vector.c
|
|
; COMDAT normalize
|
|
_TEXT SEGMENT
|
|
a_length_sq$ = 16
|
|
a_inv_length$ = 64
|
|
dot_product$ = 112
|
|
b_orthogonal$ = 160
|
|
b_length_sq$ = 208
|
|
b_inv_length$ = 256
|
|
source$ = 512
|
|
target$ = 520
|
|
normalize PROC ; COMDAT
|
|
|
|
; 5 : {
|
|
|
|
$LN3:
|
|
00000 48 89 54 24 10 mov QWORD PTR [rsp+16], rdx
|
|
00005 48 89 4c 24 08 mov QWORD PTR [rsp+8], rcx
|
|
0000a 55 push rbp
|
|
0000b 57 push rdi
|
|
0000c 48 81 ec 08 02
|
|
00 00 sub rsp, 520 ; 00000208H
|
|
00013 48 8d 6c 24 20 lea rbp, QWORD PTR [rsp+32]
|
|
00018 48 8d 0d 00 00
|
|
00 00 lea rcx, OFFSET FLAT:__ABB5A48E_vector@c
|
|
0001f e8 00 00 00 00 call __CheckForDebuggerJustMyCode
|
|
|
|
; 6 : // 计算source的长度的平方
|
|
; 7 : __m128 a_length_sq = _mm_mul_ps(*source, *source); // 向量点乘自身
|
|
|
|
00024 48 8b 85 00 02
|
|
00 00 mov rax, QWORD PTR source$[rbp]
|
|
0002b 48 8b 8d 00 02
|
|
00 00 mov rcx, QWORD PTR source$[rbp]
|
|
00032 0f 10 00 movups xmm0, XMMWORD PTR [rax]
|
|
00035 0f 59 01 mulps xmm0, XMMWORD PTR [rcx]
|
|
00038 0f 29 45 10 movaps XMMWORD PTR a_length_sq$[rbp], xmm0
|
|
|
|
; 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)));
|
|
|
|
0003c 0f 28 45 10 movaps xmm0, XMMWORD PTR a_length_sq$[rbp]
|
|
00040 0f c6 45 10 b1 shufps xmm0, XMMWORD PTR a_length_sq$[rbp], 177 ; 000000b1H
|
|
00045 0f 28 4d 10 movaps xmm1, XMMWORD PTR a_length_sq$[rbp]
|
|
00049 0f 58 c8 addps xmm1, xmm0
|
|
0004c 0f 28 c1 movaps xmm0, xmm1
|
|
0004f 0f 29 45 10 movaps XMMWORD PTR a_length_sq$[rbp], 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)));
|
|
|
|
00053 0f 28 45 10 movaps xmm0, XMMWORD PTR a_length_sq$[rbp]
|
|
00057 0f c6 45 10 0e shufps xmm0, XMMWORD PTR a_length_sq$[rbp], 14
|
|
0005c 0f 28 4d 10 movaps xmm1, XMMWORD PTR a_length_sq$[rbp]
|
|
00060 f3 0f 58 c8 addss xmm1, xmm0
|
|
00064 0f 29 4d 10 movaps XMMWORD PTR a_length_sq$[rbp], xmm1
|
|
|
|
; 10 :
|
|
; 11 : // 归一化向量source
|
|
; 12 : __m128 a_inv_length = _mm_rsqrt_ps(a_length_sq); // 计算source长度的倒数平方根
|
|
|
|
00068 0f 52 45 10 rsqrtps xmm0, XMMWORD PTR a_length_sq$[rbp]
|
|
0006c 0f 29 45 40 movaps XMMWORD PTR a_inv_length$[rbp], xmm0
|
|
|
|
; 13 : *source = _mm_mul_ps(*source, a_inv_length); // 用source乘以其长度的倒数平方根得到单位向量
|
|
|
|
00070 48 8b 85 00 02
|
|
00 00 mov rax, QWORD PTR source$[rbp]
|
|
00077 0f 10 00 movups xmm0, XMMWORD PTR [rax]
|
|
0007a 0f 59 45 40 mulps xmm0, XMMWORD PTR a_inv_length$[rbp]
|
|
0007e 48 8b 85 00 02
|
|
00 00 mov rax, QWORD PTR source$[rbp]
|
|
00085 0f 11 00 movups XMMWORD PTR [rax], xmm0
|
|
|
|
; 14 :
|
|
; 15 : // 计算target与source的点积
|
|
; 16 : __m128 dot_product = _mm_mul_ps(*target, *source);
|
|
|
|
00088 48 8b 85 08 02
|
|
00 00 mov rax, QWORD PTR target$[rbp]
|
|
0008f 48 8b 8d 00 02
|
|
00 00 mov rcx, QWORD PTR source$[rbp]
|
|
00096 0f 10 00 movups xmm0, XMMWORD PTR [rax]
|
|
00099 0f 59 01 mulps xmm0, XMMWORD PTR [rcx]
|
|
0009c 0f 29 45 70 movaps XMMWORD PTR dot_product$[rbp], xmm0
|
|
|
|
; 17 : dot_product = _mm_add_ps(dot_product, _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(2, 3, 0, 1)));
|
|
|
|
000a0 0f 28 45 70 movaps xmm0, XMMWORD PTR dot_product$[rbp]
|
|
000a4 0f c6 45 70 b1 shufps xmm0, XMMWORD PTR dot_product$[rbp], 177 ; 000000b1H
|
|
000a9 0f 28 4d 70 movaps xmm1, XMMWORD PTR dot_product$[rbp]
|
|
000ad 0f 58 c8 addps xmm1, xmm0
|
|
000b0 0f 28 c1 movaps xmm0, xmm1
|
|
000b3 0f 29 45 70 movaps XMMWORD PTR dot_product$[rbp], xmm0
|
|
|
|
; 18 : dot_product = _mm_add_ss(dot_product, _mm_shuffle_ps(dot_product, dot_product, _MM_SHUFFLE(0, 0, 3, 2)));
|
|
|
|
000b7 0f 28 45 70 movaps xmm0, XMMWORD PTR dot_product$[rbp]
|
|
000bb 0f c6 45 70 0e shufps xmm0, XMMWORD PTR dot_product$[rbp], 14
|
|
000c0 0f 28 4d 70 movaps xmm1, XMMWORD PTR dot_product$[rbp]
|
|
000c4 f3 0f 58 c8 addss xmm1, xmm0
|
|
000c8 0f 29 4d 70 movaps XMMWORD PTR dot_product$[rbp], xmm1
|
|
|
|
; 19 :
|
|
; 20 : // 从target中减去source的方向分量,使其垂直于source
|
|
; 21 : __m128 b_orthogonal = _mm_sub_ps(*target, _mm_mul_ps(*source, dot_product));
|
|
|
|
000cc 48 8b 85 00 02
|
|
00 00 mov rax, QWORD PTR source$[rbp]
|
|
000d3 0f 10 00 movups xmm0, XMMWORD PTR [rax]
|
|
000d6 0f 59 45 70 mulps xmm0, XMMWORD PTR dot_product$[rbp]
|
|
000da 48 8b 85 08 02
|
|
00 00 mov rax, QWORD PTR target$[rbp]
|
|
000e1 0f 10 08 movups xmm1, XMMWORD PTR [rax]
|
|
000e4 0f 5c c8 subps xmm1, xmm0
|
|
000e7 0f 28 c1 movaps xmm0, xmm1
|
|
000ea 0f 29 85 a0 00
|
|
00 00 movaps XMMWORD PTR b_orthogonal$[rbp], xmm0
|
|
|
|
; 22 :
|
|
; 23 : // 归一化向量b_orthogonal
|
|
; 24 : __m128 b_length_sq = _mm_mul_ps(b_orthogonal, b_orthogonal);
|
|
|
|
000f1 0f 28 85 a0 00
|
|
00 00 movaps xmm0, XMMWORD PTR b_orthogonal$[rbp]
|
|
000f8 0f 59 85 a0 00
|
|
00 00 mulps xmm0, XMMWORD PTR b_orthogonal$[rbp]
|
|
000ff 0f 29 85 d0 00
|
|
00 00 movaps XMMWORD PTR b_length_sq$[rbp], xmm0
|
|
|
|
; 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)));
|
|
|
|
00106 0f 28 85 d0 00
|
|
00 00 movaps xmm0, XMMWORD PTR b_length_sq$[rbp]
|
|
0010d 0f c6 85 d0 00
|
|
00 00 b1 shufps xmm0, XMMWORD PTR b_length_sq$[rbp], 177 ; 000000b1H
|
|
00115 0f 28 8d d0 00
|
|
00 00 movaps xmm1, XMMWORD PTR b_length_sq$[rbp]
|
|
0011c 0f 58 c8 addps xmm1, xmm0
|
|
0011f 0f 28 c1 movaps xmm0, xmm1
|
|
00122 0f 29 85 d0 00
|
|
00 00 movaps XMMWORD PTR b_length_sq$[rbp], 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)));
|
|
|
|
00129 0f 28 85 d0 00
|
|
00 00 movaps xmm0, XMMWORD PTR b_length_sq$[rbp]
|
|
00130 0f c6 85 d0 00
|
|
00 00 0e shufps xmm0, XMMWORD PTR b_length_sq$[rbp], 14
|
|
00138 0f 28 8d d0 00
|
|
00 00 movaps xmm1, XMMWORD PTR b_length_sq$[rbp]
|
|
0013f f3 0f 58 c8 addss xmm1, xmm0
|
|
00143 0f 29 8d d0 00
|
|
00 00 movaps XMMWORD PTR b_length_sq$[rbp], xmm1
|
|
|
|
; 27 :
|
|
; 28 : __m128 b_inv_length = _mm_rsqrt_ps(b_length_sq);
|
|
|
|
0014a 0f 52 85 d0 00
|
|
00 00 rsqrtps xmm0, XMMWORD PTR b_length_sq$[rbp]
|
|
00151 0f 29 85 00 01
|
|
00 00 movaps XMMWORD PTR b_inv_length$[rbp], xmm0
|
|
|
|
; 29 : *target = _mm_mul_ps(b_orthogonal, b_inv_length);
|
|
|
|
00158 0f 28 85 a0 00
|
|
00 00 movaps xmm0, XMMWORD PTR b_orthogonal$[rbp]
|
|
0015f 0f 59 85 00 01
|
|
00 00 mulps xmm0, XMMWORD PTR b_inv_length$[rbp]
|
|
00166 48 8b 85 08 02
|
|
00 00 mov rax, QWORD PTR target$[rbp]
|
|
0016d 0f 11 00 movups XMMWORD PTR [rax], xmm0
|
|
|
|
; 30 :
|
|
; 31 : }
|
|
|
|
00170 48 8d a5 e8 01
|
|
00 00 lea rsp, QWORD PTR [rbp+488]
|
|
00177 5f pop rdi
|
|
00178 5d pop rbp
|
|
00179 c3 ret 0
|
|
normalize ENDP
|
|
_TEXT ENDS
|
|
END
|