Author: tkreuzer
Date: Thu Sep 4 15:55:46 2008
New Revision: 35951
URL:
http://svn.reactos.org/svn/reactos?rev=35951&view=rev
Log:
Remove hacks from __addgsbyte, __addgsword, __addgsdword. They are correct on ms compiler.
(fs ones still broken on x86 compiler that comes with the wdk). Implement __addgsqword.
Modified:
branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] Thu Sep 4
15:55:46 2008
@@ -650,29 +650,24 @@
__asm__ __volatile__("incl %%gs:%a[Offset]" : : [Offset] "ir"
(Offset) : "memory");
}
-/* NOTE: the bizarre implementation of __addgsxxx mimics the broken Visual C++ behavior
*/
static __inline__ __attribute__((always_inline)) void __addgsbyte(const unsigned long
Offset, const unsigned char Data)
{
- if(!__builtin_constant_p(Offset))
- __asm__ __volatile__("addb %k[Offset], %%gs:%a[Offset]" : : [Offset]
"r" (Offset) : "memory");
- else
- __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
+ __asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
}
static __inline__ __attribute__((always_inline)) void __addgsword(const unsigned long
Offset, const unsigned short Data)
{
- if(!__builtin_constant_p(Offset))
- __asm__ __volatile__("addw %k[Offset], %%gs:%a[Offset]" : : [Offset]
"r" (Offset) : "memory");
- else
- __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
+ __asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
}
static __inline__ __attribute__((always_inline)) void __addgsdword(const unsigned long
Offset, const unsigned int Data)
{
- if(!__builtin_constant_p(Offset))
- __asm__ __volatile__("addl %k[Offset], %%gs:%a[Offset]" : : [Offset]
"r" (Offset) : "memory");
- else
- __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
+ __asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
+}
+
+static __inline__ __attribute__((always_inline)) void __addgsqword(const unsigned long
Offset, const unsigned __int64 Data)
+{
+ __asm__ __volatile__("addq %k[Data], %%gs:%a[Offset]" : : [Offset]
"ir" (Offset), [Data] "iq" (Data) : "memory");
}
#else