VirtualBox

source: vbox/trunk/src/VBox/Runtime/common/compiler/vcc/ftol2-vcc.asm@ 96371

Last change on this file since 96371 was 96371, checked in by vboxsync, 3 years ago

IPRT/nocrt: Cooked up ftol2 and ftol2_sse, stubbed _except_handler4. Both x86 specific. bugref:10261

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1; $Id: ftol2-vcc.asm 96371 2022-08-20 02:29:40Z vboxsync $
2;; @file
3; IPRT - Floating Point to Integer related Visual C++ support routines.
4;
5
6;
7; Copyright (C) 2022 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.215389.xyz. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26
27
28%include "iprt/asmdefs.mac"
29%include "iprt/x86.mac"
30
31
32;;
33; Convert st0 to integer returning it in eax, popping st0.
34;
35; @returns value in eax
36; @param st0 The value to convet. Will be popped.
37; @uses eax, st0, FSW.TOP
38;
39GLOBALNAME_RAW __ftol2_sse_excpt, function, RT_NOTHING
40GLOBALNAME_RAW __ftol2_sse, function, RT_NOTHING ;; @todo kind of expect __ftol2_sse to take input in xmm0 and return in edx:eax.
41BEGINPROC_RAW __ftoi2
42 push ebp
43 mov ebp, esp
44 sub esp, 8h
45 fisttp dword [esp]
46 mov eax, [esp]
47 leave
48 ret
49ENDPROC_RAW __ftoi2
50
51
52;;
53; Convert st0 to integer returning it in edx:eax, popping st0.
54;
55; @returns value in edx:eax
56; @param st0 The value to convet. Will be popped.
57; @uses eax, edx, st0, FSW.TOP
58;
59BEGINPROC_RAW __ftol2
60 push ebp
61 mov ebp, esp
62 sub esp, 8h
63 and esp, 0fffffff8h ; proper alignment.
64 fisttp qword [esp]
65 mov eax, [esp]
66 mov edx, [esp + 8]
67 leave
68 ret
69ENDPROC_RAW __ftol2
70
Note: See TracBrowser for help on using the repository browser.

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