[compiler-rt] [compiler-rt] Emit wrapper function for __eqsf2, __eqdf2 for SPIR-V (PR #215957)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 12 22:53:06 PDT 2026
https://github.com/jinge90 created https://github.com/llvm/llvm-project/pull/215957
None
>From 5dd156efc67cb3b0d0e73395c344b49d8ef1067e Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Thu, 13 Aug 2026 13:49:19 +0800
Subject: [PATCH] [compiler-rt] Emit wrapper function for __eqsf2, __eqdf2 for
SPIR-V
Signed-off-by: jinge90 <ge.jin at intel.com>
---
compiler-rt/lib/builtins/comparedf2.c | 6 +++---
compiler-rt/lib/builtins/comparesf2.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/compiler-rt/lib/builtins/comparedf2.c b/compiler-rt/lib/builtins/comparedf2.c
index e1fc12c54d48a..f796e201022c2 100644
--- a/compiler-rt/lib/builtins/comparedf2.c
+++ b/compiler-rt/lib/builtins/comparedf2.c
@@ -67,9 +67,9 @@ COMPILER_RT_ALIAS(__unorddf2, __aeabi_dcmpun)
#endif
#endif
-#if defined(_WIN32) && !defined(__MINGW32__)
-// The alias mechanism doesn't work on Windows except for MinGW, so emit
-// wrapper functions.
+#if (defined(_WIN32) && !defined(__MINGW32__)) || defined(__SPIRV__)
+// The alias mechanism doesn't work on Windows (except for MinGW) or SPIR-V, so
+// emit wrapper functions.
int __eqdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
int __ltdf2(fp_t a, fp_t b) { return __ledf2(a, b); }
int __nedf2(fp_t a, fp_t b) { return __ledf2(a, b); }
diff --git a/compiler-rt/lib/builtins/comparesf2.c b/compiler-rt/lib/builtins/comparesf2.c
index b8a955448f574..81f5e08679f8c 100644
--- a/compiler-rt/lib/builtins/comparesf2.c
+++ b/compiler-rt/lib/builtins/comparesf2.c
@@ -67,9 +67,9 @@ COMPILER_RT_ALIAS(__unordsf2, __aeabi_fcmpun)
#endif
#endif
-#if defined(_WIN32) && !defined(__MINGW32__)
-// The alias mechanism doesn't work on Windows except for MinGW, so emit
-// wrapper functions.
+#if (defined(_WIN32) && !defined(__MINGW32__)) || defined(__SPIRV__)
+// The alias mechanism doesn't work on Windows (except for MinGW) or SPIR-V, so
+// emit wrapper functions.
int __eqsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
int __ltsf2(fp_t a, fp_t b) { return __lesf2(a, b); }
int __nesf2(fp_t a, fp_t b) { return __lesf2(a, b); }
More information about the llvm-commits
mailing list