comparison lwasm/main.c @ 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 9f796134d6f4
children 58cafa61ab40
comparison
equal deleted inserted replaced
425:9f0448022f1f 426:b4825b42c151
300 asmstate.include_list = lw_stringlist_create(); 300 asmstate.include_list = lw_stringlist_create();
301 asmstate.input_files = lw_stringlist_create(); 301 asmstate.input_files = lw_stringlist_create();
302 asmstate.nextcontext = 1; 302 asmstate.nextcontext = 1;
303 asmstate.exprwidth = 16; 303 asmstate.exprwidth = 16;
304 asmstate.tabwidth = 8; 304 asmstate.tabwidth = 8;
305
306 // enable the "forward reference maximum size" pragma; old available
307 // can be obtained with --pragma=noforwardrefmax
308 asmstate.pragmas = PRAGMA_FORWARDREFMAX;
305 309
306 /* parse command line arguments */ 310 /* parse command line arguments */
307 lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate); 311 lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate);
308 312
309 if (!asmstate.output_file) 313 if (!asmstate.output_file)