[all-commits] [llvm/llvm-project] afa6be: [libc] Fix integer `rint` variants on the GPU (#98...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Jul 8 18:08:07 PDT 2024


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

  Changed paths:
    M libc/src/math/amdgpu/CMakeLists.txt
    M libc/src/math/nvptx/CMakeLists.txt
    M libc/test/src/math/RoundToIntegerTest.h
    M libc/test/src/math/smoke/RoundToIntegerTest.h

  Log Message:
  -----------
  [libc] Fix integer `rint` variants on the GPU (#98095)

Summary:
Currently these are implemented as a static cast on `__builtin_rint()`
to a long. Howver, this is not strictly correct. The standard states
that the output is unspecified, but most implementations, and the LLVM
libc implementation, do some kind of guarantee on this beahvior. This is
not guaranteed by just doing a cast. This patch just uses the generic
versions until we implement `__builitin_lrint` correctly.



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