[clang] [llvm] [HLSL] Implementation of dot intrinsic (PR #81190)

Farzon Lotfi via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 09:10:46 PST 2024


================
@@ -0,0 +1,202 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// RUN:   dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN:   -emit-llvm -disable-llvm-passes -O3 -o - | FileCheck %s
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
+// 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
----------------
farzonl wrote:

You are correct only lines 140-170 for the half cases are going to be different. They are supposed to be the same except for the float16 cases. I'm not sure I agree with the suggestion, `NO_HALF` is how we are doing all the other intrinsics I don't understand why this needs to be a special case..,

That said I can model these tests more like sin.hlsl where we only do the half checks on the half code:
https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGenHLSL/builtins/sin.hlsl#L8C1-L35C2

And not like https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGenHLSL/builtins/max.hlsl where we do it on every test case if you think that would add some clarity.

https://github.com/llvm/llvm-project/pull/81190


More information about the cfe-commits mailing list