From: ggn Date: Tue, 18 Apr 2017 14:22:48 +0000 (+0300) Subject: Fix movep size optimising when +o3 is enabled. Show available optimisations in the... X-Git-Tag: v2.1.0~141 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=commitdiff_plain;h=f33d7fdb41ccdda027c33c5358a3826bef83967b Fix movep size optimising when +o3 is enabled. Show available optimisations in the usage message. --- diff --git a/eagen0.c b/eagen0.c index 1c359b9..a9b6f7e 100644 --- a/eagen0.c +++ b/eagen0.c @@ -35,7 +35,7 @@ int eaNgen(WORD siz) if (tdb) MarkRelocatable(cursect, sloc, tdb, MWORD, NULL); - if ((v == 0) && optim_flags[OPT_INDIRECT_DISP]) + if ((v == 0) && optim_flags[OPT_INDIRECT_DISP] && !movep) { // If expr is 0, size optimise the opcode. Generally the lower // 6 bits of the opcode for expr(ax) are 101rrr where rrr=the diff --git a/mach.c b/mach.c index 69be7ea..ca7e17c 100644 --- a/mach.c +++ b/mach.c @@ -499,12 +499,13 @@ int m_moveq(WORD inst, WORD siz) return 0; } - +int movep = 0; // Global flag to indicate we're generating a movep instruction // // movep Dn, disp(An) -- movep disp(An), Dn // int m_movep(WORD inst, WORD siz) { + movep = 1; // Tell ea0gen to lay off the 0(a0) optimisations on this one if (siz == SIZL) inst |= 0x0040; @@ -529,6 +530,7 @@ int m_movep(WORD inst, WORD siz) ea0gen(siz); } + movep = 0; return 0; } diff --git a/mach.h b/mach.h index 46b5db3..834f3bd 100644 --- a/mach.h +++ b/mach.h @@ -19,6 +19,7 @@ extern char rel_error[]; extern char range_error[]; extern char abs_error[]; extern MNTAB machtab[]; +extern int movep; #endif // __MACH_H__ diff --git a/rmac.c b/rmac.c index 5842792..084f898 100644 --- a/rmac.c +++ b/rmac.c @@ -134,6 +134,11 @@ void DisplayHelp(void) " -n Don't do things behind your back in RISC assembler\n" " -o file Output file name\n" " +o[value] Turn a specific optimisation on\n" + " Available optimisation values and default settings:\n" + " o0: Absolute long adddresses to word (on)\n" + " o1: move.l #x,dn/an to moveq (on)\n" + " o2: Word branches to short (on)\n" + " o3: Outer displacement 0(an) to (an) (off)\n" " ~o[value] Turn a specific optimisation off\n" " +oall Turn all optimisations on\n" " ~oall Turn all optimisations off\n"