diff lwasm/insn_rel.c @ 408:0af33282b518

Fix cycle counting for relative branches. The original creator of the cycle counting code appears to have mangled two different approaches to counting the cycles for relative branches into the final product which led to counting too many cycles for the branch instructions. The comments in the cycle table were correct but the code was doing some incorrect things. Also add the missing LBRN entry to the cycle table. The one labelled LBRN was not, in fact, LBRN, but one of the actual useful branch instructions.
author William Astle <lost@l-w.ca>
date Thu, 03 Mar 2016 21:38:21 -0700
parents 67373a053c49
children cad5937314cb
line wrap: on
line diff
--- a/lwasm/insn_rel.c	Thu Mar 03 21:17:48 2016 -0700
+++ b/lwasm/insn_rel.c	Thu Mar 03 21:38:21 2016 -0700
@@ -308,7 +308,6 @@
 		{
 			lwasm_emitop(l, instab[l->insn].ops[2]);
 			lwasm_emit(l, offs);
-			l->cycle_adj = 2;
 		}
 	}
 	else
@@ -316,6 +315,5 @@
 		lwasm_emitop(l, instab[l -> insn].ops[3]);
 		lwasm_emitexpr(l, e, 2);
 
-		l->cycle_adj = 4;
 	}
 }