Home | History | Annotate | Download | only in Ia32
      1 #------------------------------------------------------------------------------
      2 #
      3 # Copyright (c) 2006, 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.
      8 #
      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.
     11 #
     12 # Module Name:
     13 #
     14 #   SetMem16.asm
     15 #
     16 # Abstract:
     17 #
     18 #   SetMem16 function
     19 #
     20 # Notes:
     21 #
     22 #------------------------------------------------------------------------------
     23 
     24 ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
     25 
     26 #------------------------------------------------------------------------------
     27 #  VOID *
     28 #  InternalMemSetMem16 (
     29 #    IN VOID   *Buffer,
     30 #    IN UINTN  Count,
     31 #    IN UINT16 Value
     32 #    )
     33 #------------------------------------------------------------------------------
     34 ASM_PFX(InternalMemSetMem16):
     35     push    %edi
     36     movl    16(%esp), %eax
     37     shrdl   $16, %eax, %edx
     38     shldl   $16, %edx, %eax
     39     movl    12(%esp), %edx
     40     movl    8(%esp), %edi
     41     movl    %edx, %ecx
     42     andl    $3, %edx
     43     shrl    $2, %ecx
     44     jz      L1
     45     movd    %eax, %mm0
     46     movd    %eax, %mm1
     47     psllq   $32, %mm0
     48     por     %mm1, %mm0
     49 L0:
     50     movq    %mm0, (%edi)
     51     addl    $8, %edi
     52     loop    L0
     53 L1:
     54     movl    %edx, %ecx
     55     rep
     56     stosw
     57     movl    8(%esp), %eax
     58     pop     %edi
     59     ret
     60