@lntue Thanks for replying!
I read through the resources that you mentioned, specifically Handbook of Floating-Point Arithmetic, and I found it to go into a fair amount of detail regarding the implementation of floating points, specifically in software.
Reading through the commit
I found that _Float128 is currently not supported by Clang, but it turns out that _Float16 is for a good number of targets (Clang Language Extensions — Clang 19.0.0git documentation).
So, if I understand correctly, what actually is to be done is that we have to check for the macros that compilers define for their half-precision data types(or alternatively check for the number of digits in the significand/mantissa) and assign the types accordingly, in possibly a file named float16.h.
Rest of the headers are generated through adding the required build support to the respective CMakeLists.txt where required, and adding the necessary entries to the API TableGen files.
This task, if no unforeseeable difficulties arise, should be manageable.
In the next task, we would have to implement basic math functions for the Float16 type, support for which is to some extent available in src/__support/FPUtil/ folder. This would be where most of the knowledge gained from the references can be applied, specifically in adding support for rounding functions, which might be required for the implementation of others.
Again, we would need to define the operations separately and add them to the build process as we did for the first stage.
Using hardware instructions to implement specialisations could actually be the trickiest and most time consuming part, as performance and accuracy are both required. However, the last part of implementing higher math functions seems to be the most interesting! It would be really a fun process to add support for binary16 format to them, and then testing for the correct output.
If everything that I wrote above seems good, can I then start working on the proposal and share a first draft here? It would be really great to hear your suggestions and advice, to create as good a proposal as I possibly can!
Thanks a lot!