1 ;------------------------------------------------------------------------------
3 ;* Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
4 ;* This program and the accompanying materials
5 ;* are licensed and made available under the terms and conditions of the BSD License
6 ;* which accompanies this distribution. The full text of the license may be found at
7 ;* http://opensource.org/licenses/bsd-license.php
9 ;* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 ;* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 ;------------------------------------------------------------------------------
20 ; Float control word initial value:
21 ; all exceptions masked, double-precision, round-to-nearest
23 mFpuControlWord DW 027Fh
25 ; Multimedia-extensions control word:
26 ; all exceptions masked, round-to-nearest, flush to zero for masked underflow
28 mMmxControlWord DD 01F80h
34 ; Initializes floating point units for requirement of UEFI specification.
36 ; This function initializes floating-point control word to 0x027F (all exceptions
37 ; masked,double-precision, round-to-nearest) and multimedia-extensions control word
38 ; (if supported) to 0x1F80 (all exceptions masked, round-to-nearest, flush to zero
39 ; for masked underflow).
41 InitializeFloatingPointUnits PROC PUBLIC
46 ; Initialize floating point units
52 ; Use CpuId instructuion (CPUID.01H:EDX.SSE[bit 25] = 1) to test
53 ; whether the processor supports SSE instruction.
61 ; Set OSFXSR bit 9 in CR4
68 ; The processor should support SSE instruction and we can use
71 ldmxcsr mMmxControlWord
77 InitializeFloatingPointUnits ENDP