<?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: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x). in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394020#M185337</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194817"&gt;@magro732&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Sorry I can't find related information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 06:58:27 GMT</pubDate>
    <dc:creator>jingpan</dc:creator>
    <dc:date>2022-01-04T06:58:27Z</dc:date>
    <item>
      <title>Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1387991#M184562</link>
      <description>&lt;P&gt;I am using the MIMXRT1170-EVK board and MCUXpresso IDE and trying&amp;nbsp;to use the assembler instruction for SQRT with double precision on the Cortex-M7. I can get this working for single-precision using:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;float arm_sqrt_f32(float x)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; float returnValue;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; __asm__("VSQRT.F32 %0, %1" : "=t" (returnValue) : "t" (x));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; return returnValue;&lt;BR /&gt;&lt;/SPAN&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Is the VSQRT.F64-instruction available for iMXRT1170? When I use the __asm__-keyword:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;double arm_sqrt_f64(double x)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; double returnValue;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; __asm__("VSQRT.F64 %0, %1" : "=w" (returnValue) : "w" (x));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; return returnValue;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I get the error message:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;Error: invalid instruction shape -- `vsqrt.f64 s0,s0'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;So it seems to be available but the asm-keyword is not generating the right registers. I found an old post about this in&amp;nbsp;&lt;A href="https://bugs.launchpad.net/gcc-arm-embedded/+bug/1856486" target="_blank" rel="noopener"&gt;Bug #1856486 “constraint “w” produces access to single precissio...” : Bugs : GNU Arm Embedded Toolchain (launchpad.net)&lt;/A&gt;, where it is reported as a bug in GCC but that was several years ago.&lt;/P&gt;&lt;P&gt;How can I enable VSQRT.F64?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 09:01:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1387991#M184562</guid>
      <dc:creator>magro732</dc:creator>
      <dc:date>2021-12-16T09:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1388651#M184616</link>
      <description>&lt;P&gt;I eventually got this working myself by defining my own C-callable assembler function.&lt;/P&gt;&lt;P&gt;But it would still be nice to be able to use GCC inline assembler instead of a seperate .asm-file so if anyone know how to do this, please post me.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 08:29:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1388651#M184616</guid>
      <dc:creator>magro732</dc:creator>
      <dc:date>2021-12-17T08:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1389486#M184737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194817"&gt;@magro732&lt;/a&gt;&amp;nbsp;，&lt;/P&gt;
&lt;P&gt;You can force it as inline.&lt;/P&gt;
&lt;P&gt;__attribute__((always_inline)) inline float arm_sqrt_f32(float x)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 10:11:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1389486#M184737</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2021-12-20T10:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1390078#M184793</link>
      <description>&lt;P&gt;Thanks for your reply but I'm not having problems with the single precision version, it is the double version I have problems with.&lt;/P&gt;&lt;P&gt;Right now I have made a custom assembler function for double precision looking like:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; .global arm_sqrt_f64&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; .section .text&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; .type arm_sqrt_f64,%function&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;arm_sqrt_f64:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; .fnstart&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; vsqrt.f64 d0, d0&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; bx lr&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; .fnend&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;But this function cannot be inlined so I still don't get optimal performance.&lt;/P&gt;&lt;P&gt;Is there a way for me to define a double precision sqrt that is possible to inline?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 10:03:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1390078#M184793</guid>
      <dc:creator>magro732</dc:creator>
      <dc:date>2021-12-21T10:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1390546#M184857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194817"&gt;@magro732&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I modified your code, it can be compiled without any problem.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jingpan_0-1640154053790.png" style="width: 719px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/165919iD7AFBFDEF552EFA4/image-dimensions/719x203?v=v2" width="719" height="203" role="button" title="jingpan_0-1640154053790.png" alt="jingpan_0-1640154053790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 06:23:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1390546#M184857</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2021-12-22T06:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1393674#M185286</link>
      <description>&lt;P&gt;Thanks! This works for me.&lt;/P&gt;&lt;P&gt;Do you know why the standard sqrt included from math.h isn't using this assembler instruction? The single precision version sqrtf is using the assembler instruction but not the double version.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jan 2022 06:49:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1393674#M185286</guid>
      <dc:creator>magro732</dc:creator>
      <dc:date>2022-01-03T06:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394020#M185337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194817"&gt;@magro732&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Sorry I can't find related information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 06:58:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394020#M185337</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2022-01-04T06:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394194#M185353</link>
      <description>&lt;P&gt;Don't you NXP-people think this is a flaw in the library support? If I had not stumbled upon this I would just have used the math.h version of SQRT which is not using the assembler instruction. And the CMSIS-DSP library does not include a 64-bit version of SQRT either.&lt;/P&gt;&lt;P&gt;Should it be necessary to write your own inline-assembler to get full performance for 64-bit SQRT from the M7 processor?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 10:31:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394194#M185353</guid>
      <dc:creator>magro732</dc:creator>
      <dc:date>2022-01-04T10:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394481#M185395</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/194817"&gt;@magro732&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Yes, I agree with you. CMSIS-DAP is released by ARM. But if ARM doesn't add this feature, we can make a patch. I'll escalate your suggestion.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 02:32:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1394481#M185395</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2022-01-05T02:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using native assembler instruction VSQRT.F64 instead of double sqrt(double x).</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1763202#M216325</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We had the same problem trying to use double precision float with the inline assembler for ARM and your solution to use %P &amp;nbsp;worked. So many thanks for your post. Where on Earth did you find out about %P. Try as I might I can't find this wonderful secret documented anywhere.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 08:38:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Using-native-assembler-instruction-VSQRT-F64-instead-of-double/m-p/1763202#M216325</guid>
      <dc:creator>Ahlan</dc:creator>
      <dc:date>2023-11-24T08:38:49Z</dc:date>
    </item>
  </channel>
</rss>

