<?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>Kinetis MicrocontrollersのトピックRe: Math library for Optimized for FPU</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221330#M4022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Erich&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks for the response.&amp;nbsp; Yes, I have hardware math enabled.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I think I mis-stated my question.&amp;nbsp;&amp;nbsp; I wan't concerned about the compiler warning per say.&amp;nbsp; I want to use a version of the sin function that is implemented using single precision arithmetic.&amp;nbsp; The default math.h version does all calculations in double precision.&amp;nbsp; Since the K60F series of chips only has a single precision FPU, every opperation in the sin function is implemented in software and the calculation is VERY slow.&amp;nbsp; In summary the standard sine calculation is doing the following:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.) Promotes the angle argument from float to double.&lt;/P&gt;&lt;P&gt;2.) Calculates the sin using software emulated double precision calculations.&amp;nbsp; FPU is not used.&lt;/P&gt;&lt;P&gt;3.) Casts the result back to a float.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if there is a library that can do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Calculate sine in single precision, so that the FPU is used.&amp;nbsp; Argument and result will also be in single precision so no conversion will be necessary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be best if the library was optomized for the arm M4 fpu core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2012 19:01:14 GMT</pubDate>
    <dc:creator>petermckinnis</dc:creator>
    <dc:date>2012-10-23T19:01:14Z</dc:date>
    <item>
      <title>Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221328#M4020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="padding-left: 30px;"&gt;I am working on a project using a Kinetis K60F processor with a FPU.&amp;nbsp; I noticed that the standard math library (math.h) seems to be implemented in software.&amp;nbsp; For example, the following code (see below) to take the sin of 0.0 is implemented in double precision (per the C standard).&amp;nbsp; Is there a compiler option somewhere that uses hardware accelerated math routines, (or alternatively a third party library)?&amp;nbsp; If so, how can I use this library.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;BR /&gt;#include &amp;lt;math.h&amp;gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;void aFunction() {&lt;BR /&gt; float ans = sin(0.0f);&amp;nbsp; //Gives compiler warning: implicit arithmetic conversion from 'double' to 'float'&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Oct 2012 19:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221328#M4020</guid>
      <dc:creator>petermckinnis</dc:creator>
      <dc:date>2012-10-19T19:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221329#M4021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;have you selected the options for hardware math (see screenshot from CW MCU10.3)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="floating point options.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/118921i122834C4A124EE91/image-size/large?v=v2&amp;amp;px=999" role="button" title="floating point options.png" alt="floating point options.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;About the warning: this sounds ok to me, as sin() returns a double, and you are assigning it to a float. Casting it to a float would suppress that warning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Erich&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Oct 2012 07:28:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221329#M4021</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2012-10-20T07:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221330#M4022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Erich&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks for the response.&amp;nbsp; Yes, I have hardware math enabled.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I think I mis-stated my question.&amp;nbsp;&amp;nbsp; I wan't concerned about the compiler warning per say.&amp;nbsp; I want to use a version of the sin function that is implemented using single precision arithmetic.&amp;nbsp; The default math.h version does all calculations in double precision.&amp;nbsp; Since the K60F series of chips only has a single precision FPU, every opperation in the sin function is implemented in software and the calculation is VERY slow.&amp;nbsp; In summary the standard sine calculation is doing the following:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.) Promotes the angle argument from float to double.&lt;/P&gt;&lt;P&gt;2.) Calculates the sin using software emulated double precision calculations.&amp;nbsp; FPU is not used.&lt;/P&gt;&lt;P&gt;3.) Casts the result back to a float.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was wondering if there is a library that can do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Calculate sine in single precision, so that the FPU is used.&amp;nbsp; Argument and result will also be in single precision so no conversion will be necessary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be best if the library was optomized for the arm M4 fpu core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2012 19:01:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221330#M4022</guid>
      <dc:creator>petermckinnis</dc:creator>
      <dc:date>2012-10-23T19:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221331#M4023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the standard for the "C" math.h lib.&lt;/P&gt;&lt;P&gt;You will need to track down an&amp;nbsp; alternative I think. You can most likely find source for a fast sin function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 04:03:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221331#M4023</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2012-10-24T04:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221332#M4024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some digging, I found that ARM actually publishes an optomized DSP library for all arm Cortex-M variants.&amp;nbsp; The library is called CMSIS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php"&gt;http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 18:21:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221332#M4024</guid>
      <dc:creator>petermckinnis</dc:creator>
      <dc:date>2012-10-24T18:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Math library for Optimized for FPU</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221333#M4025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can down load the source from here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.onarm.com/cmsis/download/21/version-3-0-of-the-cortex-microcontroller-software-interface-standard-cmsis/"&gt;http://www.onarm.com/cmsis/download/21/version-3-0-of-the-cortex-microcontroller-software-interface-standard-cmsis/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Oct 2012 20:40:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Math-library-for-Optimized-for-FPU/m-p/221333#M4025</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2012-10-24T20:40:53Z</dc:date>
    </item>
  </channel>
</rss>

