llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Enable __bf16

Open ZERICO2005 opened this issue 9 months ago • 0 comments

__bf16 is commonly implemented as a storage format, allowing for a 32bit float to be stored in 16bits. It has the same layout/format as float, but with the lower 16 bits cut off; allowing for conversion between __bf16 and float to be very simple.

I've written routines for _bf16tof and _ftobf16 to handle conversions, however the __bf16 type is not enabled for the eZ80 yet. https://github.com/ZERICO2005/toolchain/tree/add_bf16/src/crt

Additionally, would I need to explicitly define conversion routines to other types (_bf16tod _dtobf16 _bf16tol ltobf16, etc), or would it be best for the compiler to automatically generate the conversions? Currently I have it so __bf16 will wrap the float conversion routines

ZERICO2005 avatar Feb 25 '25 20:02 ZERICO2005