Float and double, same in ARM and PC

Probably a dumb question, but are the bytes values and order of a float or double identical on ARM compiled with GCC than on a PC compiled with GCC (Delphi, others) ?

The goal is to exchange data files using the same .h definitions.

Angelo

The answer is: It depends…

There are several ways to do floating point calculations on ARM.

There is FPA, VFP, Cirrus MaverickCrunch and EABI soft float.

FPA was the first floating point instruction set.

It has been deprecated. They don’t even mention it in the ARM ARM.

But when you use Linux, it is usually the default, unless you are using one of those chips with Intel Wireless MMX. Linux has an emulator for FPA instructions. You can’t use it with iWMMX because both have the same coprocessor number.

VFP is the current floating point instruction set. It is better than FPA in that it can operate on vectors (comparable to SSE). Last time I checked there was an emulator in Linux that can complete the instruction set of a partial VFP hardware implementation.

Maverick Crunch has many bugs. Few people use it.

ARM EABI defines a platform independent library to do floating point operations. Floats and doubles are passed in integer registers.

The good thing is, they all use IEEE 754 single and double precision.

But if you use FPA, the byte order will be big endian regardless of your cpu’s endianness.

On PCs it’s always little endian IEEE 754.