SH optimized software floating point routines

Christian Bruel christian.bruel@st.com
Thu Jul 22 13:58:00 GMT 2010


oops, resending it with a small typo fix (a branch became delayed :-().

Just in case it we accepted that SNaNs and QNaNs are not exclusive and 
mimic the C model, a synthetic illustrative test case:

Compile with
sh-superh-elf-gcc -O2 -mieee -m4-nofpu snan.c snan2.c -g -o l.u ; 
sh-superh-elf-run l.u ; echo $?

Original 4.6 fp-bit C model:
OK

Using the ieee-sf.S implementation:
FAIL

Using the ieee-sf.S + this patch
OK

same for sh4-linux.

Best Regards,

Christian



Christian Bruel wrote:
> Christian Bruel wrote:
>> Hi Kaz,
>>
>> Kaz Kojima wrote:
>>
>>> BTW, it looks that softfp __unord?f2 routines check signaling NaNs
>>> only.  This makes __builtin_isnan return false for quiet NaNs for
>>> which current fp-bit ones return true when -mieee enabled.  Perhaps
>>> that change of behavior might be OK for software FP.
>> I use the attached patch to handle the QNaNs in the assembly solf-fp. 
>> Need to be updated for trunk (and update the dates in changelogs). Will do.
> 
> Edited to apply on top of latest Joern's patch. Certainly not optimal 
> but it fixes the QNaNs checks for builtins and inlined unordered 
> comparisons for -mieee or -fno-inite-math-only.
> 
> Best Regards
> 
> Christian
> 
> 
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qnans_trunk.patch
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20100722/633fdbe6/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: snan.c
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20100722/633fdbe6/attachment.c>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: snan2.c
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20100722/633fdbe6/attachment-0001.c>


More information about the Gcc mailing list