Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc][stdfix] Use __FRACT_FBIT__ for fixed point support detection instead of compiler version. #81820

Merged
merged 4 commits into from
Feb 15, 2024

Conversation

lntue
Copy link
Contributor

@lntue lntue commented Feb 15, 2024

Now that __FRACT_FBIT__ and related macros are added in #81207, it is safer to use them for fixed point support detection, so that codes that do not use fixed point types will not fail to build when -ffixed-point is missing.

@lntue lntue requested a review from jhuber6 February 15, 2024 04:44
@llvmbot llvmbot added the libc label Feb 15, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 15, 2024

@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-libc

Author: None (lntue)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/81820.diff

1 Files Affected:

  • (modified) libc/utils/gpu/loader/nvptx/CMakeLists.txt (+3)
diff --git a/libc/utils/gpu/loader/nvptx/CMakeLists.txt b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
index 0c76c49fa30985..991ca4749ad39c 100644
--- a/libc/utils/gpu/loader/nvptx/CMakeLists.txt
+++ b/libc/utils/gpu/loader/nvptx/CMakeLists.txt
@@ -4,6 +4,9 @@ add_dependencies(nvptx_loader libc.src.__support.RPC.rpc)
 if(NOT LLVM_ENABLE_RTTI)
   target_compile_options(nvptx_loader PRIVATE -fno-rtti)
 endif()
+if(LIBC_COMPILER_HAS_FIXED_POINT)
+  target_compile_options(amdhsa_loader PRIVATE "-ffixed-point")
+endif()
 target_include_directories(nvptx_loader PRIVATE ${LLVM_INCLUDE_DIRS})
 target_link_libraries(nvptx_loader
   PRIVATE

@lntue lntue changed the title [libc][gpu] Add fixed point compile options to GPUs' loaders. [libc][stdfix] Use __FRACT_FBIT__ for fixed point support detection instead of compiler version. Feb 15, 2024
@jhuber6 jhuber6 merged commit 95e8a7c into llvm:main Feb 15, 2024
3 of 4 checks passed
@lntue lntue deleted the rpc_server branch February 15, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants