1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-16 15:11:52 +00:00

When using _asm{} in GCC, one must specify the operand's size if one

specifies the instruction's operation size.  GCC will default to 32-bit
operands reguardless of the prototype (ie, formal parameters' type)
of an inline function.
This commit is contained in:
David E. O'Brien 2000-05-10 01:15:55 +00:00
parent 86e3cfcd92
commit 25f0103084
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60300
2 changed files with 16 additions and 16 deletions

View File

@ -103,15 +103,15 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 9)
/* egcs 1.1.2+ version */
ATOMIC_ASM(set, char, "orb %2,%0", v)
ATOMIC_ASM(clear, char, "andb %2,%0", ~v)
ATOMIC_ASM(add, char, "addb %2,%0", v)
ATOMIC_ASM(subtract, char, "subb %2,%0", v)
ATOMIC_ASM(set, char, "orb %b2,%0", v)
ATOMIC_ASM(clear, char, "andb %b2,%0", ~v)
ATOMIC_ASM(add, char, "addb %b2,%0", v)
ATOMIC_ASM(subtract, char, "subb %b2,%0", v)
ATOMIC_ASM(set, short, "orw %2,%0", v)
ATOMIC_ASM(clear, short, "andw %2,%0", ~v)
ATOMIC_ASM(add, short, "addw %2,%0", v)
ATOMIC_ASM(subtract, short, "subw %2,%0", v)
ATOMIC_ASM(set, short, "orw %w2,%0", v)
ATOMIC_ASM(clear, short, "andw %w2,%0", ~v)
ATOMIC_ASM(add, short, "addw %w2,%0", v)
ATOMIC_ASM(subtract, short, "subw %w2,%0", v)
ATOMIC_ASM(set, int, "orl %2,%0", v)
ATOMIC_ASM(clear, int, "andl %2,%0", ~v)

View File

@ -103,15 +103,15 @@ atomic_##NAME##_##TYPE(volatile u_##TYPE *p, u_##TYPE v)\
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 9)
/* egcs 1.1.2+ version */
ATOMIC_ASM(set, char, "orb %2,%0", v)
ATOMIC_ASM(clear, char, "andb %2,%0", ~v)
ATOMIC_ASM(add, char, "addb %2,%0", v)
ATOMIC_ASM(subtract, char, "subb %2,%0", v)
ATOMIC_ASM(set, char, "orb %b2,%0", v)
ATOMIC_ASM(clear, char, "andb %b2,%0", ~v)
ATOMIC_ASM(add, char, "addb %b2,%0", v)
ATOMIC_ASM(subtract, char, "subb %b2,%0", v)
ATOMIC_ASM(set, short, "orw %2,%0", v)
ATOMIC_ASM(clear, short, "andw %2,%0", ~v)
ATOMIC_ASM(add, short, "addw %2,%0", v)
ATOMIC_ASM(subtract, short, "subw %2,%0", v)
ATOMIC_ASM(set, short, "orw %w2,%0", v)
ATOMIC_ASM(clear, short, "andw %w2,%0", ~v)
ATOMIC_ASM(add, short, "addw %w2,%0", v)
ATOMIC_ASM(subtract, short, "subw %w2,%0", v)
ATOMIC_ASM(set, int, "orl %2,%0", v)
ATOMIC_ASM(clear, int, "andl %2,%0", ~v)