Commit ed11a5e9 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

lima_t6xx -> midgard

parent 0ef1ca23
......@@ -35,26 +35,26 @@
#define DEFINE_CASE(define, str) case define: { printf(str); break; }
lima_t6xx_word_type_e lima_t6xx_word_type[16] = {
lima_t6xx_word_type_unknown, /* 0x0 */
lima_t6xx_word_type_unknown, /* 0x1 */
lima_t6xx_word_type_unknown, /* 0x2 */
lima_t6xx_word_type_texture, /* 0x3 */
lima_t6xx_word_type_unknown, /* 0x4 */
lima_t6xx_word_type_load_store, /* 0x5 */
lima_t6xx_word_type_unknown, /* 0x6 */
lima_t6xx_word_type_unknown, /* 0x7 */
lima_t6xx_word_type_alu, /* 0x8 */
lima_t6xx_word_type_alu, /* 0x9 */
lima_t6xx_word_type_alu, /* 0xA */
lima_t6xx_word_type_alu, /* 0xB */
lima_t6xx_word_type_unknown, /* 0xC */
lima_t6xx_word_type_alu, /* 0xD */
lima_t6xx_word_type_alu, /* 0xE */
lima_t6xx_word_type_unknown, /* 0xF */
midgard_word_type_e midgard_word_type[16] = {
midgard_word_type_unknown, /* 0x0 */
midgard_word_type_unknown, /* 0x1 */
midgard_word_type_unknown, /* 0x2 */
midgard_word_type_texture, /* 0x3 */
midgard_word_type_unknown, /* 0x4 */
midgard_word_type_load_store, /* 0x5 */
midgard_word_type_unknown, /* 0x6 */
midgard_word_type_unknown, /* 0x7 */
midgard_word_type_alu, /* 0x8 */
midgard_word_type_alu, /* 0x9 */
midgard_word_type_alu, /* 0xA */
midgard_word_type_alu, /* 0xB */
midgard_word_type_unknown, /* 0xC */
midgard_word_type_alu, /* 0xD */
midgard_word_type_alu, /* 0xE */
midgard_word_type_unknown, /* 0xF */
};
unsigned lima_t6xx_word_size[16] = {
unsigned midgard_word_size[16] = {
0, /* 0x0 */
0, /* 0x1 */
0, /* 0x2 */
......@@ -74,54 +74,54 @@ unsigned lima_t6xx_word_size[16] = {
};
static char* alu_opcode_names[256] = {
[lima_t6xx_alu_op_fadd] = "fadd",
[lima_t6xx_alu_op_fmul] = "fmul",
[lima_t6xx_alu_op_fmin] = "fmin",
[lima_t6xx_alu_op_fmax] = "fmax",
[lima_t6xx_alu_op_fmov] = "fmov",
[lima_t6xx_alu_op_ffloor] = "ffloor",
[lima_t6xx_alu_op_fceil] = "fceil",
[lima_t6xx_alu_op_fdot3] = "fdot3",
[lima_t6xx_alu_op_fdot3r] = "fdot3r",
[lima_t6xx_alu_op_fdot4] = "fdot4",
[lima_t6xx_alu_op_freduce] = "freduce",
[lima_t6xx_alu_op_iadd] = "iadd",
[lima_t6xx_alu_op_isub] = "isub",
[lima_t6xx_alu_op_imul] = "imul",
[lima_t6xx_alu_op_imov] = "imov",
[lima_t6xx_alu_op_feq] = "feq",
[lima_t6xx_alu_op_fne] = "fne",
[lima_t6xx_alu_op_flt] = "flt",
[lima_t6xx_alu_op_fle] = "fle",
[lima_t6xx_alu_op_f2i] = "f2i",
[lima_t6xx_alu_op_ieq] = "ieq",
[lima_t6xx_alu_op_ine] = "ine",
[lima_t6xx_alu_op_ilt] = "ilt",
[lima_t6xx_alu_op_ile] = "ile",
[lima_t6xx_alu_op_ball] = "ball",
[lima_t6xx_alu_op_bany] = "bany",
[lima_t6xx_alu_op_i2f] = "i2f",
[lima_t6xx_alu_op_csel] = "csel",
[lima_t6xx_alu_op_fatan_pt2] = "fatan_pt2",
[lima_t6xx_alu_op_frcp] = "frcp",
[lima_t6xx_alu_op_frsqrt] = "frsqrt",
[lima_t6xx_alu_op_fsqrt] = "fsqrt",
[lima_t6xx_alu_op_fexp2] = "fexp2",
[lima_t6xx_alu_op_flog2] = "flog2",
[lima_t6xx_alu_op_fsin] = "fsin",
[lima_t6xx_alu_op_fcos] = "fcos",
[lima_t6xx_alu_op_fatan2_pt1] = "fatan2_pt1"
[midgard_alu_op_fadd] = "fadd",
[midgard_alu_op_fmul] = "fmul",
[midgard_alu_op_fmin] = "fmin",
[midgard_alu_op_fmax] = "fmax",
[midgard_alu_op_fmov] = "fmov",
[midgard_alu_op_ffloor] = "ffloor",
[midgard_alu_op_fceil] = "fceil",
[midgard_alu_op_fdot3] = "fdot3",
[midgard_alu_op_fdot3r] = "fdot3r",
[midgard_alu_op_fdot4] = "fdot4",
[midgard_alu_op_freduce] = "freduce",
[midgard_alu_op_iadd] = "iadd",
[midgard_alu_op_isub] = "isub",
[midgard_alu_op_imul] = "imul",
[midgard_alu_op_imov] = "imov",
[midgard_alu_op_feq] = "feq",
[midgard_alu_op_fne] = "fne",
[midgard_alu_op_flt] = "flt",
[midgard_alu_op_fle] = "fle",
[midgard_alu_op_f2i] = "f2i",
[midgard_alu_op_ieq] = "ieq",
[midgard_alu_op_ine] = "ine",
[midgard_alu_op_ilt] = "ilt",
[midgard_alu_op_ile] = "ile",
[midgard_alu_op_ball] = "ball",
[midgard_alu_op_bany] = "bany",
[midgard_alu_op_i2f] = "i2f",
[midgard_alu_op_csel] = "csel",
[midgard_alu_op_fatan_pt2] = "fatan_pt2",
[midgard_alu_op_frcp] = "frcp",
[midgard_alu_op_frsqrt] = "frsqrt",
[midgard_alu_op_fsqrt] = "fsqrt",
[midgard_alu_op_fexp2] = "fexp2",
[midgard_alu_op_flog2] = "flog2",
[midgard_alu_op_fsin] = "fsin",
[midgard_alu_op_fcos] = "fcos",
[midgard_alu_op_fatan2_pt1] = "fatan2_pt1"
};
static char* load_store_opcode_names[256] = {
[lima_t6xx_op_load_attr_16] = "ld_attr_16",
[lima_t6xx_op_load_attr_32] = "ld_attr_32",
[lima_t6xx_op_load_vary_16] = "ld_vary_16",
[lima_t6xx_op_load_vary_32] = "ld_vary_32",
[lima_t6xx_op_load_uniform_16] = "ld_uniform_16",
[lima_t6xx_op_load_uniform_32] = "ld_uniform_32",
[lima_t6xx_op_store_vary_16] = "st_vary_16",
[lima_t6xx_op_store_vary_32] = "st_vary_32"
[midgard_op_load_attr_16] = "ld_attr_16",
[midgard_op_load_attr_32] = "ld_attr_32",
[midgard_op_load_vary_16] = "ld_vary_16",
[midgard_op_load_vary_32] = "ld_vary_32",
[midgard_op_load_uniform_16] = "ld_uniform_16",
[midgard_op_load_uniform_32] = "ld_uniform_32",
[midgard_op_store_vary_16] = "st_vary_16",
[midgard_op_store_vary_32] = "st_vary_32"
};
......@@ -132,7 +132,7 @@ static void ogt_asm_print_tabs(int tabs)
/* TODO STUB FIXME */
}
static void print_alu_opcode(lima_t6xx_alu_op_e op)
static void print_alu_opcode(midgard_alu_op_e op)
{
bool int_op = false;
......@@ -147,7 +147,7 @@ static void print_alu_opcode(lima_t6xx_alu_op_e op)
is_instruction_int = int_op;
}
static void print_ld_st_opcode(lima_t6xx_load_store_op_e op)
static void print_ld_st_opcode(midgard_load_store_op_e op)
{
if (load_store_opcode_names[op])
printf("%s", load_store_opcode_names[op]);
......@@ -181,7 +181,7 @@ static char* outmod_names[4] = {
".sat"
};
static void print_outmod(lima_t6xx_outmod_e outmod)
static void print_outmod(midgard_outmod_e outmod)
{
printf("%s", outmod_names[outmod]);
}
......@@ -211,7 +211,7 @@ static void print_16bit_words(uint16_t* words, unsigned num_words)
static void print_vector_src(unsigned src_binary, bool out_high,
bool out_half, unsigned reg)
{
lima_t6xx_vector_alu_src_t* src = (lima_t6xx_vector_alu_src_t*)&src_binary;
midgard_vector_alu_src_t* src = (midgard_vector_alu_src_t*)&src_binary;
if (src->negate)
printf("-");
......@@ -276,11 +276,11 @@ static uint16_t decode_vector_imm(unsigned src2_reg, unsigned imm)
static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_word,
unsigned tabs)
{
lima_t6xx_reg_info_t* reg_info = (lima_t6xx_reg_info_t*)&reg_word;
lima_t6xx_vector_alu_t* alu_field = (lima_t6xx_vector_alu_t*) words;
midgard_reg_info_t* reg_info = (midgard_reg_info_t*)&reg_word;
midgard_vector_alu_t* alu_field = (midgard_vector_alu_t*) words;
if (alu_field->reg_mode != lima_t6xx_reg_mode_half &&
alu_field->reg_mode != lima_t6xx_reg_mode_full)
if (alu_field->reg_mode != midgard_reg_mode_half &&
alu_field->reg_mode != midgard_reg_mode_full)
{
printf("unknown reg mode %u\n", alu_field->reg_mode);
}
......@@ -298,7 +298,7 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
bool half, out_half, out_high;
unsigned mask;
half = (alu_field->reg_mode == lima_t6xx_reg_mode_half);
half = (alu_field->reg_mode == midgard_reg_mode_half);
if (half)
{
......@@ -324,13 +324,13 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
out_half = half;
if (alu_field->dest_override != lima_t6xx_dest_override_none)
if (alu_field->dest_override != midgard_dest_override_none)
{
assert(!out_half);
out_half = true;
if (alu_field->dest_override == lima_t6xx_dest_override_lower)
if (alu_field->dest_override == midgard_dest_override_lower)
out_high = false;
else if (alu_field->dest_override == lima_t6xx_dest_override_upper)
else if (alu_field->dest_override == midgard_dest_override_upper)
out_high = true;
else
assert(0);
......@@ -380,7 +380,7 @@ static void print_vector_field(const char *name, uint16_t* words, uint16_t reg_w
static void print_scalar_src(unsigned src_binary, unsigned reg)
{
lima_t6xx_scalar_alu_src_t* src = (lima_t6xx_scalar_alu_src_t*)&src_binary;
midgard_scalar_alu_src_t* src = (midgard_scalar_alu_src_t*)&src_binary;
if (src->negate)
printf("-");
......@@ -414,8 +414,8 @@ static uint16_t decode_scalar_imm(unsigned src2_reg, unsigned imm)
static void print_scalar_field(const char *name, uint16_t* words, uint16_t reg_word,
unsigned tabs)
{
lima_t6xx_reg_info_t* reg_info = (lima_t6xx_reg_info_t*)&reg_word;
lima_t6xx_scalar_alu_t* alu_field = (lima_t6xx_scalar_alu_t*) words;
midgard_reg_info_t* reg_info = (midgard_reg_info_t*)&reg_word;
midgard_scalar_alu_t* alu_field = (midgard_scalar_alu_t*) words;
if (alu_field->unknown)
{
......@@ -458,13 +458,13 @@ static void print_scalar_field(const char *name, uint16_t* words, uint16_t reg_w
static void print_compact_branch_writeout_field(uint16_t word)
{
lima_t6xx_jmp_writeout_op_e op = word & 0x7;
midgard_jmp_writeout_op_e op = word & 0x7;
switch (op)
{
case lima_t6xx_jmp_writeout_op_branch_uncond:
case midgard_jmp_writeout_op_branch_uncond:
{
lima_t6xx_branch_uncond_t br_uncond;
midgard_branch_uncond_t br_uncond;
memcpy((char*) &br_uncond, (char*) &word, sizeof(br_uncond));
printf("br.uncond ");
if (br_uncond.unknown != 1)
......@@ -474,20 +474,20 @@ static void print_compact_branch_writeout_field(uint16_t word)
printf("%d\n", br_uncond.offset);
break;
}
case lima_t6xx_jmp_writeout_op_branch_cond:
case lima_t6xx_jmp_writeout_op_writeout:
case lima_t6xx_jmp_writeout_op_discard:
case midgard_jmp_writeout_op_branch_cond:
case midgard_jmp_writeout_op_writeout:
case midgard_jmp_writeout_op_discard:
{
lima_t6xx_branch_cond_t br_cond;
midgard_branch_cond_t br_cond;
memcpy((char*) &br_cond, (char*) &word, sizeof(br_cond));
printf("br.");
switch (op)
{
case lima_t6xx_jmp_writeout_op_branch_cond: printf("cond."); break;
case lima_t6xx_jmp_writeout_op_writeout: printf("write."); break;
case lima_t6xx_jmp_writeout_op_discard: printf("discard."); break;
case midgard_jmp_writeout_op_branch_cond: printf("cond."); break;
case midgard_jmp_writeout_op_writeout: printf("write."); break;
case midgard_jmp_writeout_op_discard: printf("discard."); break;
default: break;
}
......@@ -732,7 +732,7 @@ static void print_mask(uint32_t mask)
static void print_load_store_instr(uint64_t data,
unsigned tabs)
{
lima_t6xx_load_store_word_t* word = (lima_t6xx_load_store_word_t *) &data;
midgard_load_store_word_t* word = (midgard_load_store_word_t *) &data;
ogt_asm_print_tabs(tabs);
print_ld_st_opcode(word->op);
printf(" r%d", word->reg);
......@@ -746,7 +746,7 @@ static void print_load_store_instr(uint64_t data,
static void print_load_store_word(uint32_t* word, unsigned tabs)
{
lima_t6xx_load_store_t* load_store = (lima_t6xx_load_store_t *) word;
midgard_load_store_t* load_store = (midgard_load_store_t *) word;
if (load_store->word1 != 3)
{
......@@ -804,7 +804,7 @@ static void print_texture_op(int format)
static void print_texture_word(uint32_t* word, unsigned tabs)
{
lima_t6xx_texture_word_t* texture = (lima_t6xx_texture_word_t *) word;
midgard_texture_word_t* texture = (midgard_texture_word_t *) word;
ogt_asm_print_tabs(tabs);
......@@ -924,18 +924,18 @@ void DisassembleMidgard(uint8_t* code, size_t size)
unsigned i = 0;
while (i < num_words)
{
unsigned num_quad_words = lima_t6xx_word_size[words[i] & 0xF];
switch (lima_t6xx_word_type[words[i] & 0xF])
unsigned num_quad_words = midgard_word_size[words[i] & 0xF];
switch (midgard_word_type[words[i] & 0xF])
{
case lima_t6xx_word_type_texture:
case midgard_word_type_texture:
print_texture_word(&words[i], tabs);
break;
case lima_t6xx_word_type_load_store:
case midgard_word_type_load_store:
print_load_store_word(&words[i], tabs);
break;
case lima_t6xx_word_type_alu:
case midgard_word_type_alu:
print_alu_word(&words[i], num_quad_words, tabs);
if (prefetch_flag)
......@@ -966,7 +966,7 @@ void DisassembleMidgard(uint8_t* code, size_t size)
if (next == 1) {
prefetch_flag = true;
if (lima_t6xx_word_type[words[i] & 0xF] != lima_t6xx_word_type_alu)
if (midgard_word_type[words[i] & 0xF] != midgard_word_type_alu)
return;
}
}
......
......@@ -22,5 +22,5 @@
* THE SOFTWARE.
*/
#include "lima_t6xx.h"
#include "midgard.h"
......@@ -24,35 +24,33 @@
* THE SOFTWARE.
*/
/* lima_t6xx.h - common structures for T600 and T650 variants */
#ifndef __lima_t6xx_h__
#define __lima_t6xx_h__
#ifndef __midgard_h__
#define __midgard_h__
#include <stdint.h>
#include <stdbool.h>
typedef enum
{
lima_t6xx_word_type_alu,
lima_t6xx_word_type_load_store,
lima_t6xx_word_type_texture,
lima_t6xx_word_type_unknown
} lima_t6xx_word_type_e;
midgard_word_type_alu,
midgard_word_type_load_store,
midgard_word_type_texture,
midgard_word_type_unknown
} midgard_word_type_e;
extern lima_t6xx_word_type_e lima_t6xx_word_type[];
extern midgard_word_type_e midgard_word_type[];
//size in quadwords, i.e. multiples of 128 bits
extern unsigned lima_t6xx_word_size[];
extern unsigned midgard_word_size[];
typedef enum
{
lima_t6xx_alu_vmul,
lima_t6xx_alu_sadd,
lima_t6xx_alu_smul,
lima_t6xx_alu_vadd,
lima_t6xx_alu_lut
} lima_t6xx_alu_e;
midgard_alu_vmul,
midgard_alu_sadd,
midgard_alu_smul,
midgard_alu_vadd,
midgard_alu_lut
} midgard_alu_e;
/*
* ALU words
......@@ -60,65 +58,65 @@ typedef enum
typedef enum
{
lima_t6xx_alu_op_fadd = 0x10,
lima_t6xx_alu_op_fmul = 0x14,
lima_t6xx_alu_op_fmin = 0x28,
lima_t6xx_alu_op_fmax = 0x2C,
lima_t6xx_alu_op_fmov = 0x30,
lima_t6xx_alu_op_ffloor = 0x36,
lima_t6xx_alu_op_fceil = 0x37,
lima_t6xx_alu_op_fdot3 = 0x3C,
lima_t6xx_alu_op_fdot3r = 0x3D,
lima_t6xx_alu_op_fdot4 = 0x3E,
lima_t6xx_alu_op_freduce = 0x3F,
lima_t6xx_alu_op_iadd = 0x40,
lima_t6xx_alu_op_isub = 0x46,
lima_t6xx_alu_op_imul = 0x58,
lima_t6xx_alu_op_imov = 0x7B,
lima_t6xx_alu_op_feq = 0x80,
lima_t6xx_alu_op_fne = 0x81,
lima_t6xx_alu_op_flt = 0x82,
lima_t6xx_alu_op_fle = 0x83,
lima_t6xx_alu_op_f2i = 0x99,
lima_t6xx_alu_op_ieq = 0xA0,
lima_t6xx_alu_op_ine = 0xA1,
lima_t6xx_alu_op_ilt = 0xA4,
lima_t6xx_alu_op_ile = 0xA5,
lima_t6xx_alu_op_ball = 0xA9,
lima_t6xx_alu_op_bany = 0xB1,
lima_t6xx_alu_op_i2f = 0xB8,
lima_t6xx_alu_op_csel = 0xC5,
lima_t6xx_alu_op_fatan_pt2 = 0xE8,
lima_t6xx_alu_op_frcp = 0xF0,
lima_t6xx_alu_op_frsqrt = 0xF2,
lima_t6xx_alu_op_fsqrt = 0xF3,
lima_t6xx_alu_op_fexp2 = 0xF4,
lima_t6xx_alu_op_flog2 = 0xF5,
lima_t6xx_alu_op_fsin = 0xF6,
lima_t6xx_alu_op_fcos = 0xF7,
lima_t6xx_alu_op_fatan2_pt1 = 0xF9,
} lima_t6xx_alu_op_e;
midgard_alu_op_fadd = 0x10,
midgard_alu_op_fmul = 0x14,
midgard_alu_op_fmin = 0x28,
midgard_alu_op_fmax = 0x2C,
midgard_alu_op_fmov = 0x30,
midgard_alu_op_ffloor = 0x36,
midgard_alu_op_fceil = 0x37,
midgard_alu_op_fdot3 = 0x3C,
midgard_alu_op_fdot3r = 0x3D,
midgard_alu_op_fdot4 = 0x3E,
midgard_alu_op_freduce = 0x3F,
midgard_alu_op_iadd = 0x40,
midgard_alu_op_isub = 0x46,
midgard_alu_op_imul = 0x58,
midgard_alu_op_imov = 0x7B,
midgard_alu_op_feq = 0x80,
midgard_alu_op_fne = 0x81,
midgard_alu_op_flt = 0x82,
midgard_alu_op_fle = 0x83,
midgard_alu_op_f2i = 0x99,
midgard_alu_op_ieq = 0xA0,
midgard_alu_op_ine = 0xA1,
midgard_alu_op_ilt = 0xA4,
midgard_alu_op_ile = 0xA5,
midgard_alu_op_ball = 0xA9,
midgard_alu_op_bany = 0xB1,
midgard_alu_op_i2f = 0xB8,
midgard_alu_op_csel = 0xC5,
midgard_alu_op_fatan_pt2 = 0xE8,
midgard_alu_op_frcp = 0xF0,
midgard_alu_op_frsqrt = 0xF2,
midgard_alu_op_fsqrt = 0xF3,
midgard_alu_op_fexp2 = 0xF4,
midgard_alu_op_flog2 = 0xF5,
midgard_alu_op_fsin = 0xF6,
midgard_alu_op_fcos = 0xF7,
midgard_alu_op_fatan2_pt1 = 0xF9,
} midgard_alu_op_e;
typedef enum
{
lima_t6xx_outmod_none = 0,
lima_t6xx_outmod_pos = 1,
lima_t6xx_outmod_int = 2,
lima_t6xx_outmod_sat = 3
} lima_t6xx_outmod_e;
midgard_outmod_none = 0,
midgard_outmod_pos = 1,
midgard_outmod_int = 2,
midgard_outmod_sat = 3
} midgard_outmod_e;
typedef enum
{
lima_t6xx_reg_mode_half = 1,
lima_t6xx_reg_mode_full = 2
} lima_t6xx_reg_mode_e;
midgard_reg_mode_half = 1,
midgard_reg_mode_full = 2
} midgard_reg_mode_e;
typedef enum
{
lima_t6xx_dest_override_lower = 0,
lima_t6xx_dest_override_upper = 1,
lima_t6xx_dest_override_none = 2
} lima_t6xx_dest_override_e;
midgard_dest_override_lower = 0,
midgard_dest_override_upper = 1,
midgard_dest_override_none = 2
} midgard_dest_override_e;
typedef struct
__attribute__((__packed__))
......@@ -133,19 +131,19 @@ __attribute__((__packed__))
bool rep_high : 1; /* unused if dest = full */
bool half : 1; /* only matters if dest = full */
unsigned swizzle : 8;
} lima_t6xx_vector_alu_src_t;
} midgard_vector_alu_src_t;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_alu_op_e op : 8;
lima_t6xx_reg_mode_e reg_mode : 2;
midgard_alu_op_e op : 8;
midgard_reg_mode_e reg_mode : 2;
unsigned src1 : 13;
unsigned src2 : 13;
lima_t6xx_dest_override_e dest_override : 2;
lima_t6xx_outmod_e outmod : 2;
midgard_dest_override_e dest_override : 2;
midgard_outmod_e outmod : 2;
unsigned mask : 8;
} lima_t6xx_vector_alu_t;
} midgard_vector_alu_t;
typedef struct
__attribute__((__packed__))
......@@ -154,19 +152,19 @@ __attribute__((__packed__))
bool negate : 1;
bool full : 1; /* 0 = half, 1 = full */
unsigned component : 3;
} lima_t6xx_scalar_alu_src_t;
} midgard_scalar_alu_src_t;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_alu_op_e op : 8;
midgard_alu_op_e op : 8;
unsigned src1 : 6;
unsigned src2 : 11;
unsigned unknown : 1;
lima_t6xx_outmod_e outmod : 2;
midgard_outmod_e outmod : 2;
bool output_full : 1;
unsigned output_component : 3;
} lima_t6xx_scalar_alu_t;
} midgard_scalar_alu_t;
typedef struct
__attribute__((__packed__))
......@@ -175,40 +173,40 @@ __attribute__((__packed__))
unsigned src2_reg : 5;
unsigned out_reg : 5;
bool src2_imm : 1;
} lima_t6xx_reg_info_t;
} midgard_reg_info_t;
typedef enum
{
lima_t6xx_jmp_writeout_op_branch_uncond = 1,
lima_t6xx_jmp_writeout_op_branch_cond = 2,
lima_t6xx_jmp_writeout_op_discard = 4,
lima_t6xx_jmp_writeout_op_writeout = 7,
} lima_t6xx_jmp_writeout_op_e;
midgard_jmp_writeout_op_branch_uncond = 1,
midgard_jmp_writeout_op_branch_cond = 2,
midgard_jmp_writeout_op_discard = 4,
midgard_jmp_writeout_op_writeout = 7,
} midgard_jmp_writeout_op_e;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_jmp_writeout_op_e op : 3; /* == branch_uncond */
midgard_jmp_writeout_op_e op : 3; /* == branch_uncond */
unsigned dest_tag : 4; /* tag of branch destination */
unsigned unknown : 2;
int offset : 7;
} lima_t6xx_branch_uncond_t;
} midgard_branch_uncond_t;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_jmp_writeout_op_e op : 3; /* == branch_cond */
midgard_jmp_writeout_op_e op : 3; /* == branch_cond */
unsigned dest_tag : 4; /* tag of branch destination */
int offset : 7;
unsigned cond : 2;
} lima_t6xx_branch_cond_t;
} midgard_branch_cond_t;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_jmp_writeout_op_e op : 3; /* == writeout */
midgard_jmp_writeout_op_e op : 3; /* == writeout */
unsigned unknown : 13;
} lima_t6xx_writeout_t;
} midgard_writeout_t;
/*
* Load/store words
......@@ -216,27 +214,27 @@ __attribute__((__packed__))
typedef enum
{
lima_t6xx_op_ld_st_noop = 0x03,
lima_t6xx_op_load_attr_16 = 0x95,
lima_t6xx_op_load_attr_32 = 0x94,
lima_t6xx_op_load_vary_16 = 0x99,
lima_t6xx_op_load_vary_32 = 0x98,
lima_t6xx_op_load_uniform_16 = 0xAC,
lima_t6xx_op_load_uniform_32 = 0xB0,
lima_t6xx_op_store_vary_16 = 0xD5,
lima_t6xx_op_store_vary_32 = 0xD4
} lima_t6xx_load_store_op_e;
midgard_op_ld_st_noop = 0x03,
midgard_op_load_attr_16 = 0x95,
midgard_op_load_attr_32 = 0x94,
midgard_op_load_vary_16 = 0x99,
midgard_op_load_vary_32 = 0x98,
midgard_op_load_uniform_16 = 0xAC,
midgard_op_load_uniform_32 = 0xB0,
midgard_op_store_vary_16 = 0xD5,
midgard_op_store_vary_32 = 0xD4
} midgard_load_store_op_e;
typedef struct
__attribute__((__packed__))
{
lima_t6xx_load_store_op_e op : 8;
midgard_load_store_op_e op : 8;
unsigned reg : 5;
unsigned mask : 4;
unsigned swizzle : 8;
unsigned unknown : 26;
unsigned address : 9;
} lima_t6xx_load_store_word_t;
} midgard_load_store_word_t;
typedef struct
__attribute__((__packed__))
......@@ -245,7 +243,7 @@ __attribute__((__packed__))
unsigned next_type : 4;
uint64_t word1 : 60;
uint64_t word2 : 60;
} lima_t6xx_load_store_t;
} midgard_load_store_t;
/* Texture pipeline results are in r28-r29 */
#define REG_TEX_BASE 28
......@@ -331,6 +329,6 @@ __attribute__((__packed__))
unsigned texture_handle : 16;
unsigned sampler_handle : 16;
} lima_t6xx_texture_word_t;
} midgard_texture_word_t;
#endif
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