bob80905 created this revision.
bob80905 added reviewers: python3kgae, beanz.
Herald added a subscriber: Anastasia.
Herald added a project: All.
bob80905 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Add codegen for llvm log elementwise builtin
The log elementwise builtin is necessary for HLSL codegen.
Tests were added to make sure that the expected errors are encountered when
these functions are given inputs of incompatible types.
The new builtin is restricted to floating point types only.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D140489
Files:
clang/docs/LanguageExtensions.rst
clang/docs/ReleaseNotes.rst
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -845,6 +845,7 @@
unsafe floating-point optimizations use ``-funsafe-math-optimizations`` or
``-ffast-math`` instead.
- Add ``__builtin_elementwise_sin`` and ``__builtin_elementwise_cos`` builtins
for floating point types only.
+- Add ``__builtin_elementwise_log``builtin for floating point types only.
Internal API Changes
--------------------
Index: clang/docs/LanguageExtensions.rst
===================================================================
--- clang/docs/LanguageExtensions.rst
+++ clang/docs/LanguageExtensions.rst
@@ -635,6 +635,7 @@
T __builtin_elementwise_sin(T x) return the sine of x interpreted
as an angle in radians floating point types
T __builtin_elementwise_cos(T x) return the cosine of x
interpreted as an angle in radians floating point types
T __builtin_elementwise_floor(T x) return the largest integral value
less than or equal to x floating point types
+ T __builtin_elementwise_log(T x) return the natural logarithm of x
floating point types
T __builtin_elementwise_roundeven(T x) round x to the nearest integer
value in floating point format, floating point types
rounding halfway cases to even
(that is, to the nearest value
that is an even integer),
regardless of the current rounding
Index: clang/docs/ReleaseNotes.rst
===================================================================
--- clang/docs/ReleaseNotes.rst
+++ clang/docs/ReleaseNotes.rst
@@ -845,6 +845,7 @@
unsafe floating-point optimizations use ``-funsafe-math-optimizations`` or
``-ffast-math`` instead.
- Add ``__builtin_elementwise_sin`` and ``__builtin_elementwise_cos`` builtins for floating point types only.
+- Add ``__builtin_elementwise_log``builtin for floating point types only.
Internal API Changes
--------------------
Index: clang/docs/LanguageExtensions.rst
===================================================================
--- clang/docs/LanguageExtensions.rst
+++ clang/docs/LanguageExtensions.rst
@@ -635,6 +635,7 @@
T __builtin_elementwise_sin(T x) return the sine of x interpreted as an angle in radians floating point types
T __builtin_elementwise_cos(T x) return the cosine of x interpreted as an angle in radians floating point types
T __builtin_elementwise_floor(T x) return the largest integral value less than or equal to x floating point types
+ T __builtin_elementwise_log(T x) return the natural logarithm of x floating point types
T __builtin_elementwise_roundeven(T x) round x to the nearest integer value in floating point format, floating point types
rounding halfway cases to even (that is, to the nearest value
that is an even integer), regardless of the current rounding
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits