Add back the stuff I accidentilly removed with the last sync
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 20 Jun 2009 19:52:29 +0000 (19:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 20 Jun 2009 19:52:29 +0000 (19:52 +0000)
svn path=/branches/ros-amd64-bringup/; revision=41494

reactos/include/crt/mingw32/intrin_x86.h

index 5f6eee5..f23bb34 100644 (file)
@@ -74,6 +74,10 @@ extern "C" {
 #define _AddressOfReturnAddress() (&(((void **)(__builtin_frame_address(0)))[1]))
 /* TODO: __getcallerseflags but how??? */
 
+/* Maybe the same for x86? */
+#ifdef _x86_64
+#define _alloca(s) __builtin_alloca(s)
+#endif
 
 /*** Atomic operations ***/
 
@@ -970,6 +974,23 @@ __INTRIN_INLINE unsigned long long __emulu(const unsigned int a, const unsigned
        return retval;
 }
 
+#ifdef _M_AMD64
+
+static __inline__ __attribute__((always_inline)) __int64 __mulh(__int64 a, __int64 b)
+{
+       __int64 retval;
+       __asm__("imulq %[b]" : "=d" (retval) : [a] "a" (a), [b] "rm" (b));
+       return retval;
+}
+
+static __inline__ __attribute__((always_inline)) unsigned __int64 __umulh(unsigned __int64 a, unsigned __int64 b)
+{
+       unsigned __int64 retval;
+       __asm__("mulq %[b]" : "=d" (retval) : [a] "a" (a), [b] "rm" (b));
+       return retval;
+}
+
+#endif
 
 /*** Port I/O ***/
 __INTRIN_INLINE unsigned char __inbyte(const unsigned short Port)