<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Most likely, this is the wrong compiler-dev - I suggest you
      forward this here:</p>
    <p><a class="moz-txt-link-freetext" href="https://mail.openjdk.org/mailman/listinfo/hotspot-compiler-dev">https://mail.openjdk.org/mailman/listinfo/hotspot-compiler-dev</a></p>
    <p>Cheers<br>
      Maurizio<br>
    </p>
    <div class="moz-cite-prefix">On 20/03/2023 17:10, Vladimir Kempik
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:F9B8363B-6739-4D3F-8B73-ED795B3F0848@gmail.com">
      
      <pre style="white-space: pre-wrap; font-variant-ligatures: normal; orphans: 2; widows: 2;">Adding compiler list.

Could you please suggest on best way to make emit_intX methods not perform misaligned memory stores ?
Talking about src/hotspot/share/asm/codeBuffer.hpp from <a href="https://github.com/VladimirKempik/jdk/commit/18d7f399ce1bc213b2495411193938d914d3f616#diff-deb8ab083311ba60c0016dc34d6518579bbee4683c81e8d348982bac897fe8ae" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/VladimirKempik/jdk/commit/18d7f399ce1bc213b2495411193938d914d3f616#diff-deb8ab083311ba60c0016dc34d6518579bbee4683c81e8d348982bac897fe8ae</a>

Regards, Vladimir</pre>
      <div><br>
        <blockquote type="cite">
          <div>20 марта 2023 г., в 12:42, Vladimir Kempik
            <a class="moz-txt-link-rfc2396E" href="mailto:vladimir.kempik@gmail.com"><vladimir.kempik@gmail.com></a> написал(а):</div>
          <br class="Apple-interchange-newline">
          <div>
            <div style="overflow-wrap: break-word; -webkit-nbsp-mode:
              space; line-break: after-white-space;"><br>
              <div>
                <blockquote type="cite">
                  <div><span style="caret-color: rgb(0, 0, 0);
                      font-family: Helvetica; font-size: 12px;
                      font-style: normal; font-variant-caps: normal;
                      font-weight: 400; letter-spacing: normal;
                      text-align: start; text-indent: 0px;
                      text-transform: none; white-space: normal;
                      word-spacing: 0px; -webkit-text-stroke-width: 0px;
                      text-decoration: none; float: none; display:
                      inline !important;"> For each emit_intX functions
                      modified, I see there is a correspondent version
                      which handles unaligned access. For example, 'void
                      emit_int16(uint8_t x1, uint8_t x2)' for 'void
                      emit_int16(uint16_t x)'<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family:
                      Helvetica; font-size: 12px; font-style: normal;
                      font-variant-caps: normal; font-weight: 400;
                      letter-spacing: normal; text-align: start;
                      text-indent: 0px; text-transform: none;
                      white-space: normal; word-spacing: 0px;
                      -webkit-text-stroke-width: 0px; text-decoration:
                      none;">
                    <span style="caret-color: rgb(0, 0, 0); font-family:
                      Helvetica; font-size: 12px; font-style: normal;
                      font-variant-caps: normal; font-weight: 400;
                      letter-spacing: normal; text-align: start;
                      text-indent: 0px; text-transform: none;
                      white-space: normal; word-spacing: 0px;
                      -webkit-text-stroke-width: 0px; text-decoration:
                      none; float: none; display: inline !important;"> So
                      if we encounter an unaligned access issue when
                      using 'emit_int16(uint16_t x)', shouldn't we
                      change the callsite to use 'emit_int16(uint8_t x1,
                      uint8_t x2)' instead?<span class="Apple-converted-space"> </span></span></div>
                </blockquote>
              </div>
              <br>
              <div>Hello</div>
              <div>not exactly</div>
              <div>'void emit_int16(uint8_t x1, uint8_t x2)</div>
              <div>will always use slow version ( store byte)</div>
              <div><br>
              </div>
              <div>but </div>
              <div>void emit_int16(uint16_t x)</div>
              <div>will use slow version only on unaligned stores. if
                store is aligned, it will use "store half", which should
                be faster.</div>
              <div><br>
              </div>
              <div>So we can’t always use emit_int16(uint8_t x1, uint8_t
                x2) at callsite.</div>
              <div><br>
              </div>
              <span>and we can’t decide which one to use at callsite as
                callsite should be unaware of end() value
                inside CodeSection class</span>
              <div><span><br>
                </span></div>
              <div><span>Regards, Vladimir</span></div>
            </div>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
  </body>
</html>