6502/65c816: introduce a regptr hint
authorAlan Cox <alan@linux.intel.com>
Thu, 14 Dec 2017 13:43:52 +0000 (13:43 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 14 Dec 2017 13:43:52 +0000 (13:43 +0000)
We need this because cc65 writes *far* better code if you tell it to mark
key structure pointers as register so it can then use zp based offset addressing
on them

Kernel/cpu-6502/cpu.h
Kernel/cpu-65c816/cpu.h

index 009ad94..9c3ce28 100644 (file)
@@ -62,3 +62,6 @@ typedef union {            /* this structure is endian dependent */
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
 
 #define CPUTYPE        CPUTYPE_6502
+
+/* cc65 really wants register tags on struct pointers used repeatedly */
+#define regptr register
index de24ec4..e582004 100644 (file)
@@ -75,3 +75,6 @@ typedef union {            /* this structure is endian dependent */
 #define ntohs(x)       ((((x) & 0xFF) << 8) | (((x) & 0xFF00) >> 8))
 
 #define CPUTYPE        CPUTYPE_65C816
+
+/* cc65 really wants structs used repeatedly to be marked register */
+#define regptr register