https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64532

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to kugan from comment #2)
> x is an integer "w" floating point constraint. I think you need a cast here
> as below.
> 
> __attribute__((noinline)) float s32_to_f32_imm1(int x)
> {
>   float y;
>   __asm__ ("vcvt.f32.s32 %0, %1, #1" : "=w"(y) : "0"((float)x));
>   return y;
> }

Why w means the floating point register.  The instruction vcvt.f32.s32 converts
from signed 32bit int to a 32bit floating point (with an optional shift).  The
inline-asm is correct and 100% valid.

Reply via email to