[PATCH] D145270: Add codegen for llvm exp/exp2 elementwise builtins

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 7 09:13:04 PST 2023


erichkeane added a comment.

Patch itself seems fine enough, but I want to give others a chance to poke at it.  The name makes me grumbly, but if there is sufficient 'prior art' here, I'm ok with it.



================
Comment at: clang/docs/LanguageExtensions.rst:642
  T __builtin_elementwise_log10(T x)          return the base 10 logarithm of x                                floating point types
+ T __builtin_elementwise_exp(T x)            returns the base-e exponential, or e^x, of the specified value   floating point types
+ T __builtin_elementwise_exp2(T x)           returns the base-2 exponential, or 2^x, of the specified value   floating point types
----------------
The naming difference between these is a little clunky, but I dont use these enough to know if this is a common pattern.  Its weird to me that _exp means "e^x", but _exp2 means "2^x".  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145270/new/

https://reviews.llvm.org/D145270



More information about the cfe-commits mailing list