Commit 196c9c93 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

midgard: Begin disassembly of extended branch

parent d369a48c
......@@ -544,6 +544,31 @@ static void print_compact_branch_writeout_field(uint16_t word)
}
}
static void print_extended_branch_writeout_field(uint64_t _word)
{
uint64_t word = _word & ((1 << 48) - 1);
midgard_jmp_writeout_op op = word & 0x7;
switch (op)
{
case midgard_jmp_writeout_op_writeout:
{
midgard_branch_extended br;
memcpy((char*) &br, (char*) &word, sizeof(br));
printf("%d, %d, %d, %d, %X\n", br.dest_tag, br.unknown, br.offset, br.zero, br.cond);
printf("%X\n", word);
}
default:
{
printf("br_op_%d\n", op);
}
}
}
static unsigned num_alu_fields_enabled(uint32_t control_word)
{
unsigned ret = 0;
......@@ -666,10 +691,9 @@ static void print_alu_word(uint32_t* words, unsigned num_quad_words,
if ((control_word >> 27) & 1)
{
ogt_asm_print_tabs(tabs);
printf("branch field: ");
print_16bit_words(word_ptr, 3);
printf("\n");
//ogt_asm_print_tabs(tabs);
print_extended_branch_writeout_field(*word_ptr);
beginning_ptr += 1;
word_ptr += 3;
num_words += 3;
}
......
......@@ -215,6 +215,17 @@ __attribute__((__packed__))
unsigned cond : 2;
} midgard_branch_cond;
typedef struct
__attribute__((__packed__))
{
midgard_jmp_writeout_op op : 3; /* == branch_cond */
unsigned dest_tag : 4; /* tag of branch destination */
unsigned unknown : 2;
signed offset : 7;
unsigned zero : 16;
unsigned cond : 16;
} midgard_branch_extended;
typedef struct
__attribute__((__packed__))
{
......
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