<p>The accelerated BitBlt framework was initially targeted at the ARM11, running the AArch32 instruction set (which is the only one it fully supported).</p>
<p>More recent ARMs run much faster, which has enabled more comprehensive testing via the BitBlt fuzz test framework (<a href="https://github.com/bavison/SqueakBitBltTest">https://github.com/bavison/SqueakBitBltTest</a>). This has detected a handful of bugs in both the AArch32-specific and the architecture-neutral parts of the fast BitBlt framework. First I address these.</p>
<p>Next, I add a number of BitBlt fast paths written in platform-independent C. The 8-to-32bpp conversion routine is as fast as anything I could manage with hand-crafted AArch64 assembly. Others are useful as reference implementations for other architectures, or to fill in gaps in their abilities (for example, while I've introduced a class of fast paths for colour maps that only feature two distinct colours, I haven't retrospectively written any AArch32 fast paths for them, so the C fast path will be used for them on AArch32).</p>
<p>The fast path that handles operations with scalar halftoning and 32bpp destination images is a bit of a special case, in that it acts to extend the capabilities of other fast paths. It thus accelerates both AArch32 and AArch64.</p>
<p>The most significant commit, however, is the last one. This features a collection of fast paths implemented using inline AArch64 assembly, tuned for Cortex-A72 (as found in the Raspberry Pi 4). Based on the results of profiling, this has an emphasis on operations with a 32bpp destination image.</p>
<p>Operations with any source depth, in conjunction with 22 of the possible combinationRules (including the common sourceWord, pixPaint and alphaBlend rules) should all be accelerated, providing you don't use little-endian pixel packing, vector halftoning, or non-standard colour map rules when converting from different colour depths.</p>
<p>There are additional fast paths for alphaBlend for either a constant source colour, or a source image whose colour map only consists of two different colours (i.e. where the source image is effectively used as a 1bpp mask, despite being of a greater depth).</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Don't pass -m32 to GCC for ARM builds</li>
  <li>Correct various "#if ENABLE_FAST_BLT" to "#ifdef"</li>
  <li>Don't assume sourcePPW is valid on entry to copyBitsFallback</li>
  <li>Fallback routines need extra help to detect intra-image operations</li>
  <li>Remove invalid shortcut in rgbComponentAlphawith</li>
  <li>Fix bug in 32-bit ARM fast paths</li>
  <li>Fix buffer overflow bugs</li>
  <li>Fix corruption bugs with wide 1bpp source images</li>
  <li>Fix type of halftone array for 64-bit targets</li>
  <li>Detect and add a new fast path flag for effective-1bpp colour maps</li>
  <li>C fast path for 32bpp alphaBlend</li>
  <li>C fast path for planar alphaBlend</li>
  <li>C fast path for 8->32bpp conversion</li>
  <li>C fast path for alphaBlend with 1bpp colour map and scalar halftone</li>
  <li>Apply scalar halftoning to colour map entries instead for 32bpp destination</li>
  <li>Enable fast blit code for AArch64</li>
  <li>AArch64 assembly optimisations</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-9c8e5c152e64d7a746ee6b226e0e42ad54897b798f5f553ba8a15b2d1d10111f">build.linux32ARMv6/squeak.cog.spur/build.assert/mvm</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-6a6a73abecddba11142665b2177575bb44c0e862ee8778b085e4d317872dbb9a">build.linux32ARMv6/squeak.cog.spur/build.debug/mvm</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-6ae2e052cbfd247ea8f0e3a55138bf7ac374a5bc8723c7861f18438065bccce8">build.linux32ARMv6/squeak.cog.spur/build/mvm</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-e73f18c93ba069b702d01773d84f4ff9f9b8b267eb9cbb7af30193ead4cf4951">build.linux64ARMv8/squeak.cog.spur/build.assert/mvm</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-85f16997faaa3a1be05d128875cac0c200ad7d4952e53926ccd0938100b6e1bb">build.linux64ARMv8/squeak.cog.spur/build.debug/mvm</a>
    (1)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-91a1fa0c72463f1ff71041b0f5743ace33ae7a912921e655e9f658c1c9cfccb3">build.linux64ARMv8/squeak.cog.spur/build/mvm</a>
    (1)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-dd017b66e51b216d424ffda9d036b56f744051064fefa0c19c39e03cb37357c4">platforms/Cross/plugins/BitBltPlugin/BitBltArm64.c</a>
    (2482)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-5b4f0512a02a56760766d0aead765b5d8a129f9587742d6be9725b41b92948c9">platforms/Cross/plugins/BitBltPlugin/BitBltArm64.h</a>
    (30)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-6c75719cee4b77782125301eb7df79499874e2400a9d8ce961c49bdfaf4e8265">platforms/Cross/plugins/BitBltPlugin/BitBltArmSimdAsm.hdr</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-11948568e84ce37b273d54696110c2152eb2e394aa29f53a58d013d743efb9e3">platforms/Cross/plugins/BitBltPlugin/BitBltArmSimdSourceWord.s</a>
    (17)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-a4b255fb001a82c840b9e525ee3a29c95333c9005a3d842c299a22b349bfacca">platforms/Cross/plugins/BitBltPlugin/BitBltDispatch.c</a>
    (126)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-1e8ca54679616df5f150557eff290f039e6baefd8ca35539bf66608d6ce4ac4a">platforms/Cross/plugins/BitBltPlugin/BitBltDispatch.h</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-d1bcc0070446bc732471376ed5a1948013ded02a6d2a8ec9a58639a479d725fb">platforms/Cross/plugins/BitBltPlugin/BitBltGeneric.c</a>
    (247)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-c6a9a21762925fd37d4277a0b665634386f5865a7e612ae98fa230e2f2e7f2b6">platforms/Cross/plugins/BitBltPlugin/BitBltInternal.h</a>
    (32)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-0c7b5c0ac32dfbb9cdcf9b6b4590059722981c6625330704033d22217658af4c">platforms/unix/config/configure</a>
    (12)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-92d7621e83a9288d33a6f91b20c33c5c8f802ff07436ada4baef1929f5ebee47">platforms/unix/plugins/BitBltPlugin/acinclude.m4</a>
    (11)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565/files#diff-34a93ff2a1525b3f660aebc71fc45b85c58be5aea9e2d5d2e8b0c2950a2a49f3">src/plugins/BitBltPlugin/BitBltPlugin.c</a>
    (23)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565.patch'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565.patch</a></li>
  <li><a href='https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565.diff'>https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEW4X2ERCHZ4P7CEQ5ODTL7KKZANCNFSM44CQS2XA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AIJPEW4S6B4TTDV6HCI5DPLTL7KKZA5CNFSM44CQS2XKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4NBM7XWA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/565",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>