<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Yeah, I just realised I was pretty silly to miss that! I must be more tired than I thought!</p>
<p>The reason why I brought it up is because I found an upgrade to the "MovAndTest2Test" optimisation where you might have something like "movl %eax,(memory); andl $1,%eax; testb %al;%al" (Yes, that code sequence does get generated sometimes) and it can be simplified to just "testb $1,(memory)", reading only 1 byte instead of all 4 (the AND instruction would have masked out the upper 3 bytes).
</p>
<p>Gareth aka. Kit
</p>
<div class="moz-cite-prefix">On 30/06/2022 11:52, Thorsten Otto via
fpc-devel wrote:<br>
</div>
<blockquote type="cite" cite="mid:2293567.kUQrWpT7eg@earendil">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="qrichtext" content="1">
<style type="text/css">p, li { white-space: pre-wrap; }</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Montag, 27. Juni 2022 04:43:46 CEST J. Gareth Moreton via fpc-devel wrote:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> testl $1,%ebx -> testb $1,%bl</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Obviously, thats not the same. The latter will only compare the least-significant byte against 1, and ignore the rest of the register. The former will also compare the remainder of the register against zero. SO you canot do such "optimizations" </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
fpc-devel maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>
</pre>
</blockquote>
<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://ipmcdn.avast.com/images/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>