Skip to content

Commit b666166

Browse files
committed
Use Motorola-style register names: no % prefix, a6 instead of fp
1 parent 8c6156c commit b666166

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

gcc/config/m68k/human68k.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@ along with GCC; see the file COPYING3. If not see
3232
} \
3333
while (0)
3434

35-
// m68kelf.h provides REGISTER_PREFIX "%" so GCC emits %d0, %sp, etc.
36-
// No need for --register-prefix-optional since all assembly uses % prefix
35+
// Override m68kelf.h REGISTER_PREFIX "%" to emit Motorola-style register names
36+
#undef REGISTER_PREFIX
37+
#define REGISTER_PREFIX ""
38+
39+
// Emit "a6" instead of "fp" for the frame pointer
40+
#undef M68K_FP_REG_NAME
41+
#define M68K_FP_REG_NAME "a6"
42+
43+
// GAS on ELF expects % prefix by default; --register-prefix-optional accepts both
3744
#undef ASM_SPEC
38-
#define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec)"
45+
#define ASM_SPEC "%(asm_cpu_spec) %(asm_pcrel_spec) --register-prefix-optional"
3946

4047
#undef LINK_SPEC
4148
#define LINK_SPEC "-q"

0 commit comments

Comments
 (0)