VirtualBox

Changeset 98495 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Feb 7, 2023 3:56:13 PM (2 years ago)
Author:
vboxsync
Message:

IPRT/vcc: Working on 64-bit integer support routines for the 32-bit Visual C++ compilers. bugref:10261

Location:
trunk/src/VBox/Runtime/common/compiler/vcc
Files:
1 added
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/compiler/vcc/x86-alldiv.asm

    r98493 r98495  
    4545;*  External Symbols                                                                                                             *
    4646;*********************************************************************************************************************************
    47 extern __aulldvrm
     47extern __aulldiv
    4848
    4949
     
    5151; Division of signed 64-bit values, returning both the quotient and reminder.
    5252;
    53 ; @returns  EDX:EAX Quotient, EBX:ECX Remainder.
     53; @returns  EDX:EAX Quotient.
    5454; @param    [esp+04h] [ebp+08h]     Dividend (64-bit)
    5555; @param    [esp+0ch] [ebp+10h]     Divisor (64-bit)
     
    5757; @note     The remainder registers are swapped compared to Watcom's I8D and U8D.
    5858;
    59 BEGINPROC_RAW   __alldvrm
     59BEGINPROC_RAW   __alldiv
    6060        ;
    6161        ; Load high parts so we can examine them for negativity.
     
    6565
    6666        ;
    67         ; We use __aullrem to do the work, we take care of the signedness.
     67        ; We use __aulldiv to do the work, we take care of the signedness.
    6868        ;
    6969        or      edx, edx
     
    7474
    7575        ; Both positive, so same as unsigned division.
    76         jmp     __aulldvrm
     76        jmp     __aulldiv
    7777
    7878
     
    8888        ; Load the low values to as we will be pushing them and probably negating them.
    8989        mov     eax, dword [ebp + 08h]      ; dividend_lo
    90         mov     ebx, dword [ebp + 10h]      ; divisor_lo
     90        ;mov     ebx, dword [ebp + 10h]      ; divisor_lo
    9191
    92         ; negate the divisor, do unsigned division(, and negate the quotient).
     92        ; negate the divisor, do unsigned division, and negate the quotient.
    9393        neg     ecx
    94         neg     ebx
     94        neg     dword [ebp + 10h]
    9595        sbb     ecx, 0
    9696
    9797        push    ecx
    98         push    ebx
     98        push    dword [ebp + 10h]
    9999        push    edx
    100100        push    eax
    101         call    __aulldvrm                  ; cleans up the the stack.
     101        call    __aulldiv                   ; cleans up the the stack.
    102102
    103103        neg     edx
     
    114114        ; Load the low values to as we will be pushing them and probably negating them.
    115115        mov     eax, dword [ebp + 08h]      ; dividend_lo
    116         mov     ebx, dword [ebp + 10h]      ; divisor_lo
     116        ;mov     ebx, dword [ebp + 10h]      ; divisor_lo
    117117
    118118        neg     edx
     
    124124
    125125.negative_dividend_positive_divisor:
    126         ; negate the dividend (above), do unsigned division, and negate both quotient and remainder
     126        ; negate the dividend (above), do unsigned division, and negate (both) quotient (and remainder)
    127127
    128128        push    ecx
    129         push    ebx
     129        push    dword [ebp + 10h]
    130130        push    edx
    131131        push    eax
    132         call    __aulldvrm                  ; cleans up the the stack.
     132        call    __aulldiv                   ; cleans up the the stack.
    133133
    134134        neg     edx
     
    136136        sbb     edx, 0
    137137
    138 .return_negated_remainder:
    139         neg     ebx
    140         neg     ecx
    141         sbb     ebx, 0
    142 
    143138        leave
    144139        ret     10h
    145140
    146141.negative_dividend_negative_divisor:
    147         ; negate both dividend (above) and divisor, do unsigned division, and negate the remainder.
     142        ; negate both dividend (above) and divisor, do unsigned division(, and negate the remainder).
    148143        neg     ecx
    149         neg     ebx
     144        neg     dword [ebp + 10h]
    150145        sbb     ecx, 0
    151146
    152147        push    ecx
    153         push    ebx
     148        push    dword [ebp + 10h]
    154149        push    edx
    155150        push    eax
    156         call    __aulldvrm                  ; cleans up the the stack.
     151        call    __aulldiv                   ; cleans up the the stack.
    157152
    158         jmp     .return_negated_remainder
    159 ENDPROC_RAW     __alldvrm
     153        leave
     154        ret     10h
     155ENDPROC_RAW     __alldiv
    160156
  • trunk/src/VBox/Runtime/common/compiler/vcc/x86-alldvrm.asm

    r98493 r98495  
    6565
    6666        ;
    67         ; We use __aullrem to do the work, we take care of the signedness.
     67        ; We use __aulldvrm to do the work, we take care of the signedness.
    6868        ;
    6969        or      edx, edx
     
    9090        mov     ebx, dword [ebp + 10h]      ; divisor_lo
    9191
    92         ; negate the divisor, do unsigned division(, and negate the quotient).
     92        ; negate the divisor, do unsigned division, and negate the quotient.
    9393        neg     ecx
    9494        neg     ebx
  • trunk/src/VBox/Runtime/common/compiler/vcc/x86-allrem.asm

    r98493 r98495  
    4545;*  External Symbols                                                                                                             *
    4646;*********************************************************************************************************************************
    47 extern __aulldvrm
     47extern __aullrem
    4848
    4949
    5050;;
    51 ; Division of signed 64-bit values, returning both the quotient and reminder.
     51; Division of signed 64-bit values, returning the reminder.
    5252;
    53 ; @returns  EDX:EAX Quotient, EBX:ECX Remainder.
     53; @returns  EDX:EAX Remainder.
    5454; @param    [esp+04h] [ebp+08h]     Dividend (64-bit)
    5555; @param    [esp+0ch] [ebp+10h]     Divisor (64-bit)
     
    5757; @note     The remainder registers are swapped compared to Watcom's I8D and U8D.
    5858;
    59 BEGINPROC_RAW   __alldvrm
     59BEGINPROC_RAW   __allrem
    6060        ;
    6161        ; Load high parts so we can examine them for negativity.
     
    7474
    7575        ; Both positive, so same as unsigned division.
    76         jmp     __aulldvrm
     76        jmp     __aullrem
     77
     78
     79.negative_divisor_positive_dividend:
     80        ; negate the divisor, do unsigned division(, and negate the quotient).
     81        neg     ecx
     82        neg     dword [esp + 0ch]
     83        sbb     ecx, 0
     84        mov     [esp + 0ch+4], ecx
     85
     86        jmp     __aullrem
    7787
    7888
     
    8292        ;
    8393
    84 .negative_divisor_positive_dividend:
    85         push    ebp
    86         mov     ebp, esp
    87 
    88         ; Load the low values to as we will be pushing them and probably negating them.
    89         mov     eax, dword [ebp + 08h]      ; dividend_lo
    90         mov     ebx, dword [ebp + 10h]      ; divisor_lo
    91 
    92         ; negate the divisor, do unsigned division(, and negate the quotient).
    93         neg     ecx
    94         neg     ebx
    95         sbb     ecx, 0
    96 
    97         push    ecx
    98         push    ebx
    99         push    edx
    100         push    eax
    101         call    __aulldvrm                  ; cleans up the the stack.
    102 
    103         neg     edx
    104         neg     eax
    105         sbb     edx, 0
    106 
    107         leave
    108         ret     10h
    109 
    11094.negative_dividend:
    11195        push    ebp
     
    11498        ; Load the low values to as we will be pushing them and probably negating them.
    11599        mov     eax, dword [ebp + 08h]      ; dividend_lo
    116         mov     ebx, dword [ebp + 10h]      ; divisor_lo
     100        ;mov     ebx, dword [ebp + 10h]      ; divisor_lo
    117101
    118102        neg     edx
     
    124108
    125109.negative_dividend_positive_divisor:
    126         ; negate the dividend (above), do unsigned division, and negate both quotient and remainder
     110        ; negate the dividend (above), do unsigned division, and negate (both quotient and) remainder
    127111
    128112        push    ecx
    129         push    ebx
     113        push    dword [ebp + 10h]
    130114        push    edx
    131115        push    eax
    132         call    __aulldvrm                  ; cleans up the the stack.
     116        call    __aullrem                   ; cleans up the the stack.
    133117
     118.return_negated_remainder:
    134119        neg     edx
    135120        neg     eax
    136121        sbb     edx, 0
    137 
    138 .return_negated_remainder:
    139         neg     ebx
    140         neg     ecx
    141         sbb     ebx, 0
    142122
    143123        leave
     
    147127        ; negate both dividend (above) and divisor, do unsigned division, and negate the remainder.
    148128        neg     ecx
    149         neg     ebx
     129        neg     dword [ebp + 10h]
    150130        sbb     ecx, 0
    151131
    152         push    ecx
    153         push    ebx
    154         push    edx
    155         push    eax
    156         call    __aulldvrm                  ; cleans up the the stack.
     132        jmp     .negative_dividend_positive_divisor
     133ENDPROC_RAW     __allrem
    157134
    158         jmp     .return_negated_remainder
    159 ENDPROC_RAW     __alldvrm
    160 
Note: See TracChangeset for help on using the changeset viewer.

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