VirtualBox

Changeset 16316 in vbox


Ignore:
Timestamp:
Jan 28, 2009 2:26:48 PM (16 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Runtime/common/math
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/math/ceill.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; Compute the smallest integral value not less than lrd.
     
    4939; @param    lrd     [rbp + 8]
    5040BEGINPROC RT_NOCRT(ceill)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 10h
    5444
    55     fld     tword [_BP + _S*2]
     45    fld     tword [xBP + xS*2]
    5646
    5747    ; Make it round up by modifying the fpu control word.
    58     fstcw   [_BP - 10h]
    59     mov     eax, [_BP - 10h]
     48    fstcw   [xBP - 10h]
     49    mov     eax, [xBP - 10h]
    6050    or      eax, 00800h
    6151    and     eax, 0fbffh
    62     mov     [_BP - 08h], eax
    63     fldcw   [_BP - 08h]
     52    mov     [xBP - 08h], eax
     53    fldcw   [xBP - 08h]
    6454
    6555    ; Round ST(0) to integer.
     
    6757
    6858    ; Restore the fpu control word.
    69     fldcw   [_BP - 10h]
     59    fldcw   [xBP - 10h]
    7060
    7161    leave
  • trunk/src/VBox/Runtime/common/math/cosl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; compute the cosine of ldr, measured in radians.
    4737; @returns st(0)
    48 ; @param    lrd     [rbp + _S*2]
     38; @param    lrd     [rbp + xS*2]
    4939BEGINPROC RT_NOCRT(cosl)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    54     fld     tword [_BP + _S*2]
     44    fld     tword [xBP + xS*2]
    5545    fcos
    5646    fnstsw  ax
  • trunk/src/VBox/Runtime/common/math/fabs.asm

    • Property svn:keywords set to Author Date Id Revision
    r8256 r16316  
    1 ; $Id: $
     1; $Id$
    22;; @file
    33; IPRT - No-CRT fabs - AMD64 & X86.
     
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the absolute value of rd (|rd|).
     
    4838; @param    rd      32-bit: [ebp + 8]   64-bit: xmm0
    4939BEGINPROC RT_NOCRT(fabs)
    50     push    _BP
    51     mov     _BP, _SP
     40    push    xBP
     41    mov     xBP, xSP
    5242
    5343%ifdef RT_ARCH_AMD64
    54     sub     _SP, 10h
     44    sub     xSP, 10h
    5545
    56     movsd   [_SP], xmm0
    57     fld     qword [_SP]
     46    movsd   [xSP], xmm0
     47    fld     qword [xSP]
    5848
    5949    fabs
    6050
    61     fstp    qword [_SP]
    62     movsd   xmm0, [_SP]
     51    fstp    qword [xSP]
     52    movsd   xmm0, [xSP]
    6353
    6454%else
    65     fld     qword [_BP + _S*2]
     55    fld     qword [xBP + xS*2]
    6656    fabs
    6757%endif
  • trunk/src/VBox/Runtime/common/math/fabsf.asm

    • Property svn:keywords set to Author Date Id Revision
    r8256 r16316  
    1 ; $Id: $
     1; $Id$
    22;; @file
    33; IPRT - No-CRT fabsf - AMD64 & X86.
     
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the absolute value of rf (|rf|).
     
    4838; @param    rf      32-bit: [ebp + 8]   64-bit: xmm0
    4939BEGINPROC RT_NOCRT(fabsf)
    50     push    _BP
    51     mov     _BP, _SP
     40    push    xBP
     41    mov     xBP, xSP
    5242
    5343%ifdef RT_ARCH_AMD64
    54     sub     _SP, 10h
     44    sub     xSP, 10h
    5545
    56     movsd   [_SP], xmm0
    57     fld     dword [_SP]
     46    movsd   [xSP], xmm0
     47    fld     dword [xSP]
    5848
    5949    fabs
    6050
    61     fstp    dword [_SP]
    62     movsd   xmm0, [_SP]
     51    fstp    dword [xSP]
     52    movsd   xmm0, [xSP]
    6353
    6454%else
    65     fld     dword [_BP + _S*2]
     55    fld     dword [xBP + xS*2]
    6656    fabs
    6757%endif
  • trunk/src/VBox/Runtime/common/math/fabsl.asm

    • Property svn:keywords set to Author Date Id Revision
    r8256 r16316  
    1 ; $Id: $
     1; $Id$
    22;; @file
    33; IPRT - No-CRT fabsl - AMD64 & X86.
     
    2929;
    3030
    31 
    3231%include "iprt/asmdefs.mac"
    3332
    3433BEGINCODE
    3534
    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 
    4635;;
    4736; Compute the absolute value of lrd (|lrd|).
    4837; @returns st(0)
    49 ; @param    lrd     [_SP + _S*2]
     38; @param    lrd     [xSP + xS*2]
    5039BEGINPROC RT_NOCRT(fabsl)
    51     push    _BP
    52     mov     _BP, _SP
     40    push    xBP
     41    mov     xBP, xSP
    5342
    54     fld     tword [_BP + _S*2]
     43    fld     tword [xBP + xS*2]
    5544    fabs
    5645
  • trunk/src/VBox/Runtime/common/math/floor.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the largest integral value not greater than rd.
     
    4838; @param    rd      32-bit: [ebp + 8]   64-bit: xmm0
    4939BEGINPROC RT_NOCRT(floor)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    5444%ifdef RT_ARCH_AMD64
    55     movsd   [_SP], xmm0
    56     fld     qword [_SP]
     45    movsd   [xSP], xmm0
     46    fld     qword [xSP]
    5747%else
    58     fld     qword [_BP + _S*2]
     48    fld     qword [xBP + xS*2]
    5949%endif
    6050
    6151    ; Make it round down by modifying the fpu control word.
    62     fstcw   [_BP - 10h]
    63     mov     eax, [_BP - 10h]
     52    fstcw   [xBP - 10h]
     53    mov     eax, [xBP - 10h]
    6454    or      eax, 00400h
    6555    and     eax, 0f7ffh
    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
  • trunk/src/VBox/Runtime/common/math/floorf.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the largest integral value not greater than rf.
     
    4838; @param    rf      32-bit: [ebp + 8]   64-bit: xmm0
    4939BEGINPROC RT_NOCRT(floorf)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    5444%ifdef RT_ARCH_AMD64
    55     movss   [_SP], xmm0
    56     fld     dword [_SP]
     45    movss   [xSP], xmm0
     46    fld     dword [xSP]
    5747%else
    58     fld     dword [_BP + _S*2]
     48    fld     dword [xBP + xS*2]
    5949%endif
    6050
    6151    ; Make it round down by modifying the fpu control word.
    62     fstcw   [_BP - 10h]
    63     mov     eax, [_BP - 10h]
     52    fstcw   [xBP - 10h]
     53    mov     eax, [xBP - 10h]
    6454    or      eax, 00400h
    6555    and     eax, 0f7ffh
    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    dword [_SP]
    77     movss   xmm0, [_SP]
     66    fstp    dword [xSP]
     67    movss   xmm0, [xSP]
    7868%endif
    7969    leave
  • trunk/src/VBox/Runtime/common/math/floorl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the largest integral value not greater than lrd.
     
    4838; @param    lrd     [rbp + 8]
    4939BEGINPROC RT_NOCRT(floorl)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    54     fld     tword [_BP + _S*2]
     44    fld     tword [xBP + xS*2]
    5545
    5646    ; Make it round down by modifying the fpu control word.
    57     fstcw   [_BP - 10h]
    58     mov     eax, [_BP - 10h]
     47    fstcw   [xBP - 10h]
     48    mov     eax, [xBP - 10h]
    5949    or      eax, 00400h
    6050    and     eax, 0f7ffh
    61     mov     [_BP - 08h], eax
    62     fldcw   [_BP - 08h]
     51    mov     [xBP - 08h], eax
     52    fldcw   [xBP - 08h]
    6353
    6454    ; Round ST(0) to integer.
     
    6656
    6757    ; Restore the fpu control word.
    68     fldcw   [_BP - 10h]
     58    fldcw   [xBP - 10h]
    6959
    7060    leave
  • trunk/src/VBox/Runtime/common/math/ldexpl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Computes lrd * 2^exp
    4737; @returns st(0)
    48 ; @param    lrd     [rbp + _S*2]
     38; @param    lrd     [rbp + xS*2]
    4939; @param    exp     [ebp + 14h]  GCC:edi  MSC:ecx
    5040BEGINPROC RT_NOCRT(ldexpl)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 10h
    5444
    5545    ; load exp
     
    5848    fild    dword [rsp]
    5949%else
    60     fild    dword [ebp + _S*2 + RTLRD_CB]
     50    fild    dword [ebp + xS*2 + RTLRD_CB]
    6151%endif
    62     fld     tword [_BP + _S*2]
     52    fld     tword [xBP + xS*2]
    6353    fscale
    6454    fstp    st1
  • trunk/src/VBox/Runtime/common/math/llrint.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Runtime/common/math/llrintf.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Runtime/common/math/llrintl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Round rd to the nearest integer value, rounding according to the current rounding direction.
    4737; @returns 32-bit: edx:eax  64-bit: rax
    48 ; @param    lrd     [rbp + _S*2]
     38; @param    lrd     [rbp + xS*2]
    4939BEGINPROC RT_NOCRT(llrintl)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    54     fld     tword [_BP + _S*2]
    55     fistp   qword [_SP]
     44    fld     tword [xBP + xS*2]
     45    fistp   qword [xSP]
    5646    fwait
    5747%ifdef RT_ARCH_AMD64
    58     mov     rax, [_SP]
     48    mov     rax, [xSP]
    5949%else
    60     mov     eax, [_SP]
    61     mov     edx, [_SP + 4]
     50    mov     eax, [xSP]
     51    mov     edx, [xSP + 4]
    6252%endif
    6353
  • trunk/src/VBox/Runtime/common/math/logl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r16313 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; compute the natural logarithm of lrd
    4737; @returns st(0)
    48 ; @param    lrd     [rbp + _S*2]
     38; @param    lrd     [rbp + xS*2]
    4939BEGINPROC RT_NOCRT(logl)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    5444    fldln2                              ; st0=log(2)
    55     fld     tword [_BP + _S*2]          ; st1=log(2) st0=lrd
     45    fld     tword [xBP + xS*2]          ; st1=log(2) st0=lrd
    5646    fld     st0                         ; st1=log(2) st0=lrd st0=lrd
    5747    fsub    qword [.one xWrtRIP]        ; st2=log(2) st1=lrd st0=lrd-1.0
  • trunk/src/VBox/Runtime/common/math/lrint.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Runtime/common/math/lrintf.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
  • trunk/src/VBox/Runtime/common/math/lrintl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    2929;
    3030
    31 
    3231%include "iprt/asmdefs.mac"
    3332
    3433BEGINCODE
    3534
    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 
    4635;;
    4736; Round rd to the nearest integer value, rounding according to the current rounding direction.
    4837; @returns 32-bit: eax  64-bit: rax
    49 ; @param    lrd     [rbp + _S*2]
     38; @param    lrd     [rbp + xS*2]
    5039BEGINPROC RT_NOCRT(lrintl)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5443
    55     fld     tword [_BP + _S*2]
     44    fld     tword [xBP + xS*2]
    5645%ifdef RT_ARCH_AMD64
    57     fistp   qword [_SP]
     46    fistp   qword [xSP]
    5847    fwait
    59     mov     rax, [_SP]
     48    mov     rax, [xSP]
    6049%else
    61     fistp   dword [_SP]
     50    fistp   dword [xSP]
    6251    fwait
    63     mov     eax, [_SP]
     52    mov     eax, [xSP]
    6453%endif
    6554
  • trunk/src/VBox/Runtime/common/math/remainder.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38 %else
    39  %define _SP esp
    40  %define _BP ebp
    41 %endif
    42 
    4335;;
    4436; See SUS.
     
    4739; @param    rd2    [ebp + 10h]  xmm1
    4840BEGINPROC RT_NOCRT(remainder)
    49     push    _BP
    50     mov     _BP, _SP
    51     sub     _SP, 20h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 20h
    5244;int3
    5345
  • trunk/src/VBox/Runtime/common/math/remainderf.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38 %else
    39  %define _SP esp
    40  %define _BP ebp
    41 %endif
    42 
    4335;;
    4436; See SUS.
     
    4739; @param    rf2    [ebp + 0ch]  xmm1
    4840BEGINPROC RT_NOCRT(remainderf)
    49     push    _BP
    50     mov     _BP, _SP
    51     sub     _SP, 20h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 20h
    5244
    5345%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/math/remainderl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38 %else
    39  %define _SP esp
    40  %define _BP ebp
    41 %endif
    42 
    4335;;
    4436; See SUS.
     
    4739; @param    lrd2    [rbp + 20h]
    4840BEGINPROC RT_NOCRT(remainderl)
    49     push    _BP
    50     mov     _BP, _SP
     41    push    xBP
     42    mov     xBP, xSP
    5143
    5244%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/math/sinl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    2929;
    3030
    31 
    3231%include "iprt/asmdefs.mac"
    3332
    3433BEGINCODE
    3534
    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 
    4635;;
    4736; Compute the sine of lrd
    4837; @returns st(0)
    49 ; @param    lrd     [_SP + _S*2]
     38; @param    lrd     [xSP + xS*2]
    5039BEGINPROC RT_NOCRT(sinl)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5443
    55     fld     tword [_BP + _S*2]
     44    fld     tword [xBP + xS*2]
    5645    fsin
    5746    fnstsw  ax
  • trunk/src/VBox/Runtime/common/math/tanl.asm

    • Property svn:keywords changed from Id to Author Date Id Revision
    r8256 r16316  
    3333BEGINCODE
    3434
    35 %ifdef RT_ARCH_AMD64
    36  %define _SP rsp
    37  %define _BP rbp
    38  %define _S  8
    39 %else
    40  %define _SP esp
    41  %define _BP ebp
    42  %define _S  4
    43 %endif
    44 
    4535;;
    4636; Compute the sine of lrd
    4737; @returns st(0)
    48 ; @param    lrd     [_SP + _S*2]
     38; @param    lrd     [xSP + xS*2]
    4939BEGINPROC RT_NOCRT(tanl)
    50     push    _BP
    51     mov     _BP, _SP
    52     sub     _SP, 10h
     40    push    xBP
     41    mov     xBP, xSP
     42    sub     xSP, 10h
    5343
    54     fld     tword [_BP + _S*2]
     44    fld     tword [xBP + xS*2]
    5545    fptan
    5646    fnstsw  ax
  • 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
  • trunk/src/VBox/Runtime/common/math/truncf.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    rf      32-bit: [ebp + 8]   64-bit: xmm0
    5040BEGINPROC RT_NOCRT(truncf)
    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     movss   [_SP], xmm0
    57     fld     dword [_SP]
     46    movss   [xSP], xmm0
     47    fld     dword [xSP]
    5848%else
    59     fld     dword [_BP + _S*2]
     49    fld     dword [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    dword [_SP]
    77     movss   xmm0, [_SP]
     66    fstp    dword [xSP]
     67    movss   xmm0, [xSP]
    7868%endif
    7969    leave
  • trunk/src/VBox/Runtime/common/math/truncl.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      [rbp + 8]
    5040BEGINPROC RT_NOCRT(truncl)
    51     push    _BP
    52     mov     _BP, _SP
    53     sub     _SP, 10h
     41    push    xBP
     42    mov     xBP, xSP
     43    sub     xSP, 10h
    5444
    55     fld     tword [_BP + _S*2]
     45    fld     tword [xBP + xS*2]
    5646
    5747    ; Make it truncate up by modifying the fpu control word.
    58     fstcw   [_BP - 10h]
    59     mov     eax, [_BP - 10h]
     48    fstcw   [xBP - 10h]
     49    mov     eax, [xBP - 10h]
    6050    or      eax, 00c00h
    61     mov     [_BP - 08h], eax
    62     fldcw   [_BP - 08h]
     51    mov     [xBP - 08h], eax
     52    fldcw   [xBP - 08h]
    6353
    6454    ; Round ST(0) to integer.
     
    6656
    6757    ; Restore the fpu control word.
    68     fldcw   [_BP - 10h]
     58    fldcw   [xBP - 10h]
    6959
    7060    leave
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