REFACTOR : macro renaming for clarity/readability

This commit is contained in:
Aaron Culliney 2015-02-08 11:27:29 -08:00
parent cf79056b28
commit b246baa90d
3 changed files with 334 additions and 334 deletions

View File

@ -39,8 +39,8 @@
#define RestoreAltZP \
/* Apple //e set stack point to ALTZP (or not) */ \
movLQ SN(base_stackzp), _XAX; \
subLQ SN(base_vmem), _XAX; \
movLQ SYM(base_stackzp), _XAX; \
subLQ SYM(base_vmem), _XAX; \
orLQ _XAX, SP_Reg_X;
#ifdef __LP64__
@ -118,28 +118,28 @@
/* Symbol naming issues */
#ifdef NO_UNDERSCORES
#define SN(foo) foo
#define SNX(foo, INDEX, SCALE) foo(,INDEX,SCALE)
#define SNX_PROLOGUE(foo)
#define E(foo) .globl foo; .balign 16; foo##:
#define SYM(foo) foo
#define SYMX(foo, INDEX, SCALE) foo(,INDEX,SCALE)
#define SYMX_PROLOGUE(foo)
#define ENTRY(foo) .globl foo; .balign 16; foo##:
#define CALL(foo) foo
#else /* !NO_UNDERSCORES */
#if defined(__APPLE__)
# warning "2014/06/22 -- Apple's clang appears to not like certain manipulations of %_h register values (for example %ah, %ch) that are valid on *nix ... and it creates bizarre bytecode
# define APPLE_ASSEMBLER_IS_BROKEN 1
# define SN(foo) _##foo(%rip)
# define SNX(foo, INDEX, SCALE) (_X8,INDEX,SCALE)
# define SYM(foo) _##foo(%rip)
# define SYMX(foo, INDEX, SCALE) (_X8,INDEX,SCALE)
# ifdef __LP64__
# define SNX_PROLOGUE(foo) leaLQ _##foo(%rip), _X8;
# define SYMX_PROLOGUE(foo) leaLQ _##foo(%rip), _X8;
# else
# error "Building 32bit Darwin/x86 is not supported (unless you're a go-getter and make it supported)"
# endif
# define E(foo) .globl _##foo; .balign 4; _##foo##:
# define ENTRY(foo) .globl _##foo; .balign 4; _##foo##:
#else
# define SN(foo) _##foo
# define SNX(foo, INDEX, SCALE) _##foo(,INDEX,SCALE)
# define SNX_PROLOGUE(foo)
# define E(foo) .globl _##foo; .balign 16; _##foo##:
# define SYM(foo) _##foo
# define SYMX(foo, INDEX, SCALE) _##foo(,INDEX,SCALE)
# define SYMX_PROLOGUE(foo)
# define ENTRY(foo) .globl _##foo; .balign 16; _##foo##:
#endif
#define CALL(foo) _##foo
#endif /* !NO_UNDERSCORES */

File diff suppressed because it is too large Load Diff

View File

@ -19,33 +19,33 @@
#include "cpu-regs.h"
#define GLUE_BANK_MAYBEREAD(func,pointer) \
E(func) testLQ $SS_CXROM, SN(softswitches); \
ENTRY(func) testLQ $SS_CXROM, SYM(softswitches); \
jnz 1f; \
callLQ *SN(pointer); \
callLQ *SYM(pointer); \
ret; \
1: addLQ SN(pointer),EffectiveAddr_X; \
1: addLQ SYM(pointer),EffectiveAddr_X; \
movb (EffectiveAddr_X),%al; \
subLQ SN(pointer),EffectiveAddr_X; \
subLQ SYM(pointer),EffectiveAddr_X; \
ret;
#define GLUE_BANK_READ(func,pointer) \
E(func) addLQ SN(pointer),EffectiveAddr_X; \
ENTRY(func) addLQ SYM(pointer),EffectiveAddr_X; \
movb (EffectiveAddr_X),%al; \
subLQ SN(pointer),EffectiveAddr_X; \
subLQ SYM(pointer),EffectiveAddr_X; \
ret;
#define GLUE_BANK_WRITE(func,pointer) \
E(func) addLQ SN(pointer),EffectiveAddr_X; \
ENTRY(func) addLQ SYM(pointer),EffectiveAddr_X; \
movb %al,(EffectiveAddr_X); \
subLQ SN(pointer),EffectiveAddr_X; \
subLQ SYM(pointer),EffectiveAddr_X; \
ret;
#define GLUE_BANK_MAYBEWRITE(func,pointer) \
E(func) addLQ SN(pointer),EffectiveAddr_X; \
cmpl $0,SN(pointer); \
ENTRY(func) addLQ SYM(pointer),EffectiveAddr_X; \
cmpl $0,SYM(pointer); \
jz 1f; \
movb %al,(EffectiveAddr_X); \
1: subLQ SN(pointer),EffectiveAddr_X; \
1: subLQ SYM(pointer),EffectiveAddr_X; \
ret;
@ -61,7 +61,7 @@ E(func) addLQ SN(pointer),EffectiveAddr_X; \
#endif
#define GLUE_C_WRITE(func) \
E(func) pushLQ _XAX; \
ENTRY(func) pushLQ _XAX; \
pushLQ XY_Reg_X; \
pushLQ AF_Reg_X; \
pushLQ SP_Reg_X; \
@ -79,7 +79,7 @@ E(func) pushLQ _XAX; \
// TODO FIXME : implement CDECL prologue/epilogues...
#define _GLUE_C_READ(func, ...) \
E(func) pushLQ XY_Reg_X; \
ENTRY(func) pushLQ XY_Reg_X; \
pushLQ AF_Reg_X; \
pushLQ SP_Reg_X; \
pushLQ PC_Reg_X; \