[cvs] / xvidcore / src / bitstream / x86_asm / cbp_sse2.asm Repository:
ViewVC logotype

Diff of /xvidcore/src/bitstream/x86_asm/cbp_sse2.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.2.2, Mon Nov 3 15:51:50 2003 UTC revision 1.14, Wed Sep 16 17:07:58 2009 UTC
# Line 24  Line 24 
24  ; *  ; *
25  ; ***************************************************************************/  ; ***************************************************************************/
26    
 BITS 32  
   
27  ;=============================================================================  ;=============================================================================
28  ; Macros  ; Macros
29  ;=============================================================================  ;=============================================================================
30    
31  %macro cglobal 1  %include "nasm.inc"
         %ifdef PREFIX  
                 global _%1  
                 %define %1 _%1  
         %else  
                 global %1  
         %endif  
 %endmacro  
32    
33  %macro LOOP_SSE2 1  %macro LOOP_SSE2 2
34    movdqa xmm0, [edx+(%1)*128]    movdqa xmm0, [%2+(%1)*128]
35    pand xmm0, xmm7    pand xmm0, xmm3
36    movdqa xmm1, [edx+(%1)*128+16]    movdqa xmm1, [%2+(%1)*128+16]
37    
38    por xmm0, [edx+(%1)*128+32]    por xmm0, [%2+(%1)*128+32]
39    por xmm1, [edx+(%1)*128+48]    por xmm1, [%2+(%1)*128+48]
40    por xmm0, [edx+(%1)*128+64]    por xmm0, [%2+(%1)*128+64]
41    por xmm1, [edx+(%1)*128+80]    por xmm1, [%2+(%1)*128+80]
42    por xmm0, [edx+(%1)*128+96]    por xmm0, [%2+(%1)*128+96]
43    por xmm1, [edx+(%1)*128+112]    por xmm1, [%2+(%1)*128+112]
44    
45    por xmm0, xmm1        ; xmm0 = xmm1 = 128 bits worth of info    por xmm0, xmm1        ; xmm0 = xmm1 = 128 bits worth of info
46    psadbw xmm0, xmm6     ; contains 2 dwords with sums    psadbw xmm0, xmm2     ; contains 2 dwords with sums
47    movhlps xmm1, xmm0    ; move high dword from xmm0 to low xmm1    movhlps xmm1, xmm0    ; move high dword from xmm0 to low xmm1
48    por xmm0, xmm1        ; combine    por xmm0, xmm1        ; combine
49    movd ecx, xmm0        ; if ecx set, values were found    movd ecx, xmm0        ; if ecx set, values were found
50    test ecx, ecx    test _ECX, _ECX
51  %endmacro  %endmacro
52    
53  ;=============================================================================  ;=============================================================================
54  ; Data (Read Only)  ; Data (Read Only)
55  ;=============================================================================  ;=============================================================================
56    
57  %ifdef FORMAT_COFF  DATA
 SECTION .rodata data  
 %else  
 SECTION .rodata data align=16  
 %endif  
58    
59  ALIGN 16  ALIGN SECTION_ALIGN
60  ignore_dc:  ignore_dc:
61    dw 0, -1, -1, -1, -1, -1, -1, -1    dw 0, -1, -1, -1, -1, -1, -1, -1
62    
# Line 77  Line 64 
64  ; Code  ; Code
65  ;=============================================================================  ;=============================================================================
66    
67  SECTION .text  TEXT
68    
69  ;-----------------------------------------------------------------------------  ;-----------------------------------------------------------------------------
70  ; uint32_t calc_cbp_sse2(const int16_t coeff[6*64]);  ; uint32_t calc_cbp_sse2(const int16_t coeff[6*64]);
71  ;-----------------------------------------------------------------------------  ;-----------------------------------------------------------------------------
72    
73  ALIGN 16  ALIGN SECTION_ALIGN
74  cglobal calc_cbp_sse2  cglobal calc_cbp_sse2
75  calc_cbp_sse2:  calc_cbp_sse2:
76    mov edx, [esp+4]         ; coeff[]    mov _EDX, prm1           ; coeff[]
77    xor eax, eax             ; cbp = 0    xor _EAX, _EAX           ; cbp = 0
78    
79    movdqu xmm7, [ignore_dc] ; mask to ignore dc value    movdqu xmm3, [ignore_dc] ; mask to ignore dc value
80    pxor xmm6, xmm6          ; zero    pxor xmm2, xmm2          ; zero
81    
82    LOOP_SSE2 0    LOOP_SSE2 0, _EDX
   test ecx, ecx  
83    jz .blk2    jz .blk2
84    or eax, (1<<5)    or _EAX, (1<<5)
85    
86  .blk2  .blk2:
87    LOOP_SSE2 1    LOOP_SSE2 1, _EDX
   test ecx, ecx  
88    jz .blk3    jz .blk3
89    or eax, (1<<4)    or _EAX, (1<<4)
90    
91  .blk3  .blk3:
92    LOOP_SSE2 2    LOOP_SSE2 2, _EDX
   test ecx, ecx  
93    jz .blk4    jz .blk4
94    or eax, (1<<3)    or _EAX, (1<<3)
95    
96  .blk4  .blk4:
97    LOOP_SSE2 3    LOOP_SSE2 3, _EDX
   test ecx, ecx  
98    jz .blk5    jz .blk5
99    or eax, (1<<2)    or _EAX, (1<<2)
100    
101  .blk5  .blk5:
102    LOOP_SSE2 4    LOOP_SSE2 4, _EDX
   test ecx, ecx  
103    jz .blk6    jz .blk6
104    or eax, (1<<1)    or _EAX, (1<<1)
105    
106  .blk6  .blk6:
107    LOOP_SSE2 5    LOOP_SSE2 5, _EDX
   test ecx, ecx  
108    jz .finished    jz .finished
109    or eax, (1<<0)    or _EAX, (1<<0)
110    
111    .finished:
112    
 .finished  
113          ret          ret
114    ENDFUNC
115    
116    NON_EXEC_STACK

Legend:
Removed from v.1.3.2.2  
changed lines
  Added in v.1.14

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4