1 #------------------------------------------------------------------------------
3 # Copyright (c) 2006 - 2009, Intel Corporation
4 # All rights reserved. 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.
22 #------------------------------------------------------------------------------
23 #------------------------------------------------------------------------------
31 #------------------------------------------------------------------------------
32 ASM_GLOBAL ASM_PFX(InternalMemSetMem)
33 ASM_PFX(InternalMemSetMem):
36 pushq %rcx # push Buffer
37 movq %r8, %rax # rax = Value
38 andq $0xff, %rax # rax = lower 8 bits of r8, upper 56 bits are 0
39 movb %al, %ah # ah = al
40 movw %ax, %bx # bx = ax
41 shlq $0x10, %rax # rax = ax << 16
42 movw %bx, %ax # ax = bx
43 movq %rax, %rbx # ebx = eax
44 shlq $0x20, %rax # rax = rax << 32
45 orq %rbx, %rax # eax = ebx
46 movq %rcx, %rdi # rdi = Buffer
47 movq %rdx, %rcx # rcx = Count
48 shrq $3, %rcx # rcx = rcx / 8
51 movq %rdx, %rcx # rcx = rdx
52 andq $7, %rcx # rcx = rcx & 7
54 popq %rax # rax = Buffer