<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi everyone,</p>
    <p>Just thought I'd give a heads-up on my latest mad experiments!</p>
    <p>I'm currently working to see if I can improve auto-vectorisation
      within the compiler.  I'm using x86_64 as my starting point since
      SSE2 is guaranteed to be present, but aiming to make it as
      cross-platform as possible so it can be ported to AArch64 and the
      like.</p>
    <p>Current status:<br>
    </p>
    <ul>
      <li>Currently it compiles and works but it generally performs
        worse than without auto-vectorisation because the compiler
        forces everything into memory (its usual fall-back when it
        doesn't quite know what to do wih a storage type).<br>
      </li>
      <li>I'm using the ucomplex.pp unit as my test case while also
        telling it to use 'vectorcall' in all of the routines. Because
        the complex type is just two Doubles, this is perfectly suited
        for XMM.</li>
      <li>I tried to reuse LOC_SUBSETREG and LOC_CSUBSETREG for
        locations that occupied specific lanes of an MM register, but
        this caused problems since the type is designed only for integer
        registers, so I have created a new LOC_MMLANE and LOC_CMMLANE
        type and associated structure within the TLocation union, which
        are specifically designed for MM registers (and so doesn't have
        to handle bitpacking).  This also allows me to write new methods
        like a_loadmm_reg_lane instead of re-using and over-complicating
        existing ones.  (I also made sure to follow the convention of
        keeping LOC_REFERENCE and LOC_CREFERENCE last).<br>
      </li>
      <li>Currently I'm only supporting 128-bit MM types.  256-bit and
        above will come at a later date.</li>
      <li>Currently auto-vectorisation is always attempted, but later
        will disable it if it's not -O2 or -O3 (haven't decided which
        yet).<br>
      </li>
    </ul>
    <p>Kit<br>
    </p>
  <div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /><table style="border-top: 1px solid #D3D4DE;"><tr><td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"/></a></td><td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free.<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a></td></tr></table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>