Commit 7ab549ab authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

midgard: Address Connor's comments

parent 291b376a
......@@ -558,48 +558,31 @@ static void print_compact_branch_writeout_field(uint16_t word)
}
}
static void print_extended_branch_writeout_field(uint64_t _word)
static void print_extended_branch_writeout_field(uint8_t *words)
{
uint64_t word = _word & ((1 << 48) - 1);
midgard_jmp_writeout_op op = word & 0x7;
midgard_branch_extended br;
memcpy((char*) &br, (char*) words, sizeof(br));
switch (op)
{
case midgard_jmp_writeout_op_writeout:
{
midgard_branch_extended br;
memcpy((char*) &br, (char*) &word, sizeof(br));
printf("br.");
printf("br.");
print_branch_op(br.op);
print_branch_cond(br.cond);
print_branch_op(br.op);
print_branch_cond(br.cond);
/* XXX: This can't be right */
if (br.unknown)
printf(".unknown%d\n", br.unknown);
/* XXX: This can't be right */
if (br.unknown)
printf(".unknown%d\n", br.unknown);
if (br.zero)
printf(".zero%d\n", br.zero);
printf(" ");
if (br.offset >= 0)
printf("+");
printf("%d", br.offset);
if (br.zero)
printf(".zero%d\n", br.zero);
printf(" -> %X\n", br.dest_tag);
break;
}
printf(" ");
if (br.offset >= 0)
printf("+");
printf("%d", br.offset);
default:
{
printf("br_extended_op_%d\n", op);
}
}
printf(" -> %X\n", br.dest_tag);
}
static unsigned num_alu_fields_enabled(uint32_t control_word)
{
unsigned ret = 0;
......@@ -715,7 +698,6 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
if ((control_word >> 26) & 1)
{
print_compact_branch_writeout_field(*word_ptr);
beginning_ptr += 1;
word_ptr += 1;
num_words += 1;
}
......@@ -723,8 +705,7 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
if ((control_word >> 27) & 1)
{
//ogt_asm_print_tabs(tabs);
print_extended_branch_writeout_field(*word_ptr);
beginning_ptr += 1;
print_extended_branch_writeout_field((uint8_t *) word_ptr);
word_ptr += 3;
num_words += 3;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment