[clang] [llvm] [Matrix] Implement matrix support for the `abs` intrinsic (PR #227131)
Farzon Lotfi via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 29 18:25:31 PDT 2026
================
@@ -0,0 +1,564 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type \
+// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: --check-prefixes=CHECK,NATIVE_HALF
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: spirv-unknown-vulkan-library %s -emit-llvm -disable-llvm-passes \
+// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF
+
+#ifdef __HLSL_ENABLE_16_BIT
+// NATIVE_HALF-LABEL: test_abs_short1x2
+// NATIVE_HALF: call <2 x i16> @llvm.abs.v2i16(<2 x i16> %{{.*}}, i1 false)
+int16_t1x2 test_abs_short1x2(int16_t1x2 p0) { return abs(p0); }
----------------
farzonl wrote:
this file really seems like overkill. I think maybe this made more sense before we did the tablegen definition of generate matrix overloads because it was possible to miss an api via hand written definitions. I won't hold the pr up for this but do think we need to have a more streamlined set of tests.
https://github.com/llvm/llvm-project/pull/227131
More information about the llvm-commits
mailing list