[libc-commits] [libc] [libc][NFC] Rename LIBC_COMPILER_HAS_FLOAT128 to LIBC_HAS_FLOAT128 for consistency (PR #81870)

Guillaume Chatelet via libc-commits libc-commits at lists.llvm.org
Fri Feb 16 02:14:06 PST 2024


gchatelet wrote:

> But those were standardized, in C23. `LIBC_COMPILER_HAS_FLOAT128_EXTENSION` is the only thing that appears non-standard to me.

Fair enough. On second thought it's probably not a great idea to distinguish based on "non-standard" features. A compiler extension may be standardized eventually so this can rot over time.

Given what I explained earlier based on the support for types coming from different places, I envision the following modifications:
 - Rename `float.h` into `types.h`
 - Rename all `#define` in this file to `LIBC_TYPES_HAS_...`
   - `LIBC_TYPES_HAS_INT64`
   - `LIBC_TYPES_HAS_FLOAT16`
   - `LIBC_TYPES_HAS_FLOAT128`
 - Don't expose how the type is provided and use `float16` or `float128` solely (i.e. no `LIBC_COMPILER_HAS_FLOAT128_EXTENSION` nor `LIBC_COMPILER_HAS_C23_FLOAT128`). Added benefit of not defining `LIBC_COMPILER_...` outside of the `compiler.h` file.
 - Update the documentation

I'll wait for your input before moving forward with this.

https://github.com/llvm/llvm-project/pull/81870


More information about the libc-commits mailing list