Changeset 96220 in vbox for trunk/src/VBox/Runtime/common/math
- Timestamp:
- Aug 15, 2022 1:03:25 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 153031
- Location:
- trunk/src/VBox/Runtime/common/math
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/math/log.asm
r96060 r96220 25 25 ; 26 26 27 28 %define RT_ASM_WITH_SEH64 27 29 %include "iprt/asmdefs.mac" 30 %include "iprt/x86.mac" 31 28 32 29 33 BEGINCODE … … 34 38 ; @param rd [rbp + xCB*2] / xmm0 35 39 RT_NOCRT_BEGINPROC log 36 push xBP 37 mov xBP, xSP 40 push xBP 41 SEH64_PUSH_xBP 42 mov xBP, xSP 43 SEH64_SET_FRAME_xBP 0 38 44 %ifdef RT_ARCH_AMD64 39 sub xSP, 10h 45 sub xSP, 10h 46 SEH64_ALLOCATE_STACK 10h 40 47 %endif 48 SEH64_END_PROLOGUE 41 49 42 fldln2 ; st0=log(2)50 fldln2 ; st0=log(2) 43 51 %ifdef RT_ARCH_AMD64 44 movsd [xSP], xmm045 fld qword [xSP]52 movsd [xBP - 10h], xmm0 53 fld qword [xBP - 10h] 46 54 %else 47 fld qword [xBP + xCB*2] ; st1=log(2) st0=lrd55 fld qword [xBP + xCB*2] ; st1=log(2) st0=lrd 48 56 %endif 49 fld st0 ; st1=log(2) st0=lrd st0=lrd 50 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 51 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 52 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 53 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 54 fnstsw ax 55 and eax, 04500h 56 jnz .use_st1 57 fld st0 ; st1=log(2) st0=lrd st0=lrd 58 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 59 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 57 60 58 fstp st0 ; st1=log(2) st0=lrd 59 fyl2x ; log(lrd) 60 jmp .done 61 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 62 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 63 fnstsw ax 64 and eax, X86_FSW_C3 | X86_FSW_C2 | X86_FSW_C0 65 jnz .use_st1 66 67 fstp st0 ; st1=log(2) st0=lrd 68 fyl2x ; log(lrd) 69 jmp .done 61 70 62 71 .use_st1: 63 fstp st1 ; st1=log(2) st0=lrd-1.064 fyl2xp1 ; log(lrd)72 fstp st1 ; st1=log(2) st0=lrd-1.0 73 fyl2xp1 ; log(lrd) 65 74 66 75 .done: 67 76 %ifdef RT_ARCH_AMD64 68 fstp qword [xSP]69 movsd xmm0, [xSP]77 fstp qword [xBP - 10h] 78 movsd xmm0, [xBP - 10h] 70 79 %endif 71 leave 72 ret 80 leave 81 ret 82 83 ALIGNCODE(8) 73 84 .one: dq 1.0 74 85 .limit: dq 0.29 -
trunk/src/VBox/Runtime/common/math/logf.asm
r96060 r96220 25 25 ; 26 26 27 28 %define RT_ASM_WITH_SEH64 27 29 %include "iprt/asmdefs.mac" 30 %include "iprt/x86.mac" 31 28 32 29 33 BEGINCODE … … 34 38 ; @param r32 [rbp + xCB*2] / xmm0 35 39 RT_NOCRT_BEGINPROC logf 36 push xBP 37 mov xBP, xSP 40 push xBP 41 SEH64_PUSH_xBP 42 mov xBP, xSP 43 SEH64_SET_FRAME_xBP 0 38 44 %ifdef RT_ARCH_AMD64 39 sub xSP, 10h 45 sub xSP, 10h 46 SEH64_ALLOCATE_STACK 10h 40 47 %endif 48 SEH64_END_PROLOGUE 41 49 42 fldln2 ; st0=log(2)50 fldln2 ; st0=log(2) 43 51 %ifdef RT_ARCH_AMD64 44 movss [xSP], xmm045 fld dword [xSP]52 movss [xBP - 10h], xmm0 53 fld dword [xBP - 10h] 46 54 %else 47 fld dword [xBP + xCB*2] ; st1=log(2) st0=lrd55 fld dword [xBP + xCB*2] ; st1=log(2) st0=lrd 48 56 %endif 49 fld st0 ; st1=log(2) st0=lrd st0=lrd 50 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 51 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 52 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 53 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 54 fnstsw ax 55 and eax, 04500h 56 jnz .use_st1 57 fld st0 ; st1=log(2) st0=lrd st0=lrd 58 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 59 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 57 60 58 fstp st0 ; st1=log(2) st0=lrd 59 fyl2x ; log(lrd) 60 jmp .done 61 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 62 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 63 fnstsw ax 64 and eax, X86_FSW_C3 | X86_FSW_C2 | X86_FSW_C0 65 jnz .use_st1 66 67 fstp st0 ; st1=log(2) st0=lrd 68 fyl2x ; log(lrd) 69 jmp .done 61 70 62 71 .use_st1: 63 fstp st1 ; st1=log(2) st0=lrd-1.064 fyl2xp1 ; log(lrd)72 fstp st1 ; st1=log(2) st0=lrd-1.0 73 fyl2xp1 ; log(lrd) 65 74 66 75 .done: 67 76 %ifdef RT_ARCH_AMD64 68 fstp dword [xSP]69 movss xmm0, [xSP]77 fstp dword [xBP - 10h] 78 movss xmm0, [xBP - 10h] 70 79 %endif 71 leave 72 ret 80 leave 81 ret 82 83 ALIGNCODE(8) 73 84 .one: dq 1.0 74 85 .limit: dq 0.29 -
trunk/src/VBox/Runtime/common/math/logl.asm
r96014 r96220 25 25 ; 26 26 27 28 %define RT_ASM_WITH_SEH64 27 29 %include "iprt/asmdefs.mac" 30 %include "iprt/x86.mac" 31 28 32 29 33 BEGINCODE … … 34 38 ; @param lrd [rbp + xCB*2] 35 39 RT_NOCRT_BEGINPROC logl 36 push xBP 37 mov xBP, xSP 38 sub xSP, 10h 40 push xBP 41 SEH64_PUSH_xBP 42 mov xBP, xSP 43 SEH64_SET_FRAME_xBP 0 44 SEH64_END_PROLOGUE 39 45 40 fldln2 ; st0=log(2) 41 fld tword [xBP + xCB*2] ; st1=log(2) st0=lrd 42 fld st0 ; st1=log(2) st0=lrd st0=lrd 43 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 44 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 45 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 46 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 47 fnstsw ax 48 and eax, 04500h 49 jnz .use_st1 46 fldln2 ; st0=log(2) 47 fld tword [xBP + xCB*2] ; st1=log(2) st0=lrd 48 fld st0 ; st1=log(2) st0=lrd st0=lrd 49 fsub qword [.one xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 50 fld st0 ; st3=log(2) st2=lrd st1=lrd-1.0 st0=lrd-1.0 50 51 51 fstp st0 ; st1=log(2) st0=lrd 52 fyl2x ; log(lrd) 53 jmp .done 52 fabs ; st3=log(2) st2=lrd st1=lrd-1.0 st0=abs(lrd-1.0) 53 fcomp qword [.limit xWrtRIP] ; st2=log(2) st1=lrd st0=lrd-1.0 54 fnstsw ax 55 and eax, X86_FSW_C3 | X86_FSW_C2 | X86_FSW_C0 56 jnz .use_st1 57 58 fstp st0 ; st1=log(2) st0=lrd 59 fyl2x ; log(lrd) 60 jmp .done 54 61 55 62 .use_st1: 56 fstp st1 ; st1=log(2) st0=lrd-1.057 fyl2xp1 ; log(lrd)63 fstp st1 ; st1=log(2) st0=lrd-1.0 64 fyl2xp1 ; log(lrd) 58 65 59 66 .done: 60 leave 61 ret 67 leave 68 ret 69 70 ALIGNCODE(8) 62 71 .one: dq 1.0 63 72 .limit: dq 0.29
Note:
See TracChangeset
for help on using the changeset viewer.