[all-commits] [llvm/llvm-project] 6e86e1: [libc] Use `rint` builtin for rounding on the GPU ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Jul 10 11:41:30 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e86e11148474e4ecd49dbf0ca5dd9caddcdbd11
      https://github.com/llvm/llvm-project/commit/6e86e11148474e4ecd49dbf0ca5dd9caddcdbd11
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-07-10 (Wed, 10 Jul 2024)

  Changed paths:
    M libc/src/__support/FPUtil/nearest_integer.h

  Log Message:
  -----------
  [libc] Use `rint` builtin for rounding on the GPU (#98345)

Summary:
Previously this went through the generic bit-twiddling implementation
instead of using the dedicated GPU instruction. This patch adds this in
to the utility, mirroring the special-casing of the x64 and aarch
targets. This results in much nicer code. The following example shows
the opencl device libs implementation on the left and the LLVM libc on
the right, https://godbolt.org/z/3ch48ccf5. The libc version is
"branchier", but the results seem similar.



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