[PATCH] D156178: [HLSL] add pow library function
Joshua Batista via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 24 16:23:01 PDT 2023
bob80905 added inline comments.
================
Comment at: clang/test/CodeGenHLSL/builtins/pow.hlsl:6
+// RUN: dxil-pc-shadermodel6.3-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -D__HLSL_ENABLE_16_BIT -o - | FileCheck %s --check-prefix=NO_HALF
+
----------------
beanz wrote:
> Does this need to set `-D__HLSL_ENABLE_16_BIT`? If 16-bit types are disabled, this should result in `half` being 32-bit right?
The define is necessary (the test fails otherwise) because without the definition, the definition of "half4" wouldn't exist (half4 is defined in hlsl_intrinsics.h).
To your second question, yes, I think that's correct.
================
Comment at: clang/test/CodeGenHLSL/builtins/pow.hlsl:12
+// NO_HALF: call float @llvm.pow.f32(
+half test_pow_half(half p0, half p1)
+{
----------------
beanz wrote:
> nit: can you clang-format this source?
Will do
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