ramInstrLen++;
PC += next;
}
+
for (int i = 0; i < ramInstrLen; i++)
{
if (i == 0)
{
while (1)
{
- head[reorid] = 0;
//find the next unchecked instruction
int found = -1;
int idx = head[reorid];
if (idx == -1)
{
+ //idx.next.prev = found
+ //found.next = head
+ //found.prev = -1
+ //head = found
reordered[reorid][head[reorid]].prev = found;
reordered[reorid][found].next = head[reorid];
reordered[reorid][found].prev = -1;
head[reorid] = found;
+ //printf("head: %i\n", found);
}
else
{
+ /*
+ [idx].next -> .prev <- o
+ found
+
+ */
+ //idx.next.prev = found
+ //found.next = idx.next
+ //found.prev = idx
+ //idx.next = found
reordered[reorid][ reordered[reorid][idx].next ].prev = found;
reordered[reorid][found].next = reordered[reorid][idx].next;
reordered[reorid][found].prev = idx;
}
if (reorid == 1)
{
+ /*
+ printf("%i\n", head[reorid]);
+ for (int i = 0; i < ramInstrLen; i++)
+ {
+ printf("%i -> %i\n", i, reordered[reorid][i].next);
+ }
+ printf("===========================\n");
+ */
int tmpeff = qansel_efficiency(reordered[reorid], ramInstrLen, head[reorid]);
+ head[reorid] = 0; //correct?
if (tmpeff >= efficiency)
{
efficiency = tmpeff;