[all-commits] [llvm/llvm-project] 112593: [Clang] `constexpr` builtin floating point classif...

Mital Ashok via All-commits all-commits at lists.llvm.org
Sun Aug 18 02:51:03 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 11259343593043c77678b59d420159fcd147a858
      https://github.com/llvm/llvm-project/commit/11259343593043c77678b59d420159fcd147a858
  Author: Mital Ashok <mital at mitalashok.co.uk>
  Date:   2024-08-18 (Sun, 18 Aug 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/Builtins.td
    M clang/lib/AST/ByteCode/InterpBuiltin.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/test/Analysis/builtin_signbit.cpp
    M clang/test/Sema/constant-builtins-2.c

  Log Message:
  -----------
  [Clang] `constexpr` builtin floating point classification / comparison functions (#94118)

As per [P0533R9](https://wg21.link/P0533R9), the corresponding C++
`[c.math.fpclass]` standard library functions for the C macros are now
`constexpr`.

The only classification function that wasn't already `constexpr` was
`__builtin_signbit`.
The floating point comparison functions `__builtin_isgreater`,
`__builtin_isgreaterequal`, `__builtin_isless`, `__builtin_islessequal`,
`__builtin_islessgreater` and `__builtin_isunordered` are now
`constexpr`.
The C23 macro `iseqsig` is not currently supported because
`__bulitin_iseqsig` doesn't exist yet (and C++26 is still currently
based on C18).

This also allows them to be constant folded in C, matching the behaviour
of GCC.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list