<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><div> </div><div><br></div>At 2015-03-07 08:11:06,dave <dtyx265@gmail.com> wrote:<br> <blockquote id="isReplyContent" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
  
    
  
  
    <div class="moz-cite-prefix">On 03/06/2015 04:06 PM, chen wrote:<br>
    </div>
    <blockquote cite="mid:1ea34597.15a.14bf18e2c71.Coremail.chenm003@163.com" type="cite">
      <div style="color: rgb(0, 0, 0); line-height: 1.7; font-family: arial; font-size: 14px;">
        <div> </div>
        <pre>At 2015-03-07 07:58:13,dave <a class="moz-txt-link-rfc2396E" href="mailto:dtyx265@gmail.com"><dtyx265@gmail.com></a> wrote:
>On 03/06/2015 05:07 PM, Min Chen wrote:
>> # HG changeset patch
>> # User Min Chen <a class="moz-txt-link-rfc2396E" href="mailto:chenm003@163.com"><chenm003@163.com></a>
>> # Date 1425690429 28800
>> # Node ID 63d132c844b9d299081b40e7589275b78fe71093
>> # Parent  043c2418864b0a3ada6f597e6def6ead73d90b5f
>> asm: improve on intra_dc32
>> ---
>>   source/common/x86/intrapred8.asm |   71 ++++++++++++--------------------------
>>   1 files changed, 22 insertions(+), 49 deletions(-)
>>
>> diff -r 043c2418864b -r 63d132c844b9 source/common/x86/intrapred8.asm
>> --- a/source/common/x86/intrapred8.asm       Fri Mar 06 13:15:55 2015 -0600
>> +++ b/source/common/x86/intrapred8.asm       Fri Mar 06 17:07:09 2015 -0800
>> @@ -524,15 +524,21 @@
>>       pshuflw         m1,            m1, 0x00       ; m1 = byte [dc_val ...]
>>       pshufd          m1,            m1, 0x00
>>   
>> +    lea             r2,            [r0 + r1 * 2]
>>   %assign x 0
>> -%rep 16
>> +%rep 8
>>       ; store DC 16x16
>>       movu            [r0],               m1
>> +    movu            [r0 + 16],          m1
>>       movu            [r0 + r1],          m1
>> -    movu            [r0 + 16],          m1
>>       movu            [r0 + r1 + 16],     m1
>> -%if x < 16
>> -    lea             r0,            [r0 + 2 * r1]
>> +    movu            [r2],               m1
>> +    movu            [r2 + 16],          m1
>> +    movu            [r2 + r1],          m1
>> +    movu            [r2 + r1 + 16],     m1
>> +%if x < 8
>> +    lea             r0,            [r0 + 4 * r1]
>> +    lea             r2,            [r2 + 4 * r1]
>All this does is trade 15 "lea r0..." for 7 "lea r0..." and 8 "lea r2..."
>
>./test/TestBench --testbench intrapred | grep intra_dc_32x32
>intra_dc_32x32[f=0]    4.45x      1680.01       7475.13
>
>and the original code.
>
>./test/TestBench --testbench intrapred | grep intra_dc_32x32
>intra_dc_32x32[f=0]    4.53x      1650.03       7475.56
</pre>
        <pre>I have verify before upload, on my Haswell PC, it faster ~1.5%, the two of LEA dispatch to Port1 and Port5</pre>
        <pre> </pre>
      </div>
    </blockquote>
    Yes, but anyone running a haswell isn't going to bother with sse2
    assembler.  On my old athlon 64 this runs slower.  The sse4
    assembler could probably use r2 though.<br>
    <blockquote cite="mid:1ea34597.15a.14bf18e2c71.Coremail.chenm003@163.com" type="cite">Agree, it is just a little improve on Intel CPU, we may keep old SSE2 code</blockquote></blockquote></div>