SetMem16.S 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #
  2. # ConvertAsm.py: Automatically generated from SetMem16.asm
  3. #
  4. #------------------------------------------------------------------------------
  5. #
  6. # Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
  7. # 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.
  11. #
  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.
  14. #
  15. # Module Name:
  16. #
  17. # SetMem16.S
  18. #
  19. # Abstract:
  20. #
  21. # SetMem16 function
  22. #
  23. # Notes:
  24. #
  25. #------------------------------------------------------------------------------
  26. #------------------------------------------------------------------------------
  27. # VOID *
  28. # EFIAPI
  29. # InternalMemSetMem16 (
  30. # IN VOID *Buffer,
  31. # IN UINTN Count,
  32. # IN UINT16 Value
  33. # )
  34. #------------------------------------------------------------------------------
  35. ASM_GLOBAL ASM_PFX(InternalMemSetMem16)
  36. ASM_PFX(InternalMemSetMem16):
  37. pushq %rdi
  38. movq %rcx, %rdi
  39. movq %rdi, %r9
  40. xorq %rcx, %rcx
  41. subq %rdi, %rcx
  42. andq $15, %rcx
  43. movq %r8, %rax
  44. jz L0
  45. shrq $1, %rcx
  46. cmpq %rdx, %rcx
  47. cmova %rdx, %rcx
  48. subq %rcx, %rdx
  49. rep stosw
  50. L0:
  51. movq %rdx, %rcx
  52. andl $7, %edx
  53. shrq $3, %rcx
  54. jz L_SetWords
  55. movd %eax, %xmm0
  56. pshuflw $0, %xmm0, %xmm0
  57. movlhps %xmm0, %xmm0
  58. L1:
  59. movntdq %xmm0, (%rdi)
  60. addq $16, %rdi
  61. loop L1
  62. mfence
  63. L_SetWords:
  64. movl %edx, %ecx
  65. rep stosw
  66. movq %r9, %rax
  67. popq %rdi
  68. ret