[all-commits] [llvm/llvm-project] 52818f: [Clang][FP16] Add 4 builtins for _Float16

Phoebe Wang via All-commits all-commits at lists.llvm.org
Sun Jun 5 18:00:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52818fd97f0f2b13d12e66de9f06b9f4cbc0be07
      https://github.com/llvm/llvm-project/commit/52818fd97f0f2b13d12e66de9f06b9f4cbc0be07
  Author: Phoebe Wang <phoebe.wang at intel.com>
  Date:   2022-06-06 (Mon, 06 Jun 2022)

  Changed paths:
    M clang/include/clang/Basic/Builtins.def
    M clang/lib/AST/ExprConstant.cpp
    A clang/test/CodeGen/builtin_Float16.c

  Log Message:
  -----------
  [Clang][FP16] Add 4 builtins for _Float16

We are lacking builtins support for `_Float16`. In most cases, we can use other floating-type builtins and truncate them to `_Float16`.
But it's a problem to SNaN, e.g., https://gcc.godbolt.org/z/cqr5nG1jh
This patch adds `__builtin_nansf16` support as well as other 3 ones since they are usually used together.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D127050




More information about the All-commits mailing list