[libc] Add half-precision math functions to the math header - #155060
Merged
Conversation
Member
|
@llvm/pr-subscribers-libc Author: Leandro Lacerda (leandrolcampos) ChangesThis patch adds the Full diff: https://github.com/llvm/llvm-project/pull/155060.diff 1 Files Affected:
diff --git a/libc/include/math.yaml b/libc/include/math.yaml
index 60e6265eece75..6f48e0e9fd35f 100644
--- a/libc/include/math.yaml
+++ b/libc/include/math.yaml
@@ -370,6 +370,13 @@ functions:
return_type: float
arguments:
- type: float
+ - name: exp10f16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: exp10m1f
standards:
- stdc
@@ -395,6 +402,13 @@ functions:
return_type: float
arguments:
- type: float
+ - name: exp2f16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: exp2m1f
standards:
- stdc
@@ -414,6 +428,13 @@ functions:
return_type: float
arguments:
- type: float
+ - name: expf16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: expm1
standards:
- stdc
@@ -426,6 +447,13 @@ functions:
return_type: float
arguments:
- type: float
+ - name: expm1f16
+ standards:
+ - stdc
+ return_type: _Float16
+ arguments:
+ - type: _Float16
+ guard: LIBC_TYPES_HAS_FLOAT16
- name: f16add
standards:
- llvm_libc_ext
|
jhuber6
approved these changes
Aug 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds the
exp10f16,exp2f16,expf16, andexpm1f16math functions to themath.hheader.