Skip to content

Commit

Permalink
Revert "gcc: asm is a keyword not a function."
Browse files Browse the repository at this point in the history
This reverts commit a2d2b7a.

Boy, this was wrong
  • Loading branch information
krono committed Feb 23, 2018
1 parent a2d2b7a commit e2c2962
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions platforms/Cross/plugins/IA32ABI/ppc32abicc.c
Expand Up @@ -245,7 +245,7 @@ thunkEntry(void *thunkp, sqIntptr_t *stackp)
_asm mov edx, dword ptr vhigh;
#elif __GNUC__
#warning ASSEMBLER
//asm ("mov %0,%%edx" : : "m"(vhigh));
//asm("mov %0,%%edx" : : "m"(vhigh));
#else
# error need to load edx with rs->rvs.valint64.high on this compiler
#endif
Expand All @@ -258,7 +258,7 @@ thunkEntry(void *thunkp, sqIntptr_t *stackp)
_asm fld qword ptr valflt64;
#elif __GNUC__
#warning ASSEMBLER
// asm ("fldl %0" : : "m"(valflt64));
// asm("fldl %0" : : "m"(valflt64));
#else
# error need to load %f0 with rs->rvs.valflt64 on this compiler
#endif
Expand Down
2 changes: 1 addition & 1 deletion platforms/Cross/plugins/IA32ABI/x64sysvabicc.c
Expand Up @@ -225,7 +225,7 @@ thunkEntry(long a0, long a1, long a2, long a3, long a4, long a5,
#if _MSC_VER
_asm mov qword ptr valflt64, xmm0;
#elif __GNUC__
asm ("movq %0, %%xmm0" : : "m"(valflt64));
asm("movq %0, %%xmm0" : : "m"(valflt64));
#else
# error need to load %xmm0 with vmcc.rvs.valflt64 on this compiler
#endif
Expand Down
8 changes: 4 additions & 4 deletions platforms/Cross/plugins/Mpeg3Plugin/libmpeg/video/output.c
Expand Up @@ -264,7 +264,7 @@ inline void mpeg3_bgra32_mmx(unsigned long y,
unsigned long v,
unsigned long *output)
{
asm (
asm(
"\n"
"/* Output will be 0x00rrggbb with the 00 trailing so this can also be used */\n"
"/* for bgr24. */\n"
Expand Down Expand Up @@ -307,7 +307,7 @@ inline void mpeg3_601_bgra32_mmx(unsigned long y,
unsigned long v,
unsigned long *output)
{
asm ("\n"
asm("\n"
"/* Output will be 0x00rrggbb with the 00 trailing so this can also be used */\n"
"/* for bgr24. */\n"
" movd (%0), %%mm0; /* Load y 0x00000000000000yy */\n"
Expand Down Expand Up @@ -355,7 +355,7 @@ inline void mpeg3_rgba32_mmx(unsigned long y,
unsigned long v,
unsigned long *output)
{
asm ("\n"
asm("\n"
"/* Output will be 0x00bbggrr with the 00 trailing so this can also be used */\n"
"/* for rgb24. */\n"
" movd (%0), %%mm0; /* Load y 0x00000000000000yy */\n"
Expand Down Expand Up @@ -397,7 +397,7 @@ inline void mpeg3_601_rgba32_mmx(unsigned long y,
unsigned long v,
unsigned long *output)
{
asm ("\n"
asm("\n"
"/* Output will be 0x00bbggrr with the 00 trailing so this can also be used */\n"
"/* for rgb24. */\n"
" movd (%0), %%mm0; /* Load y 0x00000000000000yy */\n"
Expand Down
46 changes: 23 additions & 23 deletions platforms/Mac OS/vm/Developer/sqGnu.h
Expand Up @@ -151,35 +151,35 @@
#if defined(__clang__)
/* clang can't compile specific register assignments */
#elif defined(__mips__)
# define IP_REG asm ("$16")
# define SP_REG asm ("$17")
# define CB_REG asm ("$18")
# define IP_REG asm("$16")
# define SP_REG asm("$17")
# define CB_REG asm("$18")
#elif defined(__sparc__)
# define IP_REG asm ("%l0")
# define SP_REG asm ("%l1")
# define CB_REG asm ("%l2")
# define IP_REG asm("%l0")
# define SP_REG asm("%l1")
# define CB_REG asm("%l2")
#elif defined(__alpha__)
# define IP_REG asm ("$9")
# define SP_REG asm ("$10")
# define CB_REG asm ("$11")
# define IP_REG asm("$9")
# define SP_REG asm("$10")
# define CB_REG asm("$11")
#elif defined(__i386__)
# define IP_REG asm ("%esi")
# define SP_REG asm ("%edi")
# define CB_REG asm ("%ebx")
# define IP_REG asm("%esi")
# define SP_REG asm("%edi")
# define CB_REG asm("%ebx")
#elif defined(__powerpc__) || defined(PPC) || defined(_POWER) || defined(_IBMR2) || defined(__ppc__)
# define FOO_REG asm ("13")
# define JP_REG asm ("14")
# define IP_REG asm ("15")
# define SP_REG asm ("16")
# define CB_REG asm ("17")
# define FOO_REG asm("13")
# define JP_REG asm("14")
# define IP_REG asm("15")
# define SP_REG asm("16")
# define CB_REG asm("17")
#elif defined(__hppa__)
# define IP_REG asm ("%r18")
# define SP_REG asm ("%r17")
# define CB_REG asm ("%r16")
# define IP_REG asm("%r18")
# define SP_REG asm("%r17")
# define CB_REG asm("%r16")
#elif defined(__mc68000__)
# define IP_REG asm ("a5")
# define SP_REG asm ("a4")
# define CB_REG asm ("d7")
# define IP_REG asm("a5")
# define SP_REG asm("a4")
# define CB_REG asm("d7")
#endif

#if !defined(CB_REG)
Expand Down
2 changes: 1 addition & 1 deletion platforms/Mac OS/vm/sqPlatformSpecific.h
Expand Up @@ -207,7 +207,7 @@ extern const pthread_key_t tltiIndex;
# undef EXPORT
# define EXPORT(returnType) __attribute__((visibility("default"))) returnType
# if !defined(VM_LABEL)
# define VM_LABEL(foo) asm ("\n.globl L" #foo "\nL" #foo ":")
# define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
# endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion platforms/iOS/vm/OSX/sqPlatformSpecific.h
Expand Up @@ -175,7 +175,7 @@ extern const pthread_key_t tltiIndex;
# undef EXPORT
# define EXPORT(returnType) __attribute__((visibility("default"))) returnType
# if !defined(VM_LABEL)
# define VM_LABEL(foo) asm ("\n.globl L" #foo "\nL" #foo ":")
# define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
# endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion platforms/unix/vm/sqConfig.h
Expand Up @@ -37,4 +37,4 @@
/* Make the gcc/clang asm keyword available, even when running
* in standard C mode.
*/
#define asm __asm__
#define asm __asm__
2 changes: 1 addition & 1 deletion platforms/win32/plugins/SqueakFFIPrims/sqWin32FFI.c
Expand Up @@ -320,7 +320,7 @@ int ffiCallAddress(int fn)
}
#endif
#ifdef __GNUC__
asm (
asm(
"movl %%ebp, _oldBP\n\t"
"movl %%esp, _oldSP\n\t"
"pushl %%ebx\n\t"
Expand Down
44 changes: 22 additions & 22 deletions platforms/win32/vm/sqGnu.h
Expand Up @@ -116,34 +116,34 @@
especially Intel.
*/
#if defined(__mips__)
# define IP_REG asm ("$16")
# define SP_REG asm ("$17")
# define CB_REG asm ("$18")
# define IP_REG asm("$16")
# define SP_REG asm("$17")
# define CB_REG asm("$18")
#elif defined(__sparc__)
# define IP_REG asm ("%l0")
# define SP_REG asm ("%l1")
# define CB_REG asm ("%l2")
# define IP_REG asm("%l0")
# define SP_REG asm("%l1")
# define CB_REG asm("%l2")
#elif defined(__alpha__)
# define IP_REG asm ("$9")
# define SP_REG asm ("$10")
# define CB_REG asm ("$11")
# define IP_REG asm("$9")
# define SP_REG asm("$10")
# define CB_REG asm("$11")
#elif defined(__i386__)
# define IP_REG asm ("%esi")
# define SP_REG asm ("%edi")
# define CB_REG asm ("%ebx")
//# define JP_REG asm ("%ebx")
# define IP_REG asm("%esi")
# define SP_REG asm("%edi")
# define CB_REG asm("%ebx")
//# define JP_REG asm("%ebx")
#elif defined(PPC) || defined(_POWER) || defined(_IBMR2)
# define IP_REG asm ("26")
# define SP_REG asm ("27")
# define CB_REG asm ("28")
# define IP_REG asm("26")
# define SP_REG asm("27")
# define CB_REG asm("28")
#elif defined(__hppa__)
# define IP_REG asm ("%r18")
# define SP_REG asm ("%r17")
# define CB_REG asm ("%r16")
# define IP_REG asm("%r18")
# define SP_REG asm("%r17")
# define CB_REG asm("%r16")
#elif defined(__mc68000__)
# define IP_REG asm ("a5")
# define SP_REG asm ("a4")
# define CB_REG asm ("d7")
# define IP_REG asm("a5")
# define SP_REG asm("a4")
# define CB_REG asm("d7")
#endif

#if !defined(CB_REG)
Expand Down
2 changes: 1 addition & 1 deletion platforms/win32/vm/sqPlatformSpecific.h
Expand Up @@ -149,7 +149,7 @@ extern const unsigned long tltiIndex;

#if defined(__GNUC__)
# if !defined(VM_LABEL)
# define VM_LABEL(foo) asm ("\n.globl L" #foo "\nL" #foo ":")
# define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
# endif
#endif
#if !defined(VM_LABEL) || COGVM
Expand Down
4 changes: 2 additions & 2 deletions platforms/win32/vm/sqWin32Window.c
Expand Up @@ -1950,8 +1950,8 @@ sqInt ioSetFullScreen(sqInt fullScreen) {
/* GCC generates *optimal* code with a little help */
# define BYTE_SWAP(w) __asm__("bswap %0" : "+r" (w))
# define WORD_SWAP(w) __asm__("roll $16, %0" : "+r" (w))
# define SRC_PIX_REG asm ("%esi")
# define DST_PIX_REG asm ("%edi")
# define SRC_PIX_REG asm("%esi")
# define DST_PIX_REG asm("%edi")
# else /* Not GCC?! Well, it's your own fault ;-) */
# define BYTE_SWAP(w) w = (w<<24) | ((w&0xFF00)<<8) | ((w>>8)&0xFF00) | (w>>24)
# define WORD_SWAP(w) w = (( (unsigned)(w) << 16) | ((unsigned) (w) >> 16))
Expand Down

0 comments on commit e2c2962

Please sign in to comment.