<?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 S32K344 Double Precision Support in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1563678#M19199</link>
    <description>&lt;P&gt;I would like to know if the S32K344 FPU supports double precision floating point? Per the S32K3xx datasheet, only single precision is mentioned, which I believe is referenced to&amp;nbsp;&lt;SPAN&gt;fpv5-sp-d16?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Per the ARM Cortex-M7 website, double precision is supported, but only as an option. So, I believe this is up to the MCU manufacturer?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For the&amp;nbsp;S&lt;SPAN&gt;32K344,&lt;/SPAN&gt; I am using NXP's&lt;FONT face="inherit"&gt;&amp;nbsp;GCC 10.2 for Arm 32-bit Bare-Metal compiler that came with the S32DS IDE, which includes a C math library based on doubles. So, I'm wondering how much precision is lost when using the double precision math library on a single precision FPU with the S32K344 (per the S32K3xx datasheet)? Is there a &lt;/FONT&gt;single&lt;FONT face="inherit"&gt;&amp;nbsp;&lt;/FONT&gt;precision&lt;FONT face="inherit"&gt;&amp;nbsp;math library that supports all floats instead of doubles for the S32K344? &lt;/FONT&gt;Or&lt;FONT face="inherit"&gt;&amp;nbsp;do I have to cast all &lt;/FONT&gt;doubles&lt;FONT face="inherit"&gt;&amp;nbsp;to floats and loose precision &lt;/FONT&gt;in regard to&lt;FONT face="inherit"&gt;&amp;nbsp;using the C math library functions? Or does the NXP compiler handle double precision math with additional ARM &lt;/FONT&gt;instructions for the&amp;nbsp;&lt;FONT face="inherit"&gt;single precision FPU&lt;/FONT&gt;&lt;FONT face="inherit"&gt;?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;Thanks.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Dec 2022 19:33:53 GMT</pubDate>
    <dc:creator>tony-atlismv</dc:creator>
    <dc:date>2022-12-02T19:33:53Z</dc:date>
    <item>
      <title>S32K344 Double Precision Support</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1563678#M19199</link>
      <description>&lt;P&gt;I would like to know if the S32K344 FPU supports double precision floating point? Per the S32K3xx datasheet, only single precision is mentioned, which I believe is referenced to&amp;nbsp;&lt;SPAN&gt;fpv5-sp-d16?&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Per the ARM Cortex-M7 website, double precision is supported, but only as an option. So, I believe this is up to the MCU manufacturer?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For the&amp;nbsp;S&lt;SPAN&gt;32K344,&lt;/SPAN&gt; I am using NXP's&lt;FONT face="inherit"&gt;&amp;nbsp;GCC 10.2 for Arm 32-bit Bare-Metal compiler that came with the S32DS IDE, which includes a C math library based on doubles. So, I'm wondering how much precision is lost when using the double precision math library on a single precision FPU with the S32K344 (per the S32K3xx datasheet)? Is there a &lt;/FONT&gt;single&lt;FONT face="inherit"&gt;&amp;nbsp;&lt;/FONT&gt;precision&lt;FONT face="inherit"&gt;&amp;nbsp;math library that supports all floats instead of doubles for the S32K344? &lt;/FONT&gt;Or&lt;FONT face="inherit"&gt;&amp;nbsp;do I have to cast all &lt;/FONT&gt;doubles&lt;FONT face="inherit"&gt;&amp;nbsp;to floats and loose precision &lt;/FONT&gt;in regard to&lt;FONT face="inherit"&gt;&amp;nbsp;using the C math library functions? Or does the NXP compiler handle double precision math with additional ARM &lt;/FONT&gt;instructions for the&amp;nbsp;&lt;FONT face="inherit"&gt;single precision FPU&lt;/FONT&gt;&lt;FONT face="inherit"&gt;?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;Thanks.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 19:33:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1563678#M19199</guid>
      <dc:creator>tony-atlismv</dc:creator>
      <dc:date>2022-12-02T19:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 Double Precision Support</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1563875#M19206</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;K3 like K1 seem having single precision FPU. But if you wonder about S32 DS, it supports software emulated double precission math.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;library based on doubles.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;It isn't based on doubles, it is full featured by default: single precision functions sinf(), cosf(), etc utilizing SP FPU, and double precision functions sin(), cos(), .. using software FP emulation for double precision math.&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;I'm wondering how much precision is lost when using the double precision math library on a single precision FPU with the S32K344 (per the S32K3xx datasheet)?&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hm. If vendor would take source code for DP FP math and just replaced all DP objects with SP objects, it would be not only much slower due to extra pointless multiplies and additions, but as well calculation accuracy would be worse than using SP optimized library.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;Or&lt;/SPAN&gt;&lt;FONT face="inherit"&gt;&amp;nbsp;do I have to cast all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;doubles&lt;/SPAN&gt;&lt;FONT face="inherit"&gt;&amp;nbsp;to floats and loose precision&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;in regard to&lt;/SPAN&gt;&lt;FONT face="inherit"&gt;&amp;nbsp;using the C math library functions?&lt;SPAN&gt;&amp;nbsp;Or does the NXP compiler handle double precision math with additional ARM&amp;nbsp;instructions for the&amp;nbsp;single precision FPU?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Hm, I fear I don't understand these questions.&lt;/P&gt;&lt;P&gt;If you need double precision then just use doubles. If single precision is enough, then just switch Float ABI setting in your project to "FPU SP only". It will make all doubles treated as floats.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kef2_0-1670152281017.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/202817i23DBFC8CB04DB702/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kef2_0-1670152281017.png" alt="kef2_0-1670152281017.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 11:11:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1563875#M19206</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2022-12-04T11:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 Double Precision Support</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1564390#M19227</link>
      <description>&lt;P&gt;S32K3 uses single point floating point configuration (fpv5-sp-d16).&lt;/P&gt;
&lt;P&gt;In the S32DS, there is an option choosing whether floating point operation are software or hardware, anyway double bit precision will be HW emulated.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="davidtosenovjan_0-1670241900010.png" style="width: 712px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/202969i3B061AEE2B17B5C3/image-dimensions/712x443?v=v2" width="712" height="443" role="button" title="davidtosenovjan_0-1670241900010.png" alt="davidtosenovjan_0-1670241900010.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 12:05:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1564390#M19227</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2022-12-05T12:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 Double Precision Support</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1564536#M19234</link>
      <description>&lt;P&gt;Thanks for all of the replies! The information was very helpful!&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 16:37:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-Double-Precision-Support/m-p/1564536#M19234</guid>
      <dc:creator>tony-atlismv</dc:creator>
      <dc:date>2022-12-05T16:37:14Z</dc:date>
    </item>
  </channel>
</rss>

