VirtualBox

Changeset 89149 in vbox


Ignore:
Timestamp:
May 19, 2021 12:52:59 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144490
Message:

IPRT,bs3kit: Added ASMMultU64ByU32DivByU32 to bs3kit. bugref:10009

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r88813 r89149  
    283283# define ASMMemZeroPage                                 RT_MANGLER(ASMMemZeroPage)
    284284# define ASMMemZeroPage_EndProc                         RT_MANGLER(ASMMemZeroPage_EndProc)
     285# define ASMMultU64ByU32DivByU32                        RT_MANGLER(ASMMultU64ByU32DivByU32)
     286# define ASMMultU64ByU32DivByU32_EndProc                RT_MANGLER(ASMMultU64ByU32DivByU32_EndProc)
    285287# define ASMNopPause                                    RT_MANGLER(ASMNopPause)
    286288# define ASMNopPause_EndProc                            RT_MANGLER(ASMNopPause_EndProc)
  • trunk/src/VBox/Runtime/common/asm/ASMMultU64ByU32DivByU32.asm

    r82968 r89149  
    4040;
    4141BEGINPROC_EXPORTED ASMMultU64ByU32DivByU32
    42 %ifdef RT_ARCH_AMD64
     42%if ARCH_BITS == 64
    4343
    4444 %ifdef ASM_CALL64_MSC
     
    5454    div     r8
    5555
    56 %else ; X86
     56%else ; 16 or 32 bit
    5757    ;
    5858    ; This implementation is converted from the GCC inline
     
    6060    ; performance wise.
    6161    ;
     62 %if ARCH_BITS == 16
     63    push    bp
     64    mov     bp, sp
     65    push    eax                         ; push all return registers to preserve high value (paranoia)
     66    push    ebx
     67    push    ecx
     68    push    edx
     69 %endif
    6270    push    esi
    6371    push    edi
    6472
    65 %define u64A_Lo     [esp + 04h + 08h]
    66 %define u64A_Hi     [esp + 08h + 08h]
    67 %define u32B        [esp + 0ch + 08h]
    68 %define u32C        [esp + 10h + 08h]
     73 %if ARCH_BITS == 16
     74  %define u64A_Lo     [bp + 4 + 04h]
     75  %define u64A_Hi     [bp + 4 + 08h]
     76  %define u32B        [bp + 4 + 0ch]
     77  %define u32C        [bp + 4 + 10h]
     78 %else
     79  %define u64A_Lo     [esp + 04h + 08h]
     80  %define u64A_Hi     [esp + 08h + 08h]
     81  %define u32B        [esp + 0ch + 08h]
     82  %define u32C        [esp + 10h + 08h]
     83 %endif
    6984
    7085    ; Load parameters into registers.
     
    97112    pop     edi
    98113    pop     esi
     114 %if ARCH_BITS == 16
     115    ;  DX:CX:BX:AX, where DX holds bits 15:0, CX bits 31:16, BX bits 47:32, and AX bits 63:48.
     116    mov     ax, [bp - 4*4]              ; dx = bits 15:0
     117    shr     eax, 16
     118    mov     ax, [bp - 3*4]              ; cx = bits 31:16
     119    mov     dx, [bp - 2*4]              ; bx = bits 47:32
     120    shr     edx, 16
     121    mov     dx, [bp - 1*4]              ; ax = bits 63:48
     122    pop     edx
     123    pop     ecx
     124    pop     ebx
     125    pop     eax
     126    leave
     127 %endif
    99128%endif
    100129    ret
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r89146 r89149  
    238238       ../../../Runtime/common/asm/ASMSetFlags.asm \
    239239       ../../../Runtime/common/asm/ASMGetFlags.asm \
     240       ../../../Runtime/common/asm/ASMMultU64ByU32DivByU32.asm \
    240241
    241242# The 16-bit BS3Kit library.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette