[libc-commits] [libc] [libc] Use intermediate float operations on the GPU (PR #155869)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Thu Aug 28 08:58:49 PDT 2025
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/155869
Summary:
Move the GPU config to the common directory instead of copying it and
enable the intermediate float option in the math library.
>From f7878718bcfac9000b559a7b269ee67f61445bb4 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Thu, 28 Aug 2025 10:53:13 -0500
Subject: [PATCH] [libc] Use intermediate float operations on the GPU
Summary:
Move the GPU config to the common directory instead of copying it and
enable the intermediate float option in the math library.
---
libc/config/gpu/{amdgpu => }/config.json | 2 +-
libc/config/gpu/nvptx/config.json | 45 ------------------------
2 files changed, 1 insertion(+), 46 deletions(-)
rename libc/config/gpu/{amdgpu => }/config.json (84%)
delete mode 100644 libc/config/gpu/nvptx/config.json
diff --git a/libc/config/gpu/amdgpu/config.json b/libc/config/gpu/config.json
similarity index 84%
rename from libc/config/gpu/amdgpu/config.json
rename to libc/config/gpu/config.json
index fa179b849dcf7..434ee042953eb 100644
--- a/libc/config/gpu/amdgpu/config.json
+++ b/libc/config/gpu/config.json
@@ -39,7 +39,7 @@
},
"math": {
"LIBC_CONF_MATH_OPTIMIZATIONS": {
- "value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)"
+ "value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_INTERMEDIATE_COMP_IN_FLOAT | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)"
}
}
}
diff --git a/libc/config/gpu/nvptx/config.json b/libc/config/gpu/nvptx/config.json
deleted file mode 100644
index fa179b849dcf7..0000000000000
--- a/libc/config/gpu/nvptx/config.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "errno": {
- "LIBC_CONF_ERRNO_MODE": {
- "value": "LIBC_ERRNO_MODE_SHARED"
- }
- },
- "threads": {
- "LIBC_CONF_THREAD_MODE": {
- "value": "LIBC_THREAD_MODE_SINGLE"
- }
- },
- "printf": {
- "LIBC_CONF_PRINTF_DISABLE_FLOAT": {
- "value": true
- },
- "LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": {
- "value": true
- },
- "LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
- "value": true
- },
- "LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
- "value": false
- },
- "LIBC_CONF_PRINTF_DISABLE_STRERROR": {
- "value": true
- },
- "LIBC_CONF_PRINTF_RUNTIME_DISPATCH": {
- "value": false
- }
- },
- "scanf": {
- "LIBC_CONF_SCANF_DISABLE_FLOAT": {
- "value": true
- },
- "LIBC_CONF_SCANF_DISABLE_INDEX_MODE": {
- "value": true
- }
- },
- "math": {
- "LIBC_CONF_MATH_OPTIMIZATIONS": {
- "value": "(LIBC_MATH_SKIP_ACCURATE_PASS | LIBC_MATH_SMALL_TABLES | LIBC_MATH_NO_ERRNO | LIBC_MATH_NO_EXCEPT)"
- }
- }
-}
More information about the libc-commits
mailing list