2 # ConvertAsm.py: Automatically generated from SetMem.asm
4 #------------------------------------------------------------------------------
6 # Copyright (c) 2006, Intel Corporation
7 # All rights reserved. This program and the accompanying materials
8 # are licensed and made available under the terms and conditions of the BSD License
9 # which accompanies this distribution. The full text of the license may be found at
10 # http://opensource.org/licenses/bsd-license.php
12 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
25 #------------------------------------------------------------------------------
28 #------------------------------------------------------------------------------
36 #------------------------------------------------------------------------------
37 .intel_syntax noprefix
38 .globl ASM_PFX(InternalMemSetMem)
39 ASM_PFX(InternalMemSetMem):
41 mov rdi, rcx # rdi <- Buffer
42 mov al, r8b # al <- Value
43 mov r9, rdi # r9 <- Buffer as return value
46 and rcx, 15 # rcx + rdi aligns on 16-byte boundary
57 mov ah, al # ax <- Value repeats twice
58 movdqa [rsp + 0x10], xmm0 # save xmm0
59 movd xmm0, eax # xmm0[0..16] <- Value repeats twice
60 pshuflw xmm0, xmm0, 0 # xmm0[0..63] <- Value repeats 8 times
61 movlhps xmm0, xmm0 # xmm0 <- Value repeats 16 times
63 movntdq [rdi], xmm0 # rdi should be 16-byte aligned
67 movdqa xmm0, [rsp + 0x10] # restore xmm0
69 mov ecx, edx # high 32 bits of rcx are always zero
71 mov rax, r9 # rax <- Return value