GAS .fpu directive

Renato Golin renato.golin@linaro.org
Thu Aug 14 18:54:00 GMT 2014


Folks,

We seem to be hitting some bugs on the .fpu directive in ARM assembly
files, and I'd like to ask you guys about a seemingly undocumented
behaviour.

It seems GAS accepts .fpu anywhere in the file, and the meaning is
that it can change the FPU type mid-way through an assembly file, or
even in a block. For example:

  .fpu vfp
  vmov.i64  d0, #0 @ selected FPU does not support instruction
 .fpu neon
  vmov.i64  d0, #1 @ ok
  .fpu vfp
  vmov.i64  d0, #2 @ selected FPU does not support instruction

Is that intentional? Is there any real usage for this kind of thing?

I naively assumed that .cpu / .fpu were like .eabi_attribute flags
that would tell what the *file* is, because normally one assembly
won't run on different machines at the same time.

The only use case I can think of is if there is a conditional jump
based on the existence of instructions, so a block that has neon is
only executed if there's no exception, but that still doesn't need a
.fpu vfp somewhere else.

cheers,
--renato



More information about the Binutils mailing list