Changeset 96060 in vbox for trunk/src/VBox/Runtime/common/math
- Timestamp:
- Aug 5, 2022 12:22:06 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152859
- Location:
- trunk/src/VBox/Runtime/common/math
- Files:
-
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/math/ceil.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT ceil l- AMD64 & X86.3 ; IPRT - No-CRT ceil - AMD64 & X86. 4 4 ; 5 5 … … 32 32 ;; 33 33 ; Compute the smallest integral value not less than lrd. 34 ; @returns st(0) 35 ; @param lrd [rbp + 8]36 RT_NOCRT_BEGINPROC ceil l34 ; @returns st(0) / xmm0 35 ; @param rd [rbp + 8] / xmm0 36 RT_NOCRT_BEGINPROC ceil 37 37 push xBP 38 38 mov xBP, xSP 39 39 sub xSP, 10h 40 40 41 fld tword [xBP + xCB*2] 41 %ifdef RT_ARCH_AMD64 ;; @todo there is probably some sse instruction for this. 42 movsd [xSP], xmm0 43 fld qword [xSP] 44 %else 45 fld qword [xBP + xCB*2] 46 %endif 42 47 43 48 ; Make it round up by modifying the fpu control word. … … 55 60 fldcw [xBP - 10h] 56 61 62 %ifdef RT_ARCH_AMD64 63 fstp qword [xSP] 64 movsd xmm0, [xSP] 65 %endif 57 66 leave 58 67 ret 59 ENDPROC RT_NOCRT(ceil l)68 ENDPROC RT_NOCRT(ceil) 60 69 -
trunk/src/VBox/Runtime/common/math/ceilf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT ceil l- AMD64 & X86.3 ; IPRT - No-CRT ceilf - AMD64 & X86. 4 4 ; 5 5 … … 31 31 32 32 ;; 33 ; Compute the smallest integral value not less than lrd.34 ; @returns st(0) 35 ; @param lrd [rbp + 8]36 RT_NOCRT_BEGINPROC ceil l33 ; Compute the smallest integral value not less than r32. 34 ; @returns st(0) / xmm0 35 ; @param r32 [rbp + 8] / xmm0 36 RT_NOCRT_BEGINPROC ceilf 37 37 push xBP 38 38 mov xBP, xSP 39 39 sub xSP, 10h 40 40 41 fld tword [xBP + xCB*2] 41 %ifdef RT_ARCH_AMD64 ;; @todo there is probably some sse instruction for this. 42 movss [xSP], xmm0 43 fld dword [xSP] 44 %else 45 fld dword [xBP + xCB*2] 46 %endif 42 47 43 48 ; Make it round up by modifying the fpu control word. … … 55 60 fldcw [xBP - 10h] 56 61 62 %ifdef RT_ARCH_AMD64 63 fstp dword [xSP] 64 movss xmm0, [xSP] 65 %endif 57 66 leave 58 67 ret 59 ENDPROC RT_NOCRT(ceil l)68 ENDPROC RT_NOCRT(ceilf) 60 69 -
trunk/src/VBox/Runtime/common/math/cos.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT cos l- AMD64 & X86.3 ; IPRT - No-CRT cos - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; compute the cosine of ldr, measured in radians.33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 RT_NOCRT_BEGINPROC cos l32 ; compute the cosine of dr, measured in radians. 33 ; @returns st(0) / xmm0 34 ; @param rd [rbp + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC cos 36 36 push xBP 37 37 mov xBP, xSP 38 %ifdef RT_ARCH_AMD64 38 39 sub xSP, 10h 39 40 40 fld tword [xBP + xCB*2] 41 movsd [xSP], xmm0 42 fld qword [xSP] 43 %else 44 fld qword [xBP + xCB*2] 45 %endif 41 46 fcos 42 47 fnstsw ax … … 57 62 58 63 .done: 64 %ifdef RT_ARCH_AMD64 65 fstp qword [xSP] 66 movsd xmm0, [xSP] 67 %endif 59 68 leave 60 69 ret 61 ENDPROC RT_NOCRT(cos l)70 ENDPROC RT_NOCRT(cos) 62 71 -
trunk/src/VBox/Runtime/common/math/cosf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT cos l- AMD64 & X86.3 ; IPRT - No-CRT cosf - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; compute the cosine of ldr, measured in radians.33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 RT_NOCRT_BEGINPROC cos l32 ; compute the cosine of r32, measured in radians. 33 ; @returns st(0) / xmm0 34 ; @param r32 [rbp + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC cosf 36 36 push xBP 37 37 mov xBP, xSP 38 %ifdef RT_ARCH_AMD64 38 39 sub xSP, 10h 39 40 40 fld tword [xBP + xCB*2] 41 movss [xSP], xmm0 42 fld dword [xSP] 43 %else 44 fld dword [xBP + xCB*2] 45 %endif 41 46 fcos 42 47 fnstsw ax … … 57 62 58 63 .done: 64 %ifdef RT_ARCH_AMD64 65 fstp dword [xSP] 66 movss xmm0, [xSP] 67 %endif 59 68 leave 60 69 ret 61 ENDPROC RT_NOCRT(cos l)70 ENDPROC RT_NOCRT(cosf) 62 71 -
trunk/src/VBox/Runtime/common/math/ldexp.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT ldexp l- AMD64 & X86.3 ; IPRT - No-CRT ldexp - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Computes lrd * 2^exp33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 ; @param exp [ebp + 1 4h] gcc:edi msc:ecx36 RT_NOCRT_BEGINPROC ldexp l32 ; Computes rd * 2^exp 33 ; @returns st(0) / xmm0 34 ; @param rd [rbp + xCB*2] / xmm0 35 ; @param exp [ebp + 10h] gcc:edi msc:ecx 36 RT_NOCRT_BEGINPROC ldexp 37 37 push xBP 38 38 mov xBP, xSP 39 %ifdef RT_ARCH_AMD64 40 sub xSP, 20h 41 %else 39 42 sub xSP, 10h 43 %endif 40 44 41 45 ; load exp 42 %ifdef RT_ARCH_AMD64 ; ASSUMES ONLY GCC HERE! 46 %ifdef RT_ARCH_AMD64 47 %ifdef ASM_CALL64_GCC 43 48 mov [rsp], edi 49 %else 50 mov [rsp], ecx 51 %endif 44 52 fild dword [rsp] 53 movsd [rsp + 8], xmm0 54 fld qword [rsp + 8] 45 55 %else 46 fild dword [ebp + xCB*2 + RTLRD_CB] 56 fild dword [ebp + xCB*2 + 8] 57 fld qword [xBP + xCB*2] 47 58 %endif 48 fld tword [xBP + xCB*2]49 59 fscale 50 60 fstp st1 51 61 62 %ifdef RT_ARCH_AMD64 63 fstp qword [xSP] 64 movsd xmm0, [xSP] 65 %endif 52 66 leave 53 67 ret 54 ENDPROC RT_NOCRT(ldexp l)68 ENDPROC RT_NOCRT(ldexp) 55 69 -
trunk/src/VBox/Runtime/common/math/ldexpf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT ldexp l- AMD64 & X86.3 ; IPRT - No-CRT ldexpf - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Computes lrd* 2^exp33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 ; @param exp [ebp + 1 4h] gcc:edi msc:ecx36 RT_NOCRT_BEGINPROC ldexp l32 ; Computes r32 * 2^exp 33 ; @returns st(0) / xmm0 34 ; @param r32 [rbp + xCB*2] / xmm0 35 ; @param exp [ebp + 10h] gcc:edi msc:ecx 36 RT_NOCRT_BEGINPROC ldexpf 37 37 push xBP 38 38 mov xBP, xSP 39 %ifdef RT_ARCH_AMD64 40 sub xSP, 20h 41 %else 39 42 sub xSP, 10h 43 %endif 40 44 41 45 ; load exp 42 %ifdef RT_ARCH_AMD64 ; ASSUMES ONLY GCC HERE! 46 %ifdef RT_ARCH_AMD64 47 %ifdef ASM_CALL64_GCC 43 48 mov [rsp], edi 49 %else 50 mov [rsp], ecx 51 %endif 44 52 fild dword [rsp] 53 movss [rsp + 8], xmm0 54 fld dword [rsp + 8] 45 55 %else 46 fild dword [ebp + xCB*2 + RTLRD_CB] 56 fild dword [ebp + xCB*2 + 8] 57 fld dword [xBP + xCB*2] 47 58 %endif 48 fld tword [xBP + xCB*2]49 59 fscale 50 60 fstp st1 51 61 62 %ifdef RT_ARCH_AMD64 63 fstp dword [xSP] 64 movss xmm0, [xSP] 65 %endif 52 66 leave 53 67 ret 54 ENDPROC RT_NOCRT(ldexp l)68 ENDPROC RT_NOCRT(ldexpf) 55 69 -
trunk/src/VBox/Runtime/common/math/log.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT log l- AMD64 & X86.3 ; IPRT - No-CRT log - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; compute the natural logarithm of lrd33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 RT_NOCRT_BEGINPROC log l32 ; compute the natural logarithm of rd 33 ; @returns st(0) / xmm0 34 ; @param rd [rbp + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC log 36 36 push xBP 37 37 mov xBP, xSP 38 %ifdef RT_ARCH_AMD64 38 39 sub xSP, 10h 40 %endif 39 41 40 42 fldln2 ; st0=log(2) 41 fld tword [xBP + xCB*2] ; st1=log(2) st0=lrd 43 %ifdef RT_ARCH_AMD64 44 movsd [xSP], xmm0 45 fld qword [xSP] 46 %else 47 fld qword [xBP + xCB*2] ; st1=log(2) st0=lrd 48 %endif 42 49 fld st0 ; st1=log(2) st0=lrd st0=lrd 43 50 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 … … 58 65 59 66 .done: 67 %ifdef RT_ARCH_AMD64 68 fstp qword [xSP] 69 movsd xmm0, [xSP] 70 %endif 60 71 leave 61 72 ret 62 73 .one: dq 1.0 63 74 .limit: dq 0.29 64 ENDPROC RT_NOCRT(log l)75 ENDPROC RT_NOCRT(log) 65 76 -
trunk/src/VBox/Runtime/common/math/logf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT log l- AMD64 & X86.3 ; IPRT - No-CRT logf - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; compute the natural logarithm of lrd33 ; @returns st(0) 34 ; @param lrd [rbp + xCB*2]35 RT_NOCRT_BEGINPROC log l32 ; compute the natural logarithm of r32 33 ; @returns st(0) / xmm0 34 ; @param r32 [rbp + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC logf 36 36 push xBP 37 37 mov xBP, xSP 38 %ifdef RT_ARCH_AMD64 38 39 sub xSP, 10h 40 %endif 39 41 40 42 fldln2 ; st0=log(2) 41 fld tword [xBP + xCB*2] ; st1=log(2) st0=lrd 43 %ifdef RT_ARCH_AMD64 44 movss [xSP], xmm0 45 fld dword [xSP] 46 %else 47 fld dword [xBP + xCB*2] ; st1=log(2) st0=lrd 48 %endif 42 49 fld st0 ; st1=log(2) st0=lrd st0=lrd 43 50 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 … … 58 65 59 66 .done: 67 %ifdef RT_ARCH_AMD64 68 fstp dword [xSP] 69 movss xmm0, [xSP] 70 %endif 60 71 leave 61 72 ret 62 73 .one: dq 1.0 63 74 .limit: dq 0.29 64 ENDPROC RT_NOCRT(log l)75 ENDPROC RT_NOCRT(logf) 65 76 -
trunk/src/VBox/Runtime/common/math/sin.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT sin l- AMD64 & X86.3 ; IPRT - No-CRT sin - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Compute the sine of lrd33 ; @returns st(0) 34 ; @param lrd [xSP + xCB*2]35 RT_NOCRT_BEGINPROC sin l32 ; Compute the sine of rd 33 ; @returns st(0)/xmm0 34 ; @param rd [xSP + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC sin 36 36 push xBP 37 37 mov xBP, xSP 38 39 %ifdef RT_ARCH_AMD64 38 40 sub xSP, 10h 39 41 40 fld tword [xBP + xCB*2] 42 movsd [xSP], xmm0 43 fld qword [xSP] 44 %else 45 fld qword [xBP + xCB*2] 46 %endif 41 47 fsin 42 48 fnstsw ax … … 56 62 57 63 .done: 64 %ifdef RT_ARCH_AMD64 65 fstp qword [xSP] 66 movsd xmm0, [xSP] 67 %endif 58 68 leave 59 69 ret 60 ENDPROC RT_NOCRT(sin l)70 ENDPROC RT_NOCRT(sin) 61 71 -
trunk/src/VBox/Runtime/common/math/sinf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT sin l- AMD64 & X86.3 ; IPRT - No-CRT sinf - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Compute the sine of lrd33 ; @returns st(0) 34 ; @param lrd [xSP + xCB*2]35 RT_NOCRT_BEGINPROC sin l32 ; Compute the sine of r32 33 ; @returns st(0)/xmm0 34 ; @param r32 [xSP + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC sinf 36 36 push xBP 37 37 mov xBP, xSP 38 39 %ifdef RT_ARCH_AMD64 38 40 sub xSP, 10h 39 41 40 fld tword [xBP + xCB*2] 42 movss [xSP], xmm0 43 fld dword [xSP] 44 %else 45 fld dword [xBP + xCB*2] 46 %endif 41 47 fsin 42 48 fnstsw ax … … 56 62 57 63 .done: 64 %ifdef RT_ARCH_AMD64 65 fstp dword [xSP] 66 movss xmm0, [xSP] 67 %endif 58 68 leave 59 69 ret 60 ENDPROC RT_NOCRT(sin l)70 ENDPROC RT_NOCRT(sinf) 61 71 -
trunk/src/VBox/Runtime/common/math/tan.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT tan l- AMD64 & X86.3 ; IPRT - No-CRT tan - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Compute the sine of lrd33 ; @returns st(0) 34 ; @param lrd [xSP + xCB*2]35 RT_NOCRT_BEGINPROC tan l32 ; Compute the sine of rd 33 ; @returns st(0) / xmm0 34 ; @param rd [xSP + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC tan 36 36 push xBP 37 37 mov xBP, xSP 38 39 %ifdef RT_ARCH_AMD64 38 40 sub xSP, 10h 39 41 40 fld tword [xBP + xCB*2] 42 movsd [xSP], xmm0 43 fld qword [xSP] 44 %else 45 fld qword [xBP + xCB*2] 46 %endif 41 47 fptan 42 48 fnstsw ax … … 57 63 .done: 58 64 fstp st0 65 %ifdef RT_ARCH_AMD64 66 fstp qword [xSP] 67 movsd xmm0, [xSP] 68 %endif 59 69 leave 60 70 ret 61 ENDPROC RT_NOCRT(tan l)71 ENDPROC RT_NOCRT(tan) 62 72 -
trunk/src/VBox/Runtime/common/math/tanf.asm
r96039 r96060 1 1 ; $Id$ 2 2 ;; @file 3 ; IPRT - No-CRT tan l- AMD64 & X86.3 ; IPRT - No-CRT tanf - AMD64 & X86. 4 4 ; 5 5 … … 30 30 31 31 ;; 32 ; Compute the sine of lrd33 ; @returns st(0) 34 ; @param lrd [xSP + xCB*2]35 RT_NOCRT_BEGINPROC tan l32 ; Compute the sine of r32 33 ; @returns st(0) / xmm0 34 ; @param r32 [xSP + xCB*2] / xmm0 35 RT_NOCRT_BEGINPROC tanf 36 36 push xBP 37 37 mov xBP, xSP 38 39 %ifdef RT_ARCH_AMD64 38 40 sub xSP, 10h 39 41 40 fld tword [xBP + xCB*2] 42 movss [xSP], xmm0 43 fld dword [xSP] 44 %else 45 fld dword [xBP + xCB*2] 46 %endif 41 47 fptan 42 48 fnstsw ax … … 57 63 .done: 58 64 fstp st0 65 %ifdef RT_ARCH_AMD64 66 fstp dword [xSP] 67 movss xmm0, [xSP] 68 %endif 59 69 leave 60 70 ret 61 ENDPROC RT_NOCRT(tan l)71 ENDPROC RT_NOCRT(tanf) 62 72
Note:
See TracChangeset
for help on using the changeset viewer.