<p></p>
<p dir="auto">fastPathBottomToTop does not do much... It just reverse the line order.<br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltGeneric.c#L517">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltGeneric.c#L517</a></p>
<p dir="auto">I foresee two cases where it could fail:</p>
<ul dir="auto">
<li>the fast operation by itself has a BUG (whatether BottomToTop or not)</li>
<li>some integer operations are carried on a larger integer type, transforming negative pitch into a large positive int</li>
</ul>
<p dir="auto">The later is possible because <code>srcPitch</code> and <code>dstPitch</code> are declared usqInt in <code>operation_t</code><br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltDispatch.h#L98">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltDispatch.h#L98</a></p>
<p dir="auto"><code>usqInt</code> is 64bits on ARM64, so far so good, unfortunately those variables are copied to 32 bits local temps in<br>
<a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltInternal.h#L137">https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/f5f0e7d98effd7217dded6ed9397b2cac1f787ad/platforms/Cross/plugins/BitBltPlugin/BitBltInternal.h#L137</a></p>
<p dir="auto">I think that it is the mistake, because pointer arithmetic in 64 bits will be performed with 64 bits size_t, and the uint32_t will just move the pointer a large amount forward (2^32-pitch) instead of backward (-pitch).</p>
<p dir="auto">So I think that declaring the local <code>srcPitch</code> and <code>dstPitch</code> as <code>usqInt</code> instead of <code>uint32_t</code> might fix the bug.</p>
<p dir="auto">I have no ARM64 at hand to play with, so up to you to verify the hypothesis.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/617#issuecomment-1063371033">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AIJPEWZBNXM76PBOWSB5Z7LU7EHG5ANCNFSM5PYJJ4WA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you commented.<img src="https://github.com/notifications/beacon/AIJPEW4YODJO2FBANMIS5NLU7EHG5A5CNFSM5PYJJ4WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOH5Q4CGI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><OpenSmalltalk/opensmalltalk-vm/issues/617/1063371033</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/617#issuecomment-1063371033",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/617#issuecomment-1063371033",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>