This is going to be very easy for anybody who knows it, but I can't find the answer in any of the docs I have. I'm trying to find the easiest way to load floating literals to the FPU.
I have done extensive development on ARM7, and lately Cortex-M4 and M7 STM32 CPU types, always using no OS, pure assembly. Right now I am working on an M4 (STM32L4P5). I am a newbie with the FPU, though, and trying to come up to speed fast. I am using the GCC assembler, and have the "-mfpu=vfpv4" switch in my build file.
I can enable the FPU, and then load it with literals like so:
ldr r0,=15
vmov s0,r0
vcvt.f32.u32 s0,s0
and then do math...all that works fine.
I can also load in more difficult floats like so:
vldr.f32 s1,zip
vldr.f32 s2,zap
zip: .float 3.14159
zap: .float 1.234e8
And that works fine as well. The assembler does the conversion to floating representation, so this is actually more efficient at runtime.
What I'm looking for now is (I'm going to feel stupid) the equivalent of the common
ldr r0,=15
but directly loading the FPU registers. For example, Zhu's book "Embedded Systems with ARM Cortex-M" says that I should be able to do
vldr.f32 s0,=3.14159
but the gcc assembler won't take that. how do I represent a decimal number in an inline literal like that?