bool is_int_out = midgard_is_integer_out_op(alu_field->op);
bool full = alu_field->output_full;
- if (alu_field->unknown)
- fprintf(fp, "scalar ALU unknown bit set\n");
+ if (alu_field->reserved)
+ fprintf(fp, "scalar ALU reserved bit set\n");
if (verbose)
fprintf(fp, "%s.", name);
}
}
+static const char *
+function_call_mode(enum midgard_call_mode mode)
+{
+ switch (mode) {
+ case midgard_call_mode_default: return "";
+ case midgard_call_mode_call: return ".call";
+ case midgard_call_mode_return: return ".return";
+ default: return ".reserved";
+ }
+}
+
static bool
print_compact_branch_writeout_field(disassemble_context *ctx, FILE *fp, uint16_t word)
{
case midgard_jmp_writeout_op_branch_uncond: {
midgard_branch_uncond br_uncond;
memcpy((char *) &br_uncond, (char *) &word, sizeof(br_uncond));
- fprintf(fp, "br.uncond ");
-
- if (br_uncond.unknown != 1)
- fprintf(fp, "unknown:%u, ", br_uncond.unknown);
+ fprintf(fp, "br.uncond%s ", function_call_mode(br_uncond.call_mode));
if (br_uncond.offset >= 0)
fprintf(fp, "+");
midgard_branch_extended br;
memcpy((char *) &br, (char *) words, sizeof(br));
- fprintf(fp, "brx.");
+ fprintf(fp, "brx%s.", function_call_mode(br.call_mode));
print_branch_op(fp, br.op);
else
fprintf(fp, "lut%X", br.cond);
- if (br.unknown)
- fprintf(fp, ".unknown%u", br.unknown);
-
fprintf(fp, " ");
if (br.offset >= 0)
typedef enum {
midgard_word_type_alu,
midgard_word_type_load_store,
- midgard_word_type_texture,
- midgard_word_type_unknown
+ midgard_word_type_texture
} midgard_word_type;
typedef enum {
unsigned src1 : 6;
/* last 5 bits are used when src2 is an immediate */
unsigned src2 : 11;
- unsigned unknown : 1;
+ unsigned reserved : 1;
unsigned outmod : 2;
bool output_full : 1;
unsigned output_component : 3;
midgard_jmp_writeout_op_tilebuffer_pending = 6,
/* In a fragment shader, try to write out the value pushed to r0 to the
- * tilebuffer, subject to unknown state in r1.z and r1.w. If this
+ * tilebuffer, subject to state in r1.z and r1.w. If this
* succeeds, the shader terminates. If it fails, it branches to the
* specified branch target. Generally, this should be used in a loop to
* itself, acting as "do { write(r0); } while(!write_successful);" */
midgard_condition_always = 3,
} midgard_condition;
+enum midgard_call_mode {
+ midgard_call_mode_default = 1,
+ midgard_call_mode_call = 2,
+ midgard_call_mode_return = 3
+};
+
typedef struct
__attribute__((__packed__))
{
midgard_jmp_writeout_op op : 3; /* == branch_uncond */
unsigned dest_tag : 4; /* tag of branch destination */
- unsigned unknown : 2;
+ enum midgard_call_mode call_mode : 2;
int offset : 7;
}
midgard_branch_uncond;
{
midgard_jmp_writeout_op op : 3; /* == branch_cond */
unsigned dest_tag : 4; /* tag of branch destination */
- unsigned unknown : 2;
+ enum midgard_call_mode call_mode : 2;
signed offset : 23;
/* Extended branches permit inputting up to 4 conditions loaded into
.op = v.op,
.src1 = packed_src[0],
.src2 = packed_src[1],
- .unknown = 0,
.outmod = v.outmod,
.output_full = is_full,
.output_component = comp
.op = op,
.dest_tag = dest_tag,
.offset = quadword_offset,
- .unknown = 1
+ .call_mode = midgard_call_mode_default
};
assert(branch.offset == quadword_offset);
memcpy(util_dynarray_grow_bytes(emission, size, 1), &branch, size);