[PATCH] D156178: [HLSL] add pow library function

Justin Bogner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 24 16:38:07 PDT 2023


bogner added a comment.

Looking at https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-pow, it seems a bit underspecified, but do we need to worry about differences between that spec and IEEE behaviour here? For example, it says there that `x<0, y=any -> NaN`, but we'll only generate `NaN` for non-integer `y` in these cases as per https://en.cppreference.com/w/c/numeric/math/pow



================
Comment at: clang/test/CodeGenHLSL/builtins/pow.hlsl:10
+// CHECK: call half @llvm.pow.f16(
+// NO_HALF: define noundef float @"?test_pow_half@@YA$halff@$halff at 0@Z"(
+// NO_HALF: call float @llvm.pow.f32(
----------------
Why check the function name in the no-half case but not the other check?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156178



More information about the cfe-commits mailing list