[compiler-rt] r359835 - Fix check-builtins on Windows after alias changes
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Thu May 2 15:11:55 PDT 2019
Author: rnk
Date: Thu May 2 15:11:55 2019
New Revision: 359835
URL: http://llvm.org/viewvc/llvm-project?rev=359835&view=rev
Log:
Fix check-builtins on Windows after alias changes
Modified:
compiler-rt/trunk/lib/builtins/comparedf2.c
compiler-rt/trunk/lib/builtins/comparesf2.c
compiler-rt/trunk/test/builtins/Unit/compiler_rt_logb_test.c
Modified: compiler-rt/trunk/lib/builtins/comparedf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/comparedf2.c?rev=359835&r1=359834&r2=359835&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/comparedf2.c (original)
+++ compiler-rt/trunk/lib/builtins/comparedf2.c Thu May 2 15:11:55 2019
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_dcmpun(fp_t a, f
COMPILER_RT_ALIAS(__unorddf2, __aeabi_dcmpun)
#endif
#endif
+
+#if defined(_WIN32)
+// The alias mechanism doesn't work on Windows, 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); }
+int __gtdf2(fp_t a, fp_t b) { return __gedf2(a, b); }
+#endif
Modified: compiler-rt/trunk/lib/builtins/comparesf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/comparesf2.c?rev=359835&r1=359834&r2=359835&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/comparesf2.c (original)
+++ compiler-rt/trunk/lib/builtins/comparesf2.c Thu May 2 15:11:55 2019
@@ -140,3 +140,11 @@ AEABI_RTABI int __aeabi_fcmpun(fp_t a, f
COMPILER_RT_ALIAS(__unordsf2, __aeabi_fcmpun)
#endif
#endif
+
+#if defined(_WIN32)
+// The alias mechanism doesn't work on Windows, 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); }
+int __gtsf2(fp_t a, fp_t b) { return __gesf2(a, b); }
+#endif
Modified: compiler-rt/trunk/test/builtins/Unit/compiler_rt_logb_test.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/builtins/Unit/compiler_rt_logb_test.c?rev=359835&r1=359834&r2=359835&view=diff
==============================================================================
--- compiler-rt/trunk/test/builtins/Unit/compiler_rt_logb_test.c (original)
+++ compiler-rt/trunk/test/builtins/Unit/compiler_rt_logb_test.c Thu May 2 15:11:55 2019
@@ -35,11 +35,15 @@ double cases[] = {
-0.0, 0.0, 1, -2, 2, -0.5, 0.5,
};
+#ifndef __GLIBC_PREREQ
+#define __GLIBC_PREREQ(x, y) 0
+#endif
+
int main() {
// Do not the run the compiler-rt logb test case if using GLIBC version
// < 2.23. Older versions might not compute to the same value as the
// compiler-rt value.
-#if !defined(__GLIBC__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 23))
+#if __GLIBC_PREREQ(2, 23)
const unsigned N = sizeof(cases) / sizeof(cases[0]);
unsigned i;
for (i = 0; i < N; ++i) {
More information about the llvm-commits
mailing list