Explorar el Código

bug fixed: generate "add.l #65536,a1" rather than "lea 65536(a1),a1".
The latter form is only generated for constants that fit in a word.

bal hace 40 años
padre
commit
46dc90f366
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7 1
      mach/m68k2/cg/table

+ 7 - 1
mach/m68k2/cg/table

@@ -1048,7 +1048,8 @@ adp $1 >= 1 && $1 <= 8
 ...	| ADDSCR |	"add.l #$1,%[1]"
 			erase(%[1])
 			setcc(%[1])			| %[1] | |
-adp	| nocoercions: EXTERNAL_ADDR | | {EXTERNAL_ADDR,%[1.off] + "+"
+adp $1 >= 0-32767 && $1 <= 32767
+	| nocoercions: EXTERNAL_ADDR | | {EXTERNAL_ADDR,%[1.off] + "+"
 						+ tostring($1)} | |
 ...	| nocoercions: LOCAL_ADDR | | {LOCAL_ADDR,%[1.off]+$1} | |
 ...	| nocoercions: REGOFF_ADDR | | {REGOFF_ADDR,%[1.reg],%[1.off]+$1}  | |
@@ -1056,6 +1057,11 @@ adp	| nocoercions: EXTERNAL_ADDR | | {EXTERNAL_ADDR,%[1.off] + "+"
 ...	| ADDSCR |	"lea $1(%[1]),%[1]"
 			erase(%[1])
 			setcc(%[1])			| %[1] | |
+adp	| nocoercions: EXTERNAL_ADDR | | {EXTERNAL_ADDR,%[1.off] + "+"
+						+ tostring($1)} | |
+...	| ADDSCR |	"add.l #$1,%[1]"
+			erase(%[1])
+			setcc(%[1])			| %[1] | |
 			
 /* The next patterns are for efficient translation of "*p++" in C */
 ldl ldl adp sdl $1 == $2 && $2 == $4 | |