Changeset 16316 in vbox for trunk/src/VBox/Runtime/common/math/trunc.asm
- Timestamp:
- Jan 28, 2009 2:26:48 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 42148
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/math/trunc.asm
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r8256 r16316 34 34 BEGINCODE 35 35 36 %ifdef RT_ARCH_AMD6437 %define _SP rsp38 %define _BP rbp39 %define _S 840 %else41 %define _SP esp42 %define _BP ebp43 %define _S 444 %endif45 46 36 ;; 47 37 ; Round to truncated integer value. … … 49 39 ; @param rd 32-bit: [ebp + 8] 64-bit: xmm0 50 40 BEGINPROC RT_NOCRT(trunc) 51 push _BP52 mov _BP, _SP53 sub _SP, 10h41 push xBP 42 mov xBP, xSP 43 sub xSP, 10h 54 44 55 45 %ifdef RT_ARCH_AMD64 56 movsd [ _SP], xmm057 fld qword [ _SP]46 movsd [xSP], xmm0 47 fld qword [xSP] 58 48 %else 59 fld qword [ _BP + _S*2]49 fld qword [xBP + xS*2] 60 50 %endif 61 51 62 52 ; 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] 65 55 or eax, 00c00h 66 mov [ _BP - 08h], eax67 fldcw [ _BP - 08h]56 mov [xBP - 08h], eax 57 fldcw [xBP - 08h] 68 58 69 59 ; Round ST(0) to integer. … … 71 61 72 62 ; Restore the fpu control word. 73 fldcw [ _BP - 10h]63 fldcw [xBP - 10h] 74 64 75 65 %ifdef RT_ARCH_AMD64 76 fstp qword [ _SP]77 movsd xmm0, [ _SP]66 fstp qword [xSP] 67 movsd xmm0, [xSP] 78 68 %endif 79 69 leave -
Property svn:keywords
changed from
Note:
See TracChangeset
for help on using the changeset viewer.