2013-12-09 13:51:09 +01:00
|
|
|
;*!
|
|
|
|
;* \copy
|
|
|
|
;* Copyright (c) 2009-2013, Cisco Systems
|
|
|
|
;* All rights reserved.
|
|
|
|
;*
|
|
|
|
;* Redistribution and use in source and binary forms, with or without
|
|
|
|
;* modification, are permitted provided that the following conditions
|
|
|
|
;* are met:
|
|
|
|
;*
|
|
|
|
;* * Redistributions of source code must retain the above copyright
|
|
|
|
;* notice, this list of conditions and the following disclaimer.
|
|
|
|
;*
|
|
|
|
;* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
;* notice, this list of conditions and the following disclaimer in
|
|
|
|
;* the documentation and/or other materials provided with the
|
|
|
|
;* distribution.
|
|
|
|
;*
|
|
|
|
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
;* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
;* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
;* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
;* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
;* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
;* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
;* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
;* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
;*
|
|
|
|
;*
|
|
|
|
;* memzero.asm
|
|
|
|
;*
|
|
|
|
;* Abstract
|
2014-01-05 13:16:22 +01:00
|
|
|
;*
|
2013-12-09 13:51:09 +01:00
|
|
|
;*
|
|
|
|
;* History
|
|
|
|
;* 9/16/2009 Created
|
|
|
|
;*
|
|
|
|
;*
|
|
|
|
;*************************************************************************/
|
|
|
|
|
|
|
|
%include "asm_inc.asm"
|
|
|
|
;***********************************************************************
|
|
|
|
; Code
|
|
|
|
;***********************************************************************
|
|
|
|
|
2014-01-05 13:16:22 +01:00
|
|
|
SECTION .text
|
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
ALIGN 16
|
|
|
|
;***********************************************************************
|
2014-03-09 11:29:34 +01:00
|
|
|
;void WelsPrefetchZero_mmx(int8_t const*_A);
|
2013-12-09 13:51:09 +01:00
|
|
|
;***********************************************************************
|
|
|
|
WELS_EXTERN WelsPrefetchZero_mmx
|
|
|
|
WelsPrefetchZero_mmx:
|
2014-01-03 07:49:45 +01:00
|
|
|
%assign push_num 0
|
|
|
|
LOAD_1_PARA
|
|
|
|
prefetchnta [r0]
|
2014-01-05 13:16:22 +01:00
|
|
|
ret
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
ALIGN 16
|
|
|
|
;***********************************************************************
|
|
|
|
; void WelsSetMemZeroAligned64_sse2(void *dst, int32_t size)
|
|
|
|
;***********************************************************************
|
|
|
|
WELS_EXTERN WelsSetMemZeroAligned64_sse2
|
|
|
|
WelsSetMemZeroAligned64_sse2:
|
2013-12-13 09:06:44 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
%assign push_num 0
|
|
|
|
LOAD_2_PARA
|
2014-03-14 09:13:18 +01:00
|
|
|
SIGN_EXTENSION r1, r1d
|
2014-01-03 07:49:45 +01:00
|
|
|
neg r1
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
pxor xmm0, xmm0
|
|
|
|
.memzeroa64_sse2_loops:
|
2014-01-03 07:49:45 +01:00
|
|
|
movdqa [r0], xmm0
|
|
|
|
movdqa [r0+16], xmm0
|
|
|
|
movdqa [r0+32], xmm0
|
|
|
|
movdqa [r0+48], xmm0
|
|
|
|
add r0, 0x40
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
add r1, 0x40
|
2013-12-09 13:51:09 +01:00
|
|
|
jnz near .memzeroa64_sse2_loops
|
2014-01-05 13:16:22 +01:00
|
|
|
|
|
|
|
ret
|
2013-12-09 13:51:09 +01:00
|
|
|
|
|
|
|
ALIGN 16
|
|
|
|
;***********************************************************************
|
|
|
|
; void WelsSetMemZeroSize64_mmx(void *dst, int32_t size)
|
|
|
|
;***********************************************************************
|
|
|
|
WELS_EXTERN WelsSetMemZeroSize64_mmx
|
|
|
|
WelsSetMemZeroSize64_mmx:
|
2013-12-13 09:06:44 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
%assign push_num 0
|
|
|
|
LOAD_2_PARA
|
2014-03-14 09:13:18 +01:00
|
|
|
SIGN_EXTENSION r1, r1d
|
2014-01-03 07:49:45 +01:00
|
|
|
neg r1
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
pxor mm0, mm0
|
|
|
|
.memzero64_mmx_loops:
|
2014-01-03 07:49:45 +01:00
|
|
|
movq [r0], mm0
|
|
|
|
movq [r0+8], mm0
|
|
|
|
movq [r0+16], mm0
|
|
|
|
movq [r0+24], mm0
|
|
|
|
movq [r0+32], mm0
|
|
|
|
movq [r0+40], mm0
|
|
|
|
movq [r0+48], mm0
|
2014-01-05 13:16:22 +01:00
|
|
|
movq [r0+56], mm0
|
2014-01-03 07:49:45 +01:00
|
|
|
add r0, 0x40
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
add r1, 0x40
|
2013-12-09 13:51:09 +01:00
|
|
|
jnz near .memzero64_mmx_loops
|
2014-01-05 13:16:22 +01:00
|
|
|
|
|
|
|
WELSEMMS
|
|
|
|
ret
|
|
|
|
|
|
|
|
ALIGN 16
|
2013-12-09 13:51:09 +01:00
|
|
|
;***********************************************************************
|
|
|
|
; void WelsSetMemZeroSize8_mmx(void *dst, int32_t size)
|
|
|
|
;***********************************************************************
|
|
|
|
WELS_EXTERN WelsSetMemZeroSize8_mmx
|
|
|
|
WelsSetMemZeroSize8_mmx:
|
2013-12-13 09:06:44 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
%assign push_num 0
|
|
|
|
LOAD_2_PARA
|
2014-03-14 09:13:18 +01:00
|
|
|
SIGN_EXTENSION r1, r1d
|
2014-01-05 13:16:22 +01:00
|
|
|
neg r1
|
2014-01-03 07:49:45 +01:00
|
|
|
pxor mm0, mm0
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2013-12-09 13:51:09 +01:00
|
|
|
.memzero8_mmx_loops:
|
2014-01-03 07:49:45 +01:00
|
|
|
movq [r0], mm0
|
|
|
|
add r0, 0x08
|
2014-01-05 13:16:22 +01:00
|
|
|
|
2014-01-03 07:49:45 +01:00
|
|
|
add r1, 0x08
|
2013-12-09 13:51:09 +01:00
|
|
|
jnz near .memzero8_mmx_loops
|
|
|
|
|
2014-01-05 13:16:22 +01:00
|
|
|
WELSEMMS
|
|
|
|
ret
|
|
|
|
|
|
|
|
|