[libc-commits] [PATCH] D152603: [libc] Add math functions to AMD/NVPTX libm

Matt Arsenault via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 11 10:57:51 PDT 2023


arsenm added inline comments.


================
Comment at: libc/src/math/gpu/vendor/amdgpu/declarations.h:26
+float __ocml_exp_f32(float);
+float __ocml_exp2_f32(float);
+float __ocml_exp10_f32(float);
----------------
You don't need exp_f32 or exp2_f32 anymore, the generic builtin is now correctly lowered (we're still asymmetrically missing an intrinsic for exp10). You do still need to wrap the f64 versions


================
Comment at: libc/src/math/gpu/vendor/amdgpu/declarations.h:35-36
+int __ocml_ilogb_f32(float);
+float __ocml_ldexp_f32(float, int);
+double __ocml_ldexp_f64(double, int);
+float __ocml_pow_f32(float, float);
----------------
No reason to wrap ldexp, just use the generic builtin


================
Comment at: libc/src/math/gpu/vendor/amdgpu/declarations.h:39-42
+double __ocml_rint_f64(double);
+float __ocml_rint_f32(float);
+double __ocml_round_f64(double);
+float __ocml_round_f32(float);
----------------
all rint and round can use the generic builtin


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152603



More information about the libc-commits mailing list