VirtualBox

Ignore:
Timestamp:
Jan 28, 2009 2:26:48 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42148
Message:

IPRT/math: use xSP and friends from asmdefs.mac instead of cooking our own in each file.

File:
1 edited

Legend:

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

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3434BEGINCODE
    3535
    36 %ifdef RT_ARCH_AMD64
    37  %define _SP rsp
    38  %define _BP rbp
    39  %define _S  8
    40 %else
    41  %define _SP esp
    42  %define _BP ebp
    43  %define _S  4
    44 %endif
    45 
    4636;;
    4737; Round to truncated integer value.
     
    4939; @param    rd      32-bit: [ebp + 8]   64-bit: xmm0
    5040BEGINPROC RT_NOCRT(trunc)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 10h
    5444
    5545%ifdef RT_ARCH_AMD64
    56     movsd   [_SP], xmm0
    57     fld     qword [_SP]
     46    movsd   [xSP], xmm0
     47    fld     qword [xSP]
    5848%else
    59     fld     qword [_BP + _S*2]
     49    fld     qword [xBP + xS*2]
    6050%endif
    6151
    6252    ; Make it truncate up by modifying the fpu control word.
    63     fstcw   [_BP - 10h]
    64     mov     eax, [_BP - 10h]
     53    fstcw   [xBP - 10h]
     54    mov     eax, [xBP - 10h]
    6555    or      eax, 00c00h
    66     mov     [_BP - 08h], eax
    67     fldcw   [_BP - 08h]
     56    mov     [xBP - 08h], eax
     57    fldcw   [xBP - 08h]
    6858
    6959    ; Round ST(0) to integer.
     
    7161
    7262    ; Restore the fpu control word.
    73     fldcw   [_BP - 10h]
     63    fldcw   [xBP - 10h]
    7464
    7565%ifdef RT_ARCH_AMD64
    76     fstp    qword [_SP]
    77     movsd   xmm0, [_SP]
     66    fstp    qword [xSP]
     67    movsd   xmm0, [xSP]
    7868%endif
    7969    leave
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