<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Pardon, chybička se vloudila:-)<br>
    <br>
    Nemělo bejt +1, ale +n.<br>
    A to má dost velkej vliv na skóre:<br>
    <br>
    původní: 470, bez 1. shiftu taky 470<br>
    upravená: 790, bez toho shiftu ovšem 450.<br>
    <br>
    Všechno ale s -Og. Po zapnutí -Os všechny 4 možnosti 378 :-)<br>
    <br>
    PH<br>
    <br>
    <div class="moz-cite-prefix">Dne 18.12.2024 v 21:05 Pavel Hudeček
      napsal(a):<br>
    </div>
    <blockquote type="cite"
      cite="mid:85f11594-bb26-4121-afbe-a1f484112c7a@seznam.cz">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      Je to trochu složitější:-)<br>
      <br>
      int main(void) {<br>
          <br>
          uint64_t u64;<br>
          while (1) {<br>
      <br>
              //u64=0ULL;<br>
              //u64 <<= 8; u64 |= SIGROW.SERNUM5;<br>
              u64 <<= 8; u64 = SIGROW.SERNUM5;<br>
      <br>
              u64 <<= 8; u64 |= SIGROW.SERNUM4;<br>
              u64 <<= 8; u64 |= SIGROW.SERNUM3;<br>
              u64 <<= 8; u64 |= SIGROW.SERNUM2;<br>
              u64 <<= 8; u64 |= SIGROW.SERNUM1;<br>
              u64 <<= 8; u64 |= SIGROW.SERNUM0;<br>
               <br>
               // aby byla jistota, že to celý neodoptimalizuje<br>
              u64++;<br>
              for (uint8_t n=0; n<8; n++) {<br>
                  PORTA.OUT = *(((uint8_t *)&u64)+1);<br>
              }<br>
          }<br>
      }<br>
      <br>
      Zakomentovaná varianta 444 B, vylepšená 478.<br>
      <br>
      Až po odmazání prvního u64 <<= 8; se to zlepší na 442 a
      původní zůstane na 444.<br>
      <br>
      Takže nakonec je to o 2 B lepší. Ale zas ta původní varianta má
      snadno modifikovatelné pořadí, což byla základní myšlenka proč
      jsem to tak napsal.<br>
      <br>
      PH<br>
      <br>
      <br>
      <div class="moz-cite-prefix">Dne 18.12.2024 v 16:53 Petr Labaj
        napsal(a):<br>
      </div>
      <blockquote type="cite"
        cite="mid:4f95f9f2-9005-bf7d-f2eb-d80a83445f04@volny.cz">
        <meta http-equiv="Content-Type"
          content="text/html; charset=UTF-8">
        Je zajímavé, že jste oba použili podobnou konstrukci, která je
        podle mě suboptimální.<br>
        Když už jste teda zvolili ty shifty místo nějakých rychlejších
        možností.<br>
        <br>
        První řádek by měl být podle mě dosazovací.<br>
        <br>
        Tedy nějak takto:<br>
        <div><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">adc_value = (</span><span
          class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
          class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">0</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">] << </span><span
          class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">24</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">;</span></div>
        <span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">adc_value += (</span><span
        class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
        class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">1</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">] << </span><span
        class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">16</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">;

</span>...<br>
        <br>
        A u pana Hudečka ještě bez toho úvodního nulování:<br>
         u64 <<= 8; u64 = SIGROW.SERNUM5;<br>
         u64 <<= 8; u64 |= SIGROW.SERNUM4;<br>
        ...<br>
        <br>
        PL<br>
        <br>
        ******************<br>
        <br>
        <div class="moz-cite-prefix">Dne 18.12.2024 v 9:56 Jirka Mww
          napsal(a):<br>
        </div>
        <blockquote type="cite"
cite="mid:CAGNMtu1-nEO3Z9v+TiaMPnPVX5k2JofaEadjw2T5iktqqSTKcw@mail.gmail.com">
          <meta http-equiv="content-type"
            content="text/html; charset=UTF-8">
          <div dir="ltr"><br>
            <div><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">  adc_value += (</span><span
              class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
              class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">0</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">] << </span><span
              class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">24</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">;</span></div>
            <span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">  adc_value += (</span><span
            class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
            class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">1</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">] << </span><span
            class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">16</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">;
  adc_value += (</span><span class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
            class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">2</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">] << </span><span
            class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">8</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">; </span>
            <div><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">  adc_value += (</span><span
              class="gmail-hljs-type"
style="font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">long</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">)d[</span><span
              class="gmail-hljs-number"
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre">3</span><span
style="color:rgb(67,67,67);font-family:ui-monospace,"Cascadia Mono","Segoe UI Mono","Liberation Mono",Menlo,Monaco,Consolas,monospace;font-size:14px;white-space:pre;background-color:rgb(248,248,248)">];</span> </div>
            <div><br>
            </div>
          </div>
        </blockquote>
        <br>
        <div class="moz-cite-prefix">Dne 18.12.2024 v 13:26 Pavel
          Hudeček napsal(a):<br>
        </div>
        <blockquote type="cite"
          cite="mid:8c3af9ca-7222-42f3-9648-268c40377070@seznam.cz">               
          u64=0ULL;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM5;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM4;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM3;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM2;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM1;<br>
                          u64 <<= 8; u64 |= SIGROW.SERNUM0;<br>
        </blockquote>
        <br>
        <fieldset class="moz-mime-attachment-header"></fieldset>
        <pre wrap="" class="moz-quote-pre">_______________________________________________
HW-list mailing list  -  sponsored by <a
        class="moz-txt-link-abbreviated" href="http://www.HW.cz"
        moz-do-not-send="true">www.HW.cz</a>
<a class="moz-txt-link-abbreviated moz-txt-link-freetext"
        href="mailto:Hw-list@list.hw.cz" moz-do-not-send="true">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext"
        href="http://list.hw.cz/mailman/listinfo/hw-list"
        moz-do-not-send="true">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>