class fs_live_variables;
}
-class fs_reg {
+class fs_reg : public backend_reg {
public:
DECLARE_RALLOC_CXX_OPERATORS(fs_reg)
/** Smear a channel of the reg to all channels. */
fs_reg &set_smear(unsigned subreg);
- /** Register file: GRF, MRF, IMM. */
- enum register_file file;
- /** Register type. BRW_REGISTER_TYPE_* */
- uint8_t type;
- /**
- * Register number. For MRF, it's the hardware register. For
- * GRF, it's a virtual register number until register allocation
- */
- uint16_t reg;
- /**
- * Offset from the start of the contiguous register block.
- *
- * For pre-register-allocation GRFs, this is in units of a float per pixel
- * (1 hardware register for SIMD8 mode, or 2 registers for SIMD16 mode).
- * For uniforms, this is in units of 1 float.
- */
- int reg_offset;
/**
* Offset in bytes from the start of the register. Values up to a
* backend_reg::reg_offset unit are valid.
*/
int subreg_offset;
- struct brw_reg fixed_hw_reg;
-
fs_reg *reladdr;
- bool negate;
- bool abs;
-
/** Register region horizontal stride */
uint8_t stride;
};
*/
#include <stdint.h>
+#include "brw_reg.h"
#include "brw_defines.h"
#include "main/compiler.h"
#include "glsl/ir.h"
UNIFORM, /* prog_data->params[reg] */
};
+struct backend_reg
+{
+ enum register_file file; /**< Register file: GRF, MRF, IMM. */
+ uint8_t type; /**< Register type: BRW_REGISTER_TYPE_* */
+
+ /**
+ * Register number.
+ *
+ * For GRF, it's a virtual register number until register allocation.
+ *
+ * For MRF, it's the hardware register.
+ */
+ uint16_t reg;
+
+ /**
+ * Offset within the virtual register.
+ *
+ * In the scalar backend, this is in units of a float per pixel for pre-
+ * register allocation registers (i.e., one register in SIMD8 mode and two
+ * registers in SIMD16 mode).
+ *
+ * For uniforms, this is in units of 1 float.
+ */
+ int reg_offset;
+
+ struct brw_reg fixed_hw_reg;
+
+ bool negate;
+ bool abs;
+};
+
#ifdef __cplusplus
class cfg_t;
unsigned
swizzle_for_size(int size);
-class reg
-{
-public:
- /** Register file: GRF, MRF, IMM. */
- enum register_file file;
- /** virtual register number. 0 = fixed hw reg */
- int reg;
- /** Offset within the virtual register. */
- int reg_offset;
- /** Register type. BRW_REGISTER_TYPE_* */
- int type;
- struct brw_reg fixed_hw_reg;
-};
-
-class src_reg : public reg
+class src_reg : public backend_reg
{
public:
DECLARE_RALLOC_CXX_OPERATORS(src_reg)
explicit src_reg(dst_reg reg);
GLuint swizzle; /**< BRW_SWIZZLE_XYZW macros from brw_reg.h. */
- bool negate;
- bool abs;
src_reg *reladdr;
};
return reg;
}
-class dst_reg : public reg
+class dst_reg : public backend_reg
{
public:
DECLARE_RALLOC_CXX_OPERATORS(dst_reg)
namespace brw {
static void
-assign(unsigned int *reg_hw_locations, reg *reg)
+assign(unsigned int *reg_hw_locations, backend_reg *reg)
{
if (reg->file == GRF) {
reg->reg = reg_hw_locations[reg->reg];