]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Main/Ia32/fpu_rmode.asm
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / StdLib / LibC / Main / Ia32 / fpu_rmode.asm
CommitLineData
2aa62f2b 1;------------------------------------------------------------------------------\r
2; Return the current FPU rounding mode.\r
3;\r
4; MASM implementation of the flt_rounds function by:\r
5; J.T. Conklin, Apr 4, 1995\r
6; Public domain.\r
7;\r
8; Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
9; This program and the accompanying materials\r
10; are licensed and made available under the terms and conditions of the BSD License\r
11; which accompanies this distribution. The full text of the license may be found at\r
12; http://opensource.org/licenses/bsd-license.php.\r
13;\r
14; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16;\r
17; NetBSD: flt_rounds.S,v 1.6 1999/08/23 08:45:09 kleink Exp\r
18;------------------------------------------------------------------------------\r
19\r
20 .686\r
21 .model flat,C\r
22 .code\r
23\r
24;_map BYTE 1 ; round to nearest\r
25; BYTE 3 ; round to negative infinity\r
26; BYTE 2 ; round to positive infinity\r
27; BYTE 0 ; round to zero\r
28\r
29;------------------------------------------------------------------------------\r
30; int\r
31; EFIAPI\r
32; fpu_rmode( void );\r
33;\r
34;------------------------------------------------------------------------------\r
35\r
36internal_FPU_rmode PROC\r
37 sub esp, 4 ; Create a local variable for fnstcw\r
38 fnstcw [esp]\r
39 mov eax, [esp]\r
40 shr eax, 10\r
41 and eax, 3\r
42 add esp, 4 ; Delete the local variable\r
43 ret\r
44internal_FPU_rmode ENDP\r
45\r
46 END\r