<?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>topic Re: GCC compiler in CW10.1 optimized for M4? in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174332#M1402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried this and it doesn't seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int my_mult(int a, int b) { int c; c = ((long long)a*b) &amp;gt;&amp;gt; 32; return c;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This function generates the following assembly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;          my_mult:1fff0238:   push {r3-r4}41         return c;1fff023a:   asr r12,r1,#asr #311fff023e:   umull r2,r3,r0,r11fff0242:   mla r3,r0,r12,r31fff0246:   asrs r4,r0,#311fff0248:   mla r3,r4,r1,r31fff024c:   cpy r0,r342        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No smull there. &amp;nbsp;Furthermore, I don't understand why it is using an unsigned multiply (umull) when I'm using signed ints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not familiar with the CMSIS library. &amp;nbsp;I'll try to figure that out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:23:00 GMT</pubDate>
    <dc:creator>MikeAdv</dc:creator>
    <dc:date>2020-10-29T09:23:00Z</dc:date>
    <item>
      <title>GCC compiler in CW10.1 optimized for M4?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174329#M1399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it aware of optimizations for M4? It seems not to be......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would you not expect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static inline int MULSHIFT32(register int x, register int y)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; return (((Word64)x*(Word64)y)&amp;gt;&amp;gt;32);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SMULL&amp;nbsp; R3, R2, R1, R0&lt;BR /&gt;MOVS&amp;nbsp; R0, R2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to be compiled to a couple op-codes?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Richard.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Oct 2011 12:35:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174329#M1399</guid>
      <dc:creator>tmf</dc:creator>
      <dc:date>2011-10-14T12:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: GCC compiler in CW10.1 optimized for M4?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174330#M1400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is along the lines of my question as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to use multiply two 32 bit numbers and get the top 32 bits of the result. &amp;nbsp;How do I do that most efficiently from C?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 07:36:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174330#M1400</guid>
      <dc:creator>MikeAdv</dc:creator>
      <dc:date>2011-12-03T07:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: GCC compiler in CW10.1 optimized for M4?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174331#M1401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look in the CMSIS DSP libraries.&amp;nbsp;&amp;nbsp; I believe all you have to do is cast to a "long long" for the result and bit shift&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Dec 2011 10:21:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174331#M1401</guid>
      <dc:creator>eli_hughes</dc:creator>
      <dc:date>2011-12-03T10:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: GCC compiler in CW10.1 optimized for M4?</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174332#M1402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried this and it doesn't seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;int my_mult(int a, int b) { int c; c = ((long long)a*b) &amp;gt;&amp;gt; 32; return c;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This function generates the following assembly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;          my_mult:1fff0238:   push {r3-r4}41         return c;1fff023a:   asr r12,r1,#asr #311fff023e:   umull r2,r3,r0,r11fff0242:   mla r3,r0,r12,r31fff0246:   asrs r4,r0,#311fff0248:   mla r3,r4,r1,r31fff024c:   cpy r0,r342        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No smull there. &amp;nbsp;Furthermore, I don't understand why it is using an unsigned multiply (umull) when I'm using signed ints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not familiar with the CMSIS library. &amp;nbsp;I'll try to figure that out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:23:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GCC-compiler-in-CW10-1-optimized-for-M4/m-p/174332#M1402</guid>
      <dc:creator>MikeAdv</dc:creator>
      <dc:date>2020-10-29T09:23:00Z</dc:date>
    </item>
  </channel>
</rss>

