<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPCXpresso IDEのトピックRe: Converting a C function into inline assembly</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526975#M222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Mon Feb 04 09:53:23 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess this has been caused by the change in optimisation options between v4 and v5. V5 now uses space optimisation which reduces code size, but can reduce execution speed. If you want to build a function to a particular optimisation level, you can use&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma optimze("o3")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;, or you can just change the optimisation for the whole project to match what you used in v4&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:40:20 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:40:20Z</dc:date>
    <item>
      <title>Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526967#M214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by micrio on Sun Feb 03 08:44:42 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a relatively simple 5 statement C function that I would like to &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;convert to in-line assembly.&amp;nbsp;&amp;nbsp; I have converted other C functions and find&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;it tricky each time.&amp;nbsp;&amp;nbsp; The mnemonics are different.&amp;nbsp;&amp;nbsp; Some in-line opcodes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;result in multiple assembly opcodes.&amp;nbsp;&amp;nbsp; The registers don't always map&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the way that I want them to.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems like simple process that could be automated.&amp;nbsp;&amp;nbsp; If it has, I have&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;not found it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I do understand assembly having written a lot of Z80 and 8086 code in &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the past.&amp;nbsp;&amp;nbsp; I am fluent in C code.&amp;nbsp;&amp;nbsp;&amp;nbsp; I don't have my head around in-line &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;assembly yet.&amp;nbsp;&amp;nbsp; That is the problem!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The reason I want to do this is that I want to move to the 5.0.14&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;release from my current 4.3.0.&amp;nbsp;&amp;nbsp; The 5.0.14 release produces slower code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for one critical routine.&amp;nbsp;&amp;nbsp; If I could convert that routine to assembly then I &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lock in the better optimization of the older release.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is in reference to the problem that I described in this thread;&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://knowledgebase.nxp.com/showthread.php?t=3939&amp;amp;page=2&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526967#M214</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526968#M215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wrighflyer on Sun Feb 03 10:50:17 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Why not build the code with -save-temps and just carry the .S file over from 4.x to 5.x?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526968#M215</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526969#M216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Sun Feb 03 14:37:57 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you check the optimization settings in both LPCXpresso IDEs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Creating a project in 4.2.2 sets the default optimization to -O2 (optimize more) but in 5.0.14 it is set to -Os (optimize for size).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-O2 results in code that runs faster than -Os.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe this is your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526969#M216</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526970#M217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cfb on Sun Feb 03 14:38:50 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The v5 code might have less instructions but it appears to be looping twice as many times as thev4 code. Before attempting to use inline assembler try rewriting the C code to be more efficient instead of relying on the optimiser to fix it up for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526970#M217</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526971#M218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by micrio on Sun Feb 03 20:18:44 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt;Could you check the optimization settings in both LPCXpresso IDEs?&lt;BR /&gt; &lt;BR /&gt;Creating a project in 4.2.2 sets the default optimization to -O2 (optimize more) but in 5.0.14 it is set to -Os (optimize for size).&lt;BR /&gt; &lt;BR /&gt;-O2 results in code that runs faster than -Os.&lt;BR /&gt;Maybe this is your problem.&lt;BR /&gt; &lt;BR /&gt;Rob&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A little later in that thread I give the performance figures for all optimizer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;settings for both compiler versions.&amp;nbsp;&amp;nbsp; At low settings they are about the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;same.&amp;nbsp;&amp;nbsp; At -O2 and especially -O3 the older compiler was far better.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526971#M218</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526972#M219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by micrio on Sun Feb 03 20:27:06 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: cfb&lt;/STRONG&gt;&lt;BR /&gt;The v5 code might have less instructions but it appears to be looping twice as many times as thev4 code. Before attempting to use inline assembler try rewriting the C code to be more efficient instead of relying on the optimiser to fix it up for you.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have worked on the C code a great deal to improve performance.&amp;nbsp;&amp;nbsp; What&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you see is the best possible code for the version 4.3.0 environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I moved to 5.0.14 it went backward.&amp;nbsp;&amp;nbsp; I have not tried to reformulate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the C code to gain performance in the new revision.&amp;nbsp;&amp;nbsp; Perhaps that might&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;help.&amp;nbsp;&amp;nbsp; I suspect that the statements that do the array indexing and the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;shifting call up some obscure optimizer quirk that previously worked&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;to my advantage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526972#M219</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526973#M220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by micrio on Sun Feb 03 20:28:04 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: wrighflyer&lt;/STRONG&gt;&lt;BR /&gt;Why not build the code with -save-temps and just carry the .S file over from 4.x to 5.x?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That is a great idea, I will give it a try.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526973#M220</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526974#M221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cfb on Mon Feb 04 05:31:48 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: micrio&lt;/STRONG&gt;&lt;BR /&gt;I have not tried to reformulate&lt;BR /&gt;the C code to gain performance in the new revision.&amp;nbsp;&amp;nbsp; Perhaps that might&lt;BR /&gt;help.&amp;nbsp;&amp;nbsp; I suspect that the statements that do the array indexing and the&lt;BR /&gt;shifting call up some obscure optimizer quirk that previously worked&lt;BR /&gt;to my advantage.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What the optimiser noticed was that the number of times your loop was executed was a multiple of two. It has partially unrolled your loop so that it does two assignments in each iteration instead of one so it only has to loop half as many times. If you have 20 assignments then the v4 version executes 10 instructions 10 times (= 100) but the new version executes 8 instructions 20 times (= 160). You can rewrite your C code to explicitly do the same.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526974#M221</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526975#M222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by TheFallGuy on Mon Feb 04 09:53:23 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess this has been caused by the change in optimisation options between v4 and v5. V5 now uses space optimisation which reduces code size, but can reduce execution speed. If you want to build a function to a particular optimisation level, you can use&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#pragma optimze("o3")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;, or you can just change the optimisation for the whole project to match what you used in v4&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526975#M222</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526976#M223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by micrio on Mon Feb 04 11:23:20 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: TheFallGuy&lt;/STRONG&gt;&lt;BR /&gt;I guess this has been caused by the change in optimisation options between v4 and v5. V5 now uses space optimisation which reduces code size, but can reduce execution speed. If you want to build a function to a particular optimisation level, you can use&lt;BR /&gt;#pragma optimze("o3")&lt;BR /&gt;, or you can just change the optimisation for the whole project to match what you used in v4&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did try -O3 (and every other optimization setting) in the version 5 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;environment.&amp;nbsp;&amp;nbsp; Are you suggesting that giving the -O3 is not actually &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;giving me full speed optimization?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Pete.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526976#M223</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526977#M224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cfb on Tue Feb 05 00:44:41 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: micrio&lt;/STRONG&gt;&lt;BR /&gt;Are you suggesting that giving the -O3 is not actually &lt;BR /&gt;giving me full speed optimization?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The main difference I could see between -O2 and -O3 was that -O3 expanded the function inline rather than calling it as a function. As most of your time is spent in the loop I would not expect you would see much difference between -O2 and -O3 for the example that you supplied.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526977#M224</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526978#M225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Tue Feb 05 01:17:36 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: micrio&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; Are you suggesting that giving the -O3 is not actually &lt;BR /&gt;giving me full speed optimization?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Never assume that a higher optimization level gives you a higher speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are different settings for speed and size optimization and, as I stated before, the LPCXpresso 4 tools are standard set to -O2 whereas 5 uses -Os, which is optimizing for size rather than speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It used to be such that -O1 did some optimization, -O2 optimized for speed, -O3 for size and speed and -Os was for the smallest code size.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-O3 delivered code that lies somewhere between -O2 and -Os, so not as small as -Os and not as fast as -O2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But please remember that this is just a rule of thumb. Depending on your program this may differ.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When it comes to execution speed you should really try different settings and different structuring in your C program to see what is best for a specific function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And then carefully check if a new LPCXpresso tool version incorporates a new gnu-arm compiler since optimizations may differ slightly between versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526978#M225</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting a C function into inline assembly</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526979#M226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by cfb on Wed Feb 06 00:28:59 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: micrio&lt;/STRONG&gt;&lt;BR /&gt;Are you suggesting that giving the -O3 is not actually &lt;BR /&gt;giving me full speed optimization? &lt;BR /&gt;Pete.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To identify the optimisations resulting from the use of -O3 and to compare what -O3 gives you in LPCXpresso v4 and v5 run your LPCXpresso version of gcc (arm-none-eabi-gcc.exe) with the following options:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[FONT=Courier New]-O3 -Q --help=optimizers[/FONT] &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;An explanation of the results is here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:40:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Converting-a-C-function-into-inline-assembly/m-p/526979#M226</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:40:22Z</dc:date>
    </item>
  </channel>
</rss>

