]> granicus.if.org Git - clang/commitdiff
Intrin.h: implement __emul and __emulu
authorHans Wennborg <hans@hanshq.net>
Wed, 14 Oct 2015 16:24:28 +0000 (16:24 +0000)
committerHans Wennborg <hans@hanshq.net>
Wed, 14 Oct 2015 16:24:28 +0000 (16:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250301 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Headers/Intrin.h

index 4cd38c6bdc758d37e9b8c3b94940ea1fd82a39a6..6c1d0d16eabf078ededa47b0683bbedacf28a6ad 100644 (file)
@@ -431,6 +431,17 @@ __umulh(unsigned __int64 _Multiplier, unsigned __int64 _Multiplicand) {
 
 #endif /* __x86_64__ */
 
+/*----------------------------------------------------------------------------*\
+|* Multiplication
+\*----------------------------------------------------------------------------*/
+static __inline__ __int64 __DEFAULT_FN_ATTRS
+__emul(int __in1, int __in2) {
+  return (__int64)__in1 * (__int64)__in2;
+}
+static __inline__ unsigned __int64 __DEFAULT_FN_ATTRS
+__emulu(unsigned int __in1, unsigned int __in2) {
+  return (unsigned __int64)__in1 * (unsigned __int64)__in2;
+}
 /*----------------------------------------------------------------------------*\
 |* Bit Twiddling
 \*----------------------------------------------------------------------------*/