• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1;*!
2;* \copy
3;*     Copyright (c)  2009-2013, Cisco Systems
4;*     All rights reserved.
5;*
6;*     Redistribution and use in source and binary forms, with or without
7;*     modification, are permitted provided that the following conditions
8;*     are met:
9;*
10;*        * Redistributions of source code must retain the above copyright
11;*          notice, this list of conditions and the following disclaimer.
12;*
13;*        * Redistributions in binary form must reproduce the above copyright
14;*          notice, this list of conditions and the following disclaimer in
15;*          the documentation and/or other materials provided with the
16;*          distribution.
17;*
18;*     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19;*     "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20;*     LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21;*     FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22;*     COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23;*     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24;*     BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25;*     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26;*     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27;*     LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28;*     ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29;*     POSSIBILITY OF SUCH DAMAGE.
30;*
31;*
32;*  memzero.asm
33;*
34;*  Abstract
35;*
36;*
37;*  History
38;*      9/16/2009 Created
39;*
40;*
41;*************************************************************************/
42
43%include "asm_inc.asm"
44;***********************************************************************
45; Code
46;***********************************************************************
47
48SECTION .text
49
50;***********************************************************************
51;void WelsPrefetchZero_mmx(int8_t const*_A);
52;***********************************************************************
53WELS_EXTERN WelsPrefetchZero_mmx
54    %assign  push_num 0
55    LOAD_1_PARA
56    prefetchnta [r0]
57    ret
58
59
60;***********************************************************************
61;   void WelsSetMemZeroAligned64_sse2(void *dst, int32_t size)
62;***********************************************************************
63WELS_EXTERN WelsSetMemZeroAligned64_sse2
64
65    %assign  push_num 0
66    LOAD_2_PARA
67    SIGN_EXTENSION r1, r1d
68    neg     r1
69
70    pxor    xmm0,       xmm0
71.memzeroa64_sse2_loops:
72    movdqa  [r0],       xmm0
73    movdqa  [r0+16],    xmm0
74    movdqa  [r0+32],    xmm0
75    movdqa  [r0+48],    xmm0
76    add     r0, 0x40
77
78    add r1, 0x40
79    jnz near .memzeroa64_sse2_loops
80
81    ret
82
83;***********************************************************************
84;   void WelsSetMemZeroSize64_mmx(void *dst, int32_t size)
85;***********************************************************************
86WELS_EXTERN WelsSetMemZeroSize64_mmx
87
88    %assign  push_num 0
89    LOAD_2_PARA
90    SIGN_EXTENSION r1, r1d
91    neg     r1
92
93    pxor    mm0,        mm0
94.memzero64_mmx_loops:
95    movq    [r0],       mm0
96    movq    [r0+8], mm0
97    movq    [r0+16],    mm0
98    movq    [r0+24],    mm0
99    movq    [r0+32],    mm0
100    movq    [r0+40],    mm0
101    movq    [r0+48],    mm0
102    movq    [r0+56],    mm0
103    add     r0,     0x40
104
105    add r1, 0x40
106    jnz near .memzero64_mmx_loops
107
108    WELSEMMS
109    ret
110
111;***********************************************************************
112;   void WelsSetMemZeroSize8_mmx(void *dst, int32_t size)
113;***********************************************************************
114WELS_EXTERN WelsSetMemZeroSize8_mmx
115
116    %assign  push_num 0
117    LOAD_2_PARA
118    SIGN_EXTENSION r1, r1d
119    neg     r1
120    pxor    mm0,        mm0
121
122.memzero8_mmx_loops:
123    movq    [r0],       mm0
124    add     r0,     0x08
125
126    add     r1,     0x08
127    jnz near .memzero8_mmx_loops
128
129    WELSEMMS
130    ret
131
132
133