pengfei created this revision.
pengfei added reviewers: probinson, craig.topper, RKSimon.
Herald added a project: All.
pengfei requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
We cannot lower it to mulx at the present due to backend reason.
Since GCC doesn't support it on 64-bit, it's OK to leave it 32-bit only.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D153681
Files:
clang/lib/Headers/bmi2intrin.h
Index: clang/lib/Headers/bmi2intrin.h
===================================================================
--- clang/lib/Headers/bmi2intrin.h
+++ clang/lib/Headers/bmi2intrin.h
@@ -35,14 +35,6 @@
return __builtin_ia32_pext_si(__X, __Y);
}
-static __inline__ unsigned int __DEFAULT_FN_ATTRS
-_mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
-{
- unsigned long long __res = (unsigned long long) __X * __Y;
- *__P = (unsigned int)(__res >> 32);
- return (unsigned int)__res;
-}
-
#ifdef __x86_64__
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
@@ -72,7 +64,17 @@
return (unsigned long long) __res;
}
-#endif /* __x86_64__ */
+#else /* !__x86_64__ */
+
+static __inline__ unsigned int __DEFAULT_FN_ATTRS
+_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
+{
+ unsigned long long __res = (unsigned long long) __X * __Y;
+ *__P = (unsigned int) (__res >> 32);
+ return (unsigned int) __res;
+}
+
+#endif /* !__x86_64__ */
#undef __DEFAULT_FN_ATTRS
Index: clang/lib/Headers/bmi2intrin.h
===================================================================
--- clang/lib/Headers/bmi2intrin.h
+++ clang/lib/Headers/bmi2intrin.h
@@ -35,14 +35,6 @@
return __builtin_ia32_pext_si(__X, __Y);
}
-static __inline__ unsigned int __DEFAULT_FN_ATTRS
-_mulx_u32(unsigned int __X, unsigned int __Y, unsigned int *__P)
-{
- unsigned long long __res = (unsigned long long) __X * __Y;
- *__P = (unsigned int)(__res >> 32);
- return (unsigned int)__res;
-}
-
#ifdef __x86_64__
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
@@ -72,7 +64,17 @@
return (unsigned long long) __res;
}
-#endif /* __x86_64__ */
+#else /* !__x86_64__ */
+
+static __inline__ unsigned int __DEFAULT_FN_ATTRS
+_mulx_u32 (unsigned int __X, unsigned int __Y, unsigned int *__P)
+{
+ unsigned long long __res = (unsigned long long) __X * __Y;
+ *__P = (unsigned int) (__res >> 32);
+ return (unsigned int) __res;
+}
+
+#endif /* !__x86_64__ */
#undef __DEFAULT_FN_ATTRS
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits