+++ /dev/null
-;------------------------------------------------------------------------------\r
-; Return the current FPU rounding mode.\r
-;\r
-; MASM implementation of the flt_rounds function from NetBSD.\r
-;\r
-; Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
-; This program and the accompanying materials\r
-; are licensed and made available under the terms and conditions of the BSD License\r
-; which accompanies this distribution. The full text of the license may be found at\r
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
- .code\r
-\r
-;_map BYTE 1 ; round to nearest\r
-; BYTE 3 ; round to negative infinity\r
-; BYTE 2 ; round to positive infinity\r
-; BYTE 0 ; round to zero\r
-\r
-;------------------------------------------------------------------------------\r
-; int\r
-; EFIAPI\r
-; fpu_rmode( void );\r
-;\r
-; VC++ always creates space for 4 parameters on the stack, whether they are\r
-; used or not. We use one for temporary storage since the only variant of\r
-; fnstcw saves to memory, NOT a register.\r
-;------------------------------------------------------------------------------\r
-internal_FPU_rmode PROC\r
- fnstcw [rsp + 8] ; save 16-bit FPU Control Word\r
- mov eax, [rsp + 8] ; get the saved FPU Control Word\r
- shr eax, 10\r
- and rax, 3 ; index is only the LSB two bits in RAX\r
- ret ; Return rounding mode in RAX\r
-internal_FPU_rmode ENDP\r
-\r
- END\r