<?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: Floating point on k6xx in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470647#M28433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;A href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I am trying th get familiar with the FPU, with some help and some try and retry. Thank You&amp;nbsp; for the suggestions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;If You have time, have You tested if the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;arm_sin_f32() is better than the sinf() ???&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thank You&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Feb 2016 17:49:29 GMT</pubDate>
    <dc:creator>pietrodicastri</dc:creator>
    <dc:date>2016-02-24T17:49:29Z</dc:date>
    <item>
      <title>Floating point on k6xx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470644#M28430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good morning&lt;/P&gt;&lt;P&gt;I need to optimize the floating point execution. The CPU is the K64...&lt;/P&gt;&lt;P&gt;I have been looking for similar thematics, but I did not find the right answer. I understand the core is offering the FPU only for the shorter floating,&lt;/P&gt;&lt;P&gt;while for the double only the software emulation is available.&lt;/P&gt;&lt;P&gt;I see the math.h is proposing the functions ex...&lt;/P&gt;&lt;P&gt;sin()&amp;nbsp; and sinf()&lt;/P&gt;&lt;P&gt;for the data of type float and double. In parallel the CMSYS has the function arm_sin_f32() not the arm_sin_f64()&lt;/P&gt;&lt;P&gt;So I have some limited trouble in evaluating the usage of the functions. &lt;/P&gt;&lt;P&gt;1) It seemd for double data type the only function to use is the sin()&lt;/P&gt;&lt;P&gt;2) If I use the sinf() the hardware support is automatically used???&lt;/P&gt;&lt;P&gt;3) Is the arm_sin_f32()&amp;nbsp; better than the sinf() ? Precision wise ???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to be sure the FPU is used. What is the way to verify??? Maybe looking the disassembled code for some floating point instruction....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will pleasantly book some advice on the subject&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Feb 2016 17:35:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470644#M28430</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2016-02-19T17:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point on k6xx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470645#M28431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Pietro,&lt;/P&gt;&lt;P&gt;As you said that the Kinetis family K64 has FPU module, which supports float operation. The Floating-Point Unit (FPU) provides IEEE754-compliant operations on single-precision, 32-bit, floating-point values. But the FPU does not support 64 bits double operation.&lt;/P&gt;&lt;P&gt;The CMSIS library only support arm_sin_f32(), arm_sin_q15() anf arm_sin_q31() data format sin operation, but the CMSIS does not support double data format operation either.&lt;/P&gt;&lt;P&gt;Regarding the double data format sin() function, of course, the compiler uses software simulation to implement the double data type sin() function. But it is dependent on the compiler tools whether the double data type sin(0 function is implemented or not.&lt;/P&gt;&lt;P&gt;which compiler tools are you using, KDS, codewarrior for mcu, IAR, Keil? you have to consult the compiler individually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Xiangjun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 03:32:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470645#M28431</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-02-22T03:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point on k6xx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470646#M28432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Pietro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the following code based on KDS tools, the f2 return the correct result.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#include "MKV58F22.h"&lt;/P&gt;&lt;P&gt;#include "math.h"&lt;/P&gt;&lt;P&gt;#define PI 3.1415926&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int i = 0;&lt;/P&gt;&lt;P&gt;double f1,f2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Write your code here */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f1=1.23;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2=1.23;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2=f1+f2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f1=PI/4.0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; f2=sin(f1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __asm("nop");&amp;nbsp; //set break point here to observe the result in debugger&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* This for loop should be replaced. By default this loop allows a single stepping. */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (;;) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Never leave main */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2016 09:07:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470646#M28432</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-02-22T09:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point on k6xx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470647#M28433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;&lt;A href="https://community.nxp.com/people/xiangjun.rong"&gt;xiangjun.rong&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;I am trying th get familiar with the FPU, with some help and some try and retry. Thank You&amp;nbsp; for the suggestions. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: bold; font-size: 12.6px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #51626f;"&gt;If You have time, have You tested if the &lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;arm_sin_f32() is better than the sinf() ???&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Thank You&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:49:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470647#M28433</guid>
      <dc:creator>pietrodicastri</dc:creator>
      <dc:date>2016-02-24T17:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Floating point on k6xx</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470648#M28434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Pie,&lt;/P&gt;&lt;P&gt;I think both the function can give correct result, but the &lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;arm_sin_f32() takes short time, but the sinf() takes long time due to the fact that the function is implemented by software simulation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Hope it can help you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-weight: bold; font-size: 14px; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Xiangjun Rong&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 07:43:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Floating-point-on-k6xx/m-p/470648#M28434</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-02-25T07:43:49Z</dc:date>
    </item>
  </channel>
</rss>

