Hi, The patch that Andrew Stubbs sent upstream here: http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02130.html seems to have become stalled after Ramana's question here: http://gcc.gnu.org/ml/gcc-patches/2011-05/msg00291.html This was discussed with ARM personnel (i.e. Lee Smith) at the time the patch was created. AFAICT, our reasoning went like this (Paul, please correct me if I'm just making stuff up): we wish to use aliases for the old and new names for the helpers. The existing __gnu_{f2h,h2f}_{ieee,alternative} helpers take unsigned short arguments, and therefore assume (on function entry) that the values contained in those arguments are zero-extended (although, due to the vagaries of libcall handling in GCC, that may not actually be true -- at the time, this was a latent bug, and may in fact still be). The __aeabi_* helpers are defined to pass/return unadorned "short" values, intending to convey that only the low-order 16 bits of half-float values contain meaningful data. But, that means EABI-conformant callers are also perfectly entitled to sign-extend half-float values before calling our helper functions (although GCC itself won't do that). Using "unsigned int" and taking care to only examine the low-order bits of the value in the helper function itself serves to fix the latent bug, is compatible with existing code, allows us to be conformant with the eabi, and allows use of aliases to make the __gnu and __aeabi functions the same. The patch no longer applied as-is, so I've updated it (attached, re-tested). Note that there are no longer any target-independent changes (though I'm not certain that the symbol versions are still correct). OK to apply? Julian ChangeLog Andrew Stubbs Julian Brown gcc/ * config/arm/arm.c (arm_init_libfuncs): Change __gnu_f2h_ieee to __aeabi_f2h, __gnu_f2h_alternative to __aeabi_f2h_alt, __gnu_h2f_ieee to __aeabi_h2f, and __gnu_h2f_alternative to __aeabi_h2f_alt. libgcc/ * config/arm/fp16.c (__gnu_f2h_internal): Change return type to unsigned int. Change 'sign' variable likewise. (__gnu_h2f_internal): Set to static inline. Change return type to unsigned int. Change 'sign' variable likewise. (ALIAS): New define. (__gnu_f2h_ieee): Change unsigned short to unsigned int. (__gnu_h2f_ieee): Likewise. (__gnu_f2h_alternative): Likewise. (__gnu_h2f_alternative): Likewise. (__aeabi_f2h, __aeabi_h2f): New aliases. (__aeabi_f2h_alt, __aeabi_h2f_alt): Likewise. * config/arm/libgcc-bpabi.ver (__aeabi_f2h, __aeabi_f2h_alt) (__aeabi_h2f, __aeabi_h2f_alt): Set versions. * config/arm/sfp-machine.h (__extendhfsf2): Set to __aeabi_h2f. (__truncsfhf2): Set to __aeabi_f2h. * config/arm/t-bpabi (LIB2ADD_ST): Move fp16.c ... (LIB2ADD): ... to here. * config/arm/t-symbian (LIB2ADD_ST): Move fp16.c ... (LIB2ADD): ... to here. gcc/testsuite/ * g++.dg/ext/arm-fp16/arm-fp16-ops-5.C: Check for __aeabi_h2f and __aeabi_f2h. * g++.dg/ext/arm-fp16/arm-fp16-ops-6.C: Likewise. * gcc.dg/torture/arm-fp16-ops-5.c: Likewise. * gcc.dg/torture/arm-fp16-ops-6.c: Likewise.