I am using the MIMXRT1170-EVK board and MCUXpresso IDE and trying to use the assembler instruction for SQRT with double precision on the Cortex-M7. I can get this working for single-precision using:
float arm_sqrt_f32(float x)
{
float returnValue;
__asm__("VSQRT.F32 %0, %1" : "=t" (returnValue) : "t" (x));
return returnValue;
}
Is the VSQRT.F64-instruction available for iMXRT1170? When I use the __asm__-keyword:
double arm_sqrt_f64(double x)
{
double returnValue;
__asm__("VSQRT.F64 %0, %1" : "=w" (returnValue) : "w" (x));
return returnValue;
}
I get the error message:
Error: invalid instruction shape -- `vsqrt.f64 s0,s0'
So it seems to be available but the asm-keyword is not generating the right registers. I found an old post about this in Bug #1856486 “constraint “w” produces access to single precissio...” : Bugs : GNU Arm Embedded Toolc..., where it is reported as a bug in GCC but that was several years ago.
How can I enable VSQRT.F64?