On Tue, 30 Mar 2010, Paulo J. Matos wrote:

> GCC is generating a call to floatunsihf when it needs to convert an
> unsigned integer to a float. And this call is being generated because
> I am compiling to a 16bit target, where floats are 32, meaning floats
> are HFmode.

No, HFmode only exists if you specifically define it to exist for a 
target.  Unless you really know what you are doing, you should not define 
it until you have ordinary float (SFmode) working.  If HFmode calls are 
generated without having defined it as a target-specific mode, something 
is wrong you need to resolve.

The basic unit for machine modes is QImode, meaning one byte - 
BITS_PER_UNIT bits (8 bits unless you know exactly what you are doing and 
are prepared to fix many broken and bit-rotten cases in 
machine-independent code).  HImode and HFmode are modes of 2*BITS_PER_UNIT 
bits.  SImode and SFmode are modes of 4*BITS_PER_UNIT bits.  So presuming 
BITS_PER_UNIT is 8, a 32-bit float should be SFmode; a 16-bit integer 
value should be HImode (for any target with 8-bit bytes, whatever the word 
size).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to