[PATCH] [Builtins] Implement half-precision conversions.

Stephen Canon scanon at apple.com
Tue May 12 03:03:29 PDT 2015


Looks reasonable to me.  Someone else will need to answer your question about gnu_*_ieee aliases.

– Steve

> On May 11, 2015, at 6:39 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com> wrote:
> 
> Hi scanon,
> 
> Mostly uninteresting, except:
> 
> - in __extendXfYf2, when checking if the number is normal, the current code relies on the unsignedness of src_rep_t, which is fine.  Except that when sizeof(src_rep_t) < sizeof(int), the result gets promoted to int, the signedness of which breaks the comparison.  I added an explicit cast to avoid that;  it shouldn't affect other types.
> 
> - we can't just pass __fp16 around (you even get a clang error), so I made uint16_t explicit.
> 
> - is there a good way to define aliases (for the gnu_*_ieee names) ?  Using the attribute, on darwin, clang complains about only weak aliases being supported, so I went with the simple def.
> 
> 
> I also need to finish writing unit tests in compiler-rt proper (I paused when I realized lit+cmake isn't supported).  In the meantime, opinions welcome.
> 
> http://reviews.llvm.org/D9693
> 
> Files:
>  lib/builtins/CMakeLists.txt
>  lib/builtins/extendhfsf2.c
>  lib/builtins/fp_extend.h
>  lib/builtins/fp_extend_impl.inc
>  lib/builtins/fp_trunc.h
>  lib/builtins/truncdfhf2.c
>  lib/builtins/truncsfhf2.c
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> <D9693.25541.patch>





More information about the llvm-commits mailing list