<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 04/28/2015 06:38 PM, chen wrote:<br>
    </div>
    <blockquote
      cite="mid:74e50a4b.32f.14d02d2fd55.Coremail.chenm003@163.com"
      type="cite">
      <div
        style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">
        <div> </div>
        <div><br>
        </div>
        在 2015-04-29 09:30:36,dave <a class="moz-txt-link-rfc2396E" href="mailto:dtyx265@gmail.com"><dtyx265@gmail.com></a> 写道:<br>
        <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex;
          MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
          <div class="moz-cite-prefix">On 04/28/2015 06:13 PM, chen
            wrote:<br>
          </div>
          <blockquote
            cite="mid:253231da.2ae.14d02bc27ab.Coremail.chenm003@163.com"
            type="cite">
            <div style="FONT-SIZE: 14px; COLOR: #000000; LINE-HEIGHT:
              1.7; FONT-FAMILY: arial">
              <div><br>
              </div>
              在 2015-04-29 07:49:46,dave <a moz-do-not-send="true"
                class="moz-txt-link-rfc2396E"
                href="mailto:dtyx265@gmail.com"><dtyx265@gmail.com></a>
              写道:<br>
              <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex;
                MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
                <div class="moz-cite-prefix">On 04/28/2015 03:32 PM,
                  chen wrote:<br>
                </div>
                <blockquote
                  cite="mid:61748dfc.16c.14d0228e5d2.Coremail.chenm003@163.com"
                  type="cite">
                  <div style="FONT-SIZE: 14px; COLOR: #000000;
                    LINE-HEIGHT: 1.7; FONT-FAMILY: arial">
                    <div>Most part are fine now, just modify about r5,
                      see below comment</div>
                    <div><br>
                    </div>
                    <pre>At 2015-04-29 06:27:27,<a class="moz-txt-link-abbreviated" href="mailto:dtyx265@gmail.com" moz-do-not-send="true">dtyx265@gmail.com</a> wrote:
># HG changeset patch
># User David T Yuen <a href="mailto:dtyx265@gmail.com%3E%3E#%A0Date%A01430259967%A025200%3E#%A0Node%A0ID%A06108fbda1be654a481a78f7ef593518033919674%3E#%A0Parent%A0%A0e9df93f380664932e7d6c7e85b2cae16cd5e1dcd%3Easm:%A0interp_8tap_horiz%A0pp%A0and%A0ps%A0sse2%3E%3EThis%A0replaces%A0c%A0code%A0and%A0covers%3E" moz-do-not-send="true">dtyx265@gmail.com>
># Date 1430259967 25200
># Node ID 6108fbda1be654a481a78f7ef593518033919674
># Parent  e9df93f380664932e7d6c7e85b2cae16cd5e1dcd
>asm: interp_8tap_horiz pp and ps sse2
>
>This replaces c code and covers
>
</a>+;----------------------------------------------------------------------------------------------------------------------------
>+; void interp_8tap_horiz_%3_%1x%2(pixel *src, intptr_t srcStride, pixel *dst, intptr_t dstStride, int coeffIdx, int isRowExt)
>+;----------------------------------------------------------------------------------------------------------------------------
>+%macro IPFILTER_LUMA_sse2 3
>+INIT_XMM sse2
>+cglobal interp_8tap_horiz_%3_%1x%2, 4,7,8
>+
>+    mov       r4d, r4m
>+    add       r4d, r4d
>+    pxor      m6, m6
>+%ifdef PIC
>+    lea       r6, [tabw_LumaCoeff]
>+    movu      m3, [r6 + r4 * 8]
>+%else
>+    movu      m3, [tabw_LumaCoeff + r4 * 8]
>+%endif
>+
>+    mov       r4d, %2
>+%ifidn %3, pp
>+    mova      m2, [pw_32]
>+%else
>+    mova      m2, [pw_2000]
>+    add       r3d, r3d
>+    cmp       r5m, byte 0
if we move above 2 lines to up, we can reduce r6 and reuse r5.
</pre>
                  </div>
                </blockquote>
                I am not sure if this can be done.  r4 is used to to set
                m3 then it is reused and modified depending on r5 and r5
                can't be used for something else before it's cmp'ed.<br>
                <blockquote
                  cite="mid:61748dfc.16c.14d0228e5d2.Coremail.chenm003@163.com"
                  type="cite">
                  <div style="FONT-SIZE: 14px; COLOR: #000000;
                    LINE-HEIGHT: 1.7; FONT-FAMILY: arial">
                    <pre>'mov, lea' didn't affect eflags register</pre>
                  </div>
                </blockquote>
              </blockquote>
            </div>
            but r4 is needed for the lea instruction and r4 is later
            reused and modified depending on r5.  Only one of them can
            be reused, not both, so r6 is needed.<br>
            <fieldset class="mimeAttachmentHeader"></fieldset>
            <br>
            <pre wrap="">How about below code:
</pre>
            <pre wrap="">    pxor      m6, m6
    add       r3d, r3d

    cmp       r5m, byte 0
%ifdef PIC
    lea       r6, [tabw_LumaCoeff]
    movu      m3, [r6 + r4 * 8]
%else
    movu      m3, [tabw_LumaCoeff + r4 * 8]
%endif</pre>
            <pre wrap="">    mov       r4d, %2
%ifidn %3, pp
    mova      m2, [pw_32]
%else
    mova      m2, [pw_2000]
   jnz ...
</pre>
          </blockquote>
        </blockquote>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    this works<br>
    cglobal interp_8tap_horiz_%3_%1x%2, 4,6,8<br>
        mov       r4d, r4m<br>
        add       r4d, r4d<br>
        pxor      m6, m6<br>
    %ifidn %3, ps<br>
        add       r3d, r3d<br>
        cmp       r5m, byte 0<br>
    %endif<br>
    %ifdef PIC<br>
        lea       r5, [tabw_LumaCoeff]<br>
        movu      m3, [r5 + r4 * 8]<br>
    %else<br>
        movu      m3, [tabw_LumaCoeff + r4 * 8]<br>
    %endif<br>
    <br>
        mov       r4d, %2<br>
    %ifidn %3, pp<br>
        mova      m2, [pw_32]<br>
    %else<br>
        mova      m2, [pw_2000]<br>
        je        .loopH<br>
        lea       r5, [r1 + 2 * r1]<br>
        sub       r0d, r5d<br>
        add       r4d, 7<br>
    %endif<br>
    <br>
    <blockquote
      cite="mid:74e50a4b.32f.14d02d2fd55.Coremail.chenm003@163.com"
      type="cite">
      <pre wrap="">_______________________________________________
x265-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:x265-devel@videolan.org">x265-devel@videolan.org</a>
<a class="moz-txt-link-freetext" href="https://mailman.videolan.org/listinfo/x265-devel">https://mailman.videolan.org/listinfo/x265-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>