mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
i965: Add and use enum brw_reg_file.
Reviewed-by: Emil Velikov <emil.velikov@collabora.co.uk> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
977df90d65
commit
d74dd703f8
4 changed files with 23 additions and 19 deletions
|
|
@ -1399,10 +1399,12 @@ enum PACKED brw_predicate {
|
|||
BRW_PREDICATE_ALIGN16_ALL4H = 7,
|
||||
};
|
||||
|
||||
#define BRW_ARCHITECTURE_REGISTER_FILE 0
|
||||
#define BRW_GENERAL_REGISTER_FILE 1
|
||||
#define BRW_MESSAGE_REGISTER_FILE 2
|
||||
#define BRW_IMMEDIATE_VALUE 3
|
||||
enum PACKED brw_reg_file {
|
||||
BRW_ARCHITECTURE_REGISTER_FILE = 0,
|
||||
BRW_GENERAL_REGISTER_FILE = 1,
|
||||
BRW_MESSAGE_REGISTER_FILE = 2,
|
||||
BRW_IMMEDIATE_VALUE = 3,
|
||||
};
|
||||
|
||||
#define BRW_HW_REG_TYPE_UD 0
|
||||
#define BRW_HW_REG_TYPE_D 1
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ gen7_convert_mrf_to_grf(struct brw_codegen *p, struct brw_reg *reg)
|
|||
*/
|
||||
unsigned
|
||||
brw_reg_type_to_hw_type(const struct brw_device_info *devinfo,
|
||||
enum brw_reg_type type, unsigned file)
|
||||
enum brw_reg_type type, enum brw_reg_file file)
|
||||
{
|
||||
if (file == BRW_IMMEDIATE_VALUE) {
|
||||
static const int imm_hw_types[] = {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@
|
|||
#include "brw_fs.h"
|
||||
#include "brw_cfg.h"
|
||||
|
||||
static uint32_t brw_file_from_reg(fs_reg *reg)
|
||||
static enum brw_reg_file
|
||||
brw_file_from_reg(fs_reg *reg)
|
||||
{
|
||||
switch (reg->file) {
|
||||
case GRF:
|
||||
|
|
@ -48,7 +49,7 @@ static uint32_t brw_file_from_reg(fs_reg *reg)
|
|||
case UNIFORM:
|
||||
unreachable("not reached");
|
||||
}
|
||||
return 0;
|
||||
return BRW_ARCHITECTURE_REGISTER_FILE;
|
||||
}
|
||||
|
||||
static struct brw_reg
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ enum PACKED brw_reg_type {
|
|||
};
|
||||
|
||||
unsigned brw_reg_type_to_hw_type(const struct brw_device_info *devinfo,
|
||||
enum brw_reg_type type, unsigned file);
|
||||
enum brw_reg_type type, enum brw_reg_file file);
|
||||
const char *brw_reg_type_letters(unsigned brw_reg_type);
|
||||
|
||||
#define REG_SIZE (8*4)
|
||||
|
|
@ -232,7 +232,7 @@ const char *brw_reg_type_letters(unsigned brw_reg_type);
|
|||
*/
|
||||
struct brw_reg {
|
||||
enum brw_reg_type type:4;
|
||||
unsigned file:2;
|
||||
enum brw_reg_file file:2;
|
||||
unsigned nr:8;
|
||||
unsigned subnr:5; /* :1 in align16 */
|
||||
unsigned negate:1; /* source only */
|
||||
|
|
@ -329,7 +329,7 @@ type_is_signed(unsigned type)
|
|||
* \param writemask WRITEMASK_X/Y/Z/W bitfield
|
||||
*/
|
||||
static inline struct brw_reg
|
||||
brw_reg(unsigned file,
|
||||
brw_reg(enum brw_reg_file file,
|
||||
unsigned nr,
|
||||
unsigned subnr,
|
||||
unsigned negate,
|
||||
|
|
@ -378,7 +378,7 @@ brw_reg(unsigned file,
|
|||
|
||||
/** Construct float[16] register */
|
||||
static inline struct brw_reg
|
||||
brw_vec16_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vec16_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return brw_reg(file,
|
||||
nr,
|
||||
|
|
@ -395,7 +395,7 @@ brw_vec16_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
|
||||
/** Construct float[8] register */
|
||||
static inline struct brw_reg
|
||||
brw_vec8_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vec8_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return brw_reg(file,
|
||||
nr,
|
||||
|
|
@ -412,7 +412,7 @@ brw_vec8_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
|
||||
/** Construct float[4] register */
|
||||
static inline struct brw_reg
|
||||
brw_vec4_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vec4_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return brw_reg(file,
|
||||
nr,
|
||||
|
|
@ -429,7 +429,7 @@ brw_vec4_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
|
||||
/** Construct float[2] register */
|
||||
static inline struct brw_reg
|
||||
brw_vec2_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vec2_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return brw_reg(file,
|
||||
nr,
|
||||
|
|
@ -446,7 +446,7 @@ brw_vec2_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
|
||||
/** Construct float[1] register */
|
||||
static inline struct brw_reg
|
||||
brw_vec1_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vec1_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return brw_reg(file,
|
||||
nr,
|
||||
|
|
@ -462,7 +462,8 @@ brw_vec1_reg(unsigned file, unsigned nr, unsigned subnr)
|
|||
}
|
||||
|
||||
static inline struct brw_reg
|
||||
brw_vecn_reg(unsigned width, unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_vecn_reg(unsigned width, enum brw_reg_file file,
|
||||
unsigned nr, unsigned subnr)
|
||||
{
|
||||
switch (width) {
|
||||
case 1:
|
||||
|
|
@ -529,21 +530,21 @@ byte_offset(struct brw_reg reg, unsigned bytes)
|
|||
|
||||
/** Construct unsigned word[16] register */
|
||||
static inline struct brw_reg
|
||||
brw_uw16_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_uw16_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return suboffset(retype(brw_vec16_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
|
||||
}
|
||||
|
||||
/** Construct unsigned word[8] register */
|
||||
static inline struct brw_reg
|
||||
brw_uw8_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_uw8_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return suboffset(retype(brw_vec8_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
|
||||
}
|
||||
|
||||
/** Construct unsigned word[1] register */
|
||||
static inline struct brw_reg
|
||||
brw_uw1_reg(unsigned file, unsigned nr, unsigned subnr)
|
||||
brw_uw1_reg(enum brw_reg_file file, unsigned nr, unsigned subnr)
|
||||
{
|
||||
return suboffset(retype(brw_vec1_reg(file, nr, 0), BRW_REGISTER_TYPE_UW), subnr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue