This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1 of 1] gcc: support 'softfp' toolchains for ARM


Harold, Javier, Benoît, All,

On Thursday 01 September 2011 11:38:06 Harold Grovesteen wrote:
> > I don't know about a target that supports softfp. Either they have an FPU,
> > or none at all. I don't think any architecture but ARM supports softfp...
> 
> s390 supports soft ftp for older hardware versions that did not have
> IEEE binary floating point hardware.
> http://gcc.gnu.org/onlinedocs/gcc/S_002f390-and-zSeries-Options.html

'softfp' in the ARM world means:
  use hardware FP instructions, but pass floats and doubles in integer
  registers when calling functions

What you point to is, if I read correctly, about pure software floating
point emulation.

For ARM, 'softfp' is usefull for code that mixes hardware and software
floating point, because the ABI is consistent. As a programmer, you don't
have to care if the library you are calling uses soft float, or hard float.

The downside is that, before using the hard float instructions, floats and
doubles have to be moved from integer registers to a float register, and
back again after the instruction, which can amount to quite a bit of work
and latency (~20 cycles to move a float in either way, so adding to floats
incurs approximately ~20+20 cycles before the instruction, and ~20 cycles
after, which is ~60 cycles overhead for a simple addition...)

> Linux can also use software emulation if software uses the hardware
> floating point instructions and the processor does not support them.

Yes, but in-kernel emulation is much slower than software floating point.
And this is (mostly) orthogonal to the ABI being used.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]