vbox的更動 96242 路徑 trunk/src/VBox/Runtime/common/math/cosf.asm
- 時間撮記:
- 2022-8-17 上午01:59:06 (3 年 以前)
- svn:sync-xref-src-repo-rev:
- 153054
- 檔案:
-
- 複製 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/common/math/cosf.asm
r96240 r96242 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT cos - AMD64 & X86.3 ; IPRT - No-CRT cosf - AMD64 & X86. 4 4 ; 5 5 … … 34 34 35 35 ;; 36 ; Compute the cosine of r d, measured in radians.36 ; Compute the cosine of rf, measured in radians. 37 37 ; 38 38 ; @returns st(0) / xmm0 39 ; @param r d[rbp + xCB*2] / xmm040 ; 41 RT_NOCRT_BEGINPROC cos 39 ; @param rf [rbp + xCB*2] / xmm0 40 ; 41 RT_NOCRT_BEGINPROC cosf 42 42 push xBP 43 43 SEH64_PUSH_xBP … … 64 64 ; 65 65 %ifdef RT_ARCH_AMD64 66 movs d[xBP - 10h], xmm067 fld qword [xBP - 10h]66 movss [xBP - 10h], xmm0 67 fld dword [xBP - 10h] 68 68 %else 69 fld qword [xBP + xCB*2]69 fld dword [xBP + xCB*2] 70 70 %endif 71 71 … … 74 74 ; works reliably, so outside that we'll use the FSIN instruction instead 75 75 ; as it has a larger good range (-5pi/4 to 1pi/4 for cosine). 76 ; Input conversion follows: cos (x) = sin(x + pi/2)76 ; Input conversion follows: cosf(x) = sinf(x + pi/2) 77 77 ; 78 78 ; We examin the input and weed out non-finit numbers first. … … 110 110 fld qword [.s_r64TinyCosTo1 xWrtRIP] 111 111 fcomip st1 112 j be.zero_extra_pop112 ja .zero_extra_pop 113 113 114 114 .not_that_tiny_input: … … 147 147 ; 148 148 .do_sine: 149 mov ecx, 1; double149 mov ecx, 0 ; double 150 150 extern NAME(rtNoCrtMathSinCore) 151 151 call NAME(rtNoCrtMathSinCore) … … 156 156 .return_val: 157 157 %ifdef RT_ARCH_AMD64 158 fstp qword [xBP - 10h]159 movs dxmm0, [xBP - 10h]158 fstp dword [xBP - 10h] 159 movss xmm0, [xBP - 10h] 160 160 %endif 161 161 %ifdef RT_OS_WINDOWS … … 167 167 168 168 ; 169 ; cos (+/-0) = +1.0169 ; cosf(+/-0) = +1.0 170 170 ; 171 171 .zero_extra_pop: … … 190 190 ; 191 191 ALIGNCODE(8) 192 ; About 2**- 27. When fabs(input) is below this limit we can consider cos(input) ~= 1.0.192 ; About 2**-18. When fabs(input) is below this limit we can consider cosf(input) ~= 1.0. 193 193 .s_r64TinyCosTo1: 194 dq 7.4505806e-9194 dq 0.000244140625 195 195 196 196 ; The absolute limit for the range which FCOS is expected to produce reasonable results. … … 200 200 .s_r64Two: 201 201 dq 2.0 202 ENDPROC RT_NOCRT(cos )203 202 ENDPROC RT_NOCRT(cosf) 203
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器