1;------------------------------------------------------------------------------
3; Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
4; SPDX-License-Identifier: BSD-2-Clause-Patent
8; Provide macro
for register save/restore
using SSE registers
10;------------------------------------------------------------------------------
13; Define SSE instruction set
17; Define SSE macros
using SSE 4.1 instructions
18; args 1:XMM, 2:IDX, 3:REG
20 pinsrd %1, %3, (%2 & 3)
24;args 1:XMM, 2:REG, 3:IDX
27 pextrd %2, %1, (%3 & 3)
31; Define SSE macros
using SSE 2 instructions
32; args 1:XMM, 2:IDX, 3:REG
34 pinsrw %1, %3, (%2 & 3) * 2
36 pinsrw %1, %3, (%2 & 3) * 2 + 1
41;args 1:XMM, 2:REG, 3:IDX
44 pshufd %1, %1, ((0E4E4E4h >> (%3 * 2)) & 0FFh)
46 pshufd %1, %1, ((0E4E4E4h >> (%3 * 2 + (%3 & 1) * 4)) & 0FFh)
51; XMM7 to save/restore EBP - slot 0, EBX - slot 1, ESI - slot 2, EDI - slot 3
70; XMM6 to save/restore ESP - slot 0, EAX - slot 1, EDX - slot 2, ECX - slot 3
105; XMM5 slot 0
for calling stack
108 mov esi, %%ReturnAddress
121; XMM5 slot 1
for uCode status
123%macro LOAD_UCODE_STATUS 0
127%macro SAVE_UCODE_STATUS 0
132; XMM5 slot 2
for TemporaryRamSize
134%macro LOAD_TEMPORARY_RAM_SIZE 1
138%macro SAVE_TEMPORARY_RAM_SIZE 1
149 ; Float control word initial value:
150 ; all exceptions masked,
double-precision, round-to-nearest
152FpuControlWord DW 027Fh
154 ; Multimedia-extensions control word:
155 ; all exceptions masked, round-to-nearest, flush to zero
for masked underflow
157MmxControlWord DD 01F80h
160 ; Processor has to support SSE
165 fldcw [FpuControlWord]
168 ; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
169 ; whether the processor supports SSE instruction.
187 ; Restore EBX from MM2
192 ;
Set OSFXSR bit (bit
#9) & OSXMMEXCPT bit (bit #10)
199 ; The processor should support SSE instruction and we can use
200 ; ldmxcsr instruction
202 ldmxcsr [MmxControlWord]
EFI_STATUS EFIAPI Set(IN EMBEDDED_GPIO *This, IN EMBEDDED_GPIO_PIN Gpio, IN EMBEDDED_GPIO_MODE Mode)
STATIC RETURN_STATUS Initialize(VOID)