changeset 426:b4825b42c151

Change to engage forwardrefmax pragma by default There are enough cases where the forward reference optimization scheme in lwasm makes assembly painfully slow that it warrants enabling this pragma by default to avoid bug reports about lwasm being too slow. Which is is when you have a lot of forward refences or other instruction sizes that don't reduce on pass one. This gets worse exponentially as the source file size gets bigger. The old behaviour is available to anyone who needs or wants it, though. It does work quite well on smallish files or files that do not have a lot of abiguous instruction sizes. It should be noted that this change does not change the correctness of the code output by lwasm. What it might do is result in slightly larger code if the assembler is forced to select a 16 bit mode when an 8 bit mode will do. However, in most cases I've seen, it makes very little difference overall.
author William Astle <lost@l-w.ca>
date Thu, 03 Nov 2016 21:44:32 -0600
parents 9f0448022f1f
children 45df37e81741
files lwasm/main.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/main.c	Thu Nov 03 21:36:17 2016 -0600
+++ b/lwasm/main.c	Thu Nov 03 21:44:32 2016 -0600
@@ -302,6 +302,10 @@
 	asmstate.nextcontext = 1;
 	asmstate.exprwidth = 16;
 	asmstate.tabwidth = 8;
+
+	// enable the "forward reference maximum size" pragma; old available
+	// can be obtained with --pragma=noforwardrefmax
+	asmstate.pragmas = PRAGMA_FORWARDREFMAX;
 	
 	/* parse command line arguments */	
 	lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate);