2 # ConvertAsm.py: Automatically generated from SetMem.asm
4 #------------------------------------------------------------------------------
6 # Copyright (c) 2006 - 2009, 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 ASM_GLOBAL ASM_PFX(InternalMemSetMem)
38 ASM_PFX(InternalMemSetMem):
40 movq %rcx, %rdi # rdi <- Buffer
41 movb %r8b, %al # al <- Value
42 movq %rdi, %r9 # r9 <- Buffer as return value
45 andq $15, %rcx # rcx + rdi aligns on 16-byte boundary
56 movb %al, %ah # ax <- Value repeats twice
57 movdqa %xmm0, 0x10(%rsp) # save xmm0
58 movd %eax, %xmm0 # xmm0[0..16] <- Value repeats twice
59 pshuflw $0, %xmm0, %xmm0 # xmm0[0..63] <- Value repeats 8 times
60 movlhps %xmm0, %xmm0 # xmm0 <- Value repeats 16 times
62 movntdq %xmm0, (%rdi) # rdi should be 16-byte aligned
66 movdqa 0x10(%rsp), %xmm0 # restore xmm0
68 movl %edx, %ecx # high 32 bits of rcx are always zero
70 movq %r9, %rax # rax <- Return value