summaryrefslogtreecommitdiff
path: root/CryptoPkg/Library/IntrinsicLib/Ia32/MathFtol.c
blob: adfe249b1d46d4dc2a465ff706e8393446ac5ac3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/** @file
  64-bit Math Worker Function.
  The 32-bit versions of C compiler generate calls to library routines
  to handle 64-bit math. These functions use non-standard calling conventions.

Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

/*
 * Floating point to integer conversion.
 */
__declspec(naked) void
_ftol2 (
  void
  )
{
  _asm {
    fistp qword ptr [esp-8]
    mov   edx, [esp-4]
    mov   eax, [esp-8]
    ret
  }
}

__declspec(naked) void
_ftol2_sse (
  void
  )
{
  _asm {
    fistp dword ptr [esp-4]
    mov   eax,[esp-4]
    ret
  }
}