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

lima_t6xx -> midgard

parent 0ef1ca23
This diff is collapsed.
......@@ -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