- Timestamp:
- Aug 5, 2022 12:22:06 PM (2 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 1 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r96059 r96060 1811 1811 r3/nocrt-per-thread-2.cpp \ 1812 1812 r3/nocrt-errno.cpp 1813 1813 1814 RuntimeR3_SOURCES.x86 = $(RuntimeBaseR3_SOURCES.x86) \ 1815 common/math/cos.asm \ 1816 common/math/cosf.asm \ 1817 common/math/ceil.asm \ 1818 common/math/ceilf.asm \ 1819 common/math/fabs.asm \ 1820 common/math/fabsf.asm \ 1821 common/math/floor.asm \ 1822 common/math/floorf.asm \ 1823 common/math/ldexp.asm \ 1824 common/math/ldexpf.asm \ 1825 common/math/log.asm \ 1826 common/math/logf.asm \ 1827 common/math/llrint.asm \ 1828 common/math/llrintf.asm \ 1829 common/math/lrint.asm \ 1830 common/math/lrintf.asm \ 1831 common/math/remainder.asm \ 1832 common/math/remainderf.asm \ 1833 common/math/sin.asm \ 1834 common/math/sinf.asm \ 1835 common/math/tan.asm \ 1836 common/math/tanf.asm \ 1837 common/math/trunc.asm \ 1838 common/math/truncf.asm \ 1814 1839 common/misc/setjmp.asm \ 1815 1840 common/string/memcpy.asm \ … … 1832 1857 common/string/strpbrk.cpp 1833 1858 RuntimeR3_SOURCES.amd64 = $(RuntimeBaseR3_SOURCES.amd64) \ 1859 common/math/cos.asm \ 1860 common/math/cosf.asm \ 1861 common/math/ceil.asm \ 1862 common/math/ceilf.asm \ 1863 common/math/fabs.asm \ 1864 common/math/fabsf.asm \ 1865 common/math/floor.asm \ 1866 common/math/floorf.asm \ 1867 common/math/ldexp.asm \ 1868 common/math/ldexpf.asm \ 1869 common/math/log.asm \ 1870 common/math/logf.asm \ 1871 common/math/llrint.asm \ 1872 common/math/llrintf.asm \ 1873 common/math/lrint.asm \ 1874 common/math/lrintf.asm \ 1875 common/math/remainder.asm \ 1876 common/math/remainderf.asm \ 1877 common/math/sin.asm \ 1878 common/math/sinf.asm \ 1879 common/math/tan.asm \ 1880 common/math/tanf.asm \ 1881 common/math/trunc.asm \ 1882 common/math/truncf.asm \ 1834 1883 common/misc/setjmp.asm \ 1835 1884 common/string/memcpy.asm \ … … 1881 1930 common/compiler/vcc/guard-vcc.asm \ 1882 1931 common/compiler/vcc/stack-vcc.asm 1883 RuntimeR3_VBOX_NOCRT_ALIASES.win = strtok_s=nocrt_strtok_r _strtok_s=nocrt_strtok_r nocrt_strtok_s=nocrt_strtok_r 1932 RuntimeR3_VBOX_NOCRT_ALIASES.win = strtok_s=nocrt_strtok_r _strtok_s=nocrt_strtok_r nocrt_strtok_s=nocrt_strtok_r \ 1933 cosl=nocrt_cos _cosl=nocrt_cos \ 1934 ceill=nocrt_ceil _ceill=nocrt_ceil \ 1935 fabsl=nocrt_fabs _fabsl=nocrt_fabs \ 1936 floorl=nocrt_floor _floorl=nocrt_floor \ 1937 ldexpl=nocrt_ldexp _ldexpl=nocrt_ldexp \ 1938 logl=nocrt_log _logl=nocrt_log \ 1939 lrintl=nocrt_lrint _lrintl=nocrt_lrint \ 1940 llrintl=nocrt_llrint _llrintl=nocrt_llrint \ 1941 remainderl=nocrt_remainder _remainderl=nocrt_remainder \ 1942 sinl=nocrt_sin _sinl=nocrt_sin \ 1943 tanl=nocrt_tan _tanl=nocrt_tan 1884 1944 endif 1885 1945 endif -
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.