1 ;------------------------------------------------------------------------------
3 ; Copyright (c) 2014, 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.
14 ; Provide macro for register save/restore using SSE registers
16 ;------------------------------------------------------------------------------
19 ; Define SSE instruction set
23 ; Define SSE macros using SSE 4.1 instructions
25 SXMMN MACRO XMM, IDX, REG
26 pinsrd XMM, REG, (IDX AND 3)
29 LXMMN MACRO XMM, REG, IDX
30 pextrd REG, XMM, (IDX AND 3)
34 ; Define SSE macros using SSE 2 instructions
36 SXMMN MACRO XMM, IDX, REG
37 pinsrw XMM, REG, (IDX AND 3) * 2
39 pinsrw XMM, REG, (IDX AND 3) * 2 + 1
43 LXMMN MACRO XMM, REG, IDX
44 pshufd XMM, XMM, (0E4E4E4h SHR (IDX * 2)) AND 0FFh
46 pshufd XMM, XMM, (0E4E4E4h SHR (IDX * 2 + (IDX AND 1) * 4)) AND 0FFh