<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>The gist of it is that you're specifying the earliest CPU that
your program will run on (if it runs on an older CPU, it might
crash with SIGILL). -Cp dictates the instruction set version used
overall, while -Cf specifies the family of floating-point
instructions that will be used. Later versions of SSE have better
rounding functions, for example, although I think it's more
applicable to i386 where the older floating-point stack is used by
default. <br>
</p>
<p>Generally you'd set -Cp and -Op to the same value, and I think
-Op is set to match -Cp if it's omitted. I might need Florian to
confirm though. I have programmed one or two optimisations that
depend on the value of -Op - the one that springs to mind is where
a group of MOV instructions are morphed into an XCHG instruction -
XCHG is slower than the 3 MOV instructions until relatively
recently, so it won't perform this optimisation by default unless
optimising for size or if -Op is set to a particular value (I
think at least "CoreI").</p>
<p>When vectorisation starts making a proper appearance in the
compiler, I'll be very likely developing optimisations for fused
multiply-add (FMA), which only came about after AVX.<br>
</p>
<p>Gareth aka. Kit<br>
</p>
<div class="moz-cite-prefix">On 08/09/2020 00:03, Ben Grasset via
fpc-devel wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAL4d7Fj6vcJ3azsES6vhxEwMjN9RTs+fFvKW96jo77sizshcSg@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">For example, a valid FPC command line would be:
<div><br>
</div>
<div>fpc -O3 -CfAVX2 -CpCOREAVX2 -OpCOREAVX2 file.pas</div>
<div><br>
</div>
<div>To what extent is each of those flags enabling the
generation of AVX2 instructions? Are they all necessary, or
does their functionality overlap to some degree? Which is most
important?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></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>