[ros-diffs] [tkreuzer] 46388: [INTRIN_X86] - Add __stosq, __movsq, _bittest64
tkreuzer at svn.reactos.org
tkreuzer at svn.reactos.org
Wed Mar 24 03:23:28 CET 2010
Author: tkreuzer
Date: Wed Mar 24 03:23:27 2010
New Revision: 46388
URL: http://svn.reactos.org/svn/reactos?rev=46388&view=rev
Log:
[INTRIN_X86]
- Add __stosq, __movsq, _bittest64
Modified:
branches/ros-amd64-bringup/reactos/include/crt/mingw32/intrin_x86.h
Modified: branches/ros-amd64-bringup/reactos/include/crt/mingw32/intrin_x86.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/crt/mingw32/intrin_x86.h?rev=46388&r1=46387&r2=46388&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Wed Mar 24 03:23:27 2010
@@ -569,6 +569,18 @@
);
}
+#ifdef _M_AMD64
+__INTRIN_INLINE void __stosq(unsigned __int64 * Dest, const unsigned __int64 Data, size_t Count)
+{
+ __asm__ __volatile__
+ (
+ "rep; stosq" :
+ [Dest] "=D" (Dest), [Count] "=c" (Count) :
+ "[Dest]" (Dest), "a" (Data), "[Count]" (Count)
+ );
+}
+#endif
+
__INTRIN_INLINE void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count)
{
__asm__ __volatile__
@@ -598,6 +610,18 @@
"[Destination]" (Destination), "[Source]" (Source), "[Count]" (Count)
);
}
+
+#ifdef _M_AMD64
+__INTRIN_INLINE void __movsq(unsigned long * Destination, const unsigned long * Source, size_t Count)
+{
+ __asm__ __volatile__
+ (
+ "rep; movsq" :
+ [Destination] "=D" (Destination), [Source] "=S" (Source), [Count] "=c" (Count) :
+ "[Destination]" (Destination), "[Source]" (Source), "[Count]" (Count)
+ );
+}
+#endif
#if defined(_M_AMD64)
/*** GS segment addressing ***/
@@ -790,6 +814,20 @@
return retval;
}
+
+#ifdef _M_AMD64
+__INTRIN_INLINE unsigned char _bittest64(const __int64 * const a, const __int64 b)
+{
+ unsigned char retval;
+
+ if(__builtin_constant_p(b))
+ __asm__("bt %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval) : [a] "mr" (*(a + (b / 64))), [b] "Ir" (b % 64));
+ else
+ __asm__("bt %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval) : [a] "mr" (*a), [b] "r" (b));
+
+ return retval;
+}
+#endif
__INTRIN_INLINE unsigned char _bittestandcomplement(long * const a, const long b)
{
@@ -1420,4 +1458,4 @@
#endif /* KJK_INTRIN_X86_H_ */
-/* EOF */
+/* EOF */
More information about the Ros-diffs
mailing list