VirtualBox

Ignore:
Timestamp:
Aug 15, 2022 10:48:50 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153026
Message:

IPRT/nocrt: lrint* returned the wrong sized long on 64-bit windows. Adopted llrint* and lring* to SEH64. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/math/lrintl.asm

    r96014 r96215  
    2525;
    2626
     27
     28%define RT_ASM_WITH_SEH64
    2729%include "iprt/asmdefs.mac"
     30
    2831
    2932BEGINCODE
    3033
    3134;;
    32 ; Round rd to the nearest integer value, rounding according to the current rounding direction.
    33 ; @returns 32-bit: eax  64-bit: rax
     35; Round lrd to the nearest integer value, rounding according to the current rounding direction.
     36; @returns 32-bit: eax  64-bit: rax (non-windows) or eax (windows)
    3437; @param    lrd     [rbp + xCB*2]
    3538RT_NOCRT_BEGINPROC lrintl
    36     push    xBP
    37     mov     xBP, xSP
    38     sub     xSP, 10h
     39        push    xBP
     40        SEH64_PUSH_xBP
     41        mov     xBP, xSP
     42        SEH64_SET_FRAME_xBP 0
     43        sub     xSP, 10h
     44        SEH64_ALLOCATE_STACK 10h
     45        SEH64_END_PROLOGUE
    3946
    40     fld     tword [xBP + xCB*2]
     47        fld     tword [xBP + xCB*2]
    4148%ifdef RT_ARCH_AMD64
    42     fistp   qword [xSP]
    43     fwait
    44     mov     rax, [xSP]
     49 %ifdef RT_OS_WINDOWS
     50        fistp   dword [xSP]
     51        fwait
     52        mov     eax, [xSP]
     53 %else
     54        fistp   qword [xSP]
     55        fwait
     56        mov     rax, [xSP]
     57 %endif
    4558%else
    46     fistp   dword [xSP]
    47     fwait
    48     mov     eax, [xSP]
     59        fistp   dword [xSP]
     60        fwait
     61        mov     eax, [xSP]
    4962%endif
    5063
    51     leave
    52     ret
     64        leave
     65        ret
    5366ENDPROC   RT_NOCRT(lrintl)
    5467
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