[libclc] [libclc]: clspv: add a dummy implememtation for mul_hi (PR #134094)
Romaric Jodin via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 3 01:51:44 PDT 2025
https://github.com/rjodinchr updated https://github.com/llvm/llvm-project/pull/134094
>From 46d4e40a3142b36811b85ac3d2ececf46d5b8e7c Mon Sep 17 00:00:00 2001
From: Romaric Jodin <rjodin at google.com>
Date: Wed, 2 Apr 2025 17:12:17 +0200
Subject: [PATCH 1/2] [libclc]: clspv: add a dummy implememtation for mul_hi
clspv uses a better implementation that is not using a bigger side
when not available.
Add a dummy implementation for mul_hi to avoid to override the
implementation of clspv with the one in libclc.
---
libclc/clc/lib/clspv/SOURCES | 1 +
libclc/clc/lib/clspv/integer/clc_mul_hi.cl | 0
2 files changed, 1 insertion(+)
create mode 100644 libclc/clc/lib/clspv/integer/clc_mul_hi.cl
diff --git a/libclc/clc/lib/clspv/SOURCES b/libclc/clc/lib/clspv/SOURCES
index b1401f8307a4c..b91b0e70a397d 100644
--- a/libclc/clc/lib/clspv/SOURCES
+++ b/libclc/clc/lib/clspv/SOURCES
@@ -1 +1,2 @@
math/clc_sw_fma.cl
+integer/clc_mul_hi.cl
diff --git a/libclc/clc/lib/clspv/integer/clc_mul_hi.cl b/libclc/clc/lib/clspv/integer/clc_mul_hi.cl
new file mode 100644
index 0000000000000..e69de29bb2d1d
>From a1952cbc08dad20ac812eaede1dd4685b1df7d80 Mon Sep 17 00:00:00 2001
From: Romaric Jodin <rjodin at chromium.org>
Date: Thu, 3 Apr 2025 10:51:35 +0200
Subject: [PATCH 2/2] Update clc_mul_hi.cl
---
libclc/clc/lib/clspv/integer/clc_mul_hi.cl | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libclc/clc/lib/clspv/integer/clc_mul_hi.cl b/libclc/clc/lib/clspv/integer/clc_mul_hi.cl
index e69de29bb2d1d..54a51bbce4303 100644
--- a/libclc/clc/lib/clspv/integer/clc_mul_hi.cl
+++ b/libclc/clc/lib/clspv/integer/clc_mul_hi.cl
@@ -0,0 +1,5 @@
+/*
+Opt-out of libclc mul_hi implementation for clspv.
+clspv has an internal implementation that does not required using a bigger data size.
+That implementation is based on OpMulExtended which is SPIR-V specific, thus it cannot be written in OpenCL-C.
+*/
More information about the cfe-commits
mailing list