]> Shamusworld >> Repos - rmac/commitdiff
Fix movep size optimising when +o3 is enabled. Show available optimisations in the...
authorggn <ggn.dbug@gmail.com>
Tue, 18 Apr 2017 14:22:48 +0000 (17:22 +0300)
committerShamus Hammons <jlhamm@acm.org>
Wed, 19 Apr 2017 02:00:37 +0000 (21:00 -0500)
eagen0.c
mach.c
mach.h
rmac.c

index 1c359b9d4d056108123165e8edfd846a3b699620..a9b6f7ee496a181cb43384eae8c7af2835b6dc09 100644 (file)
--- 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 69be7ea471873d11f8735b52dc75f09f7b52e192..ca7e17c7d3bd546b291be3ac9bf217205050a314 100644 (file)
--- 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 46b5db3cd6a3c6f68ca4f9d1aee0162a8cb2b2c6..834f3bd2cc5b0098611678ee061364ee86f37176 100644 (file)
--- 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 5842792087b00ada698fb54eaf5ecdccfed04b9d..084f898aa09fd760cb89ba89315342f9230b79d2 100644 (file)
--- 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"