[Mesa-dev] [PATCH 26/41] SQUASH: i965/blorp: Explicitly set instruction execute sizes
Jason Ekstrand
jason at jlekstrand.net
Sat Sep 20 10:23:15 PDT 2014
Since blorp is all 16-wide and nothing isn't, in general, very careful
about register widtsh, we'll just set it all explicitly.
---
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h | 32 ++++++++++++-------------
src/mesa/drivers/dri/i965/brw_fs.cpp | 27 +++++++++++++++++++++
src/mesa/drivers/dri/i965/brw_fs.h | 6 +++++
4 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
index 82ece73..3afe0e7 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.cpp
@@ -96,7 +96,7 @@ brw_blorp_eu_emitter::emit_render_target_write(const struct brw_reg &src0,
unsigned msg_length,
bool use_header)
{
- fs_inst *inst = new (mem_ctx) fs_inst(FS_OPCODE_BLORP_FB_WRITE);
+ fs_inst *inst = new (mem_ctx) fs_inst(FS_OPCODE_BLORP_FB_WRITE, 16);
inst->src[0] = src0;
inst->base_mrf = msg_reg_nr;
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
index 0459a7e..cd50da4 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit_eu.h
@@ -65,7 +65,7 @@ protected:
{
emit_cmp(op, x, y);
- fs_inst *mv = new (mem_ctx) fs_inst(BRW_OPCODE_MOV, dst, src);
+ fs_inst *mv = new (mem_ctx) fs_inst(BRW_OPCODE_MOV, 16, dst, src);
mv->predicate = BRW_PREDICATE_NORMAL;
insts.push_tail(mv);
}
@@ -82,17 +82,17 @@ protected:
const struct brw_reg &src3)
{
insts.push_tail(
- new (mem_ctx) fs_inst(BRW_OPCODE_LRP, dst, src1, src2, src3));
+ new (mem_ctx) fs_inst(BRW_OPCODE_LRP, 16, dst, src1, src2, src3));
}
inline void emit_mov(const struct brw_reg& dst, const struct brw_reg& src)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_MOV, dst, src));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_MOV, 16, dst, src));
}
inline void emit_mov_8(const struct brw_reg& dst, const struct brw_reg& src)
{
- fs_inst *mv = new (mem_ctx) fs_inst(BRW_OPCODE_MOV, dst, src);
+ fs_inst *mv = new (mem_ctx) fs_inst(BRW_OPCODE_MOV, 8, dst, src);
mv->force_uncompressed = true;
insts.push_tail(mv);
}
@@ -101,21 +101,21 @@ protected:
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_AND, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_AND, 16, dst, src1, src2));
}
inline void emit_add(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ADD, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ADD, 16, dst, src1, src2));
}
inline void emit_add_8(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- fs_inst *add = new (mem_ctx) fs_inst(BRW_OPCODE_ADD, dst, src1, src2);
+ fs_inst *add = new (mem_ctx) fs_inst(BRW_OPCODE_ADD, 8, dst, src1, src2);
add->force_uncompressed = true;
insts.push_tail(add);
}
@@ -124,40 +124,40 @@ protected:
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_MUL, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_MUL, 16, dst, src1, src2));
}
inline void emit_shr(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_SHR, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_SHR, 16, dst, src1, src2));
}
inline void emit_shl(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_SHL, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_SHL, 16, dst, src1, src2));
}
inline void emit_or(const struct brw_reg& dst,
const struct brw_reg& src1,
const struct brw_reg& src2)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_OR, dst, src1, src2));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_OR, 16, dst, src1, src2));
}
inline void emit_frc(const struct brw_reg& dst,
const struct brw_reg& src)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_FRC, dst, src));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_FRC, 16, dst, src));
}
inline void emit_rndd(const struct brw_reg& dst,
const struct brw_reg& src)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_RNDD, dst, src));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_RNDD, 16, dst, src));
}
inline void emit_cmp_if(enum brw_conditional_mod op,
@@ -165,17 +165,17 @@ protected:
const struct brw_reg &y)
{
emit_cmp(op, x, y);
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_IF));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_IF, 16));
}
inline void emit_else(void)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ELSE));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ELSE, 16));
}
inline void emit_endif(void)
{
- insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ENDIF));
+ insts.push_tail(new (mem_ctx) fs_inst(BRW_OPCODE_ENDIF, 16));
}
private:
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index cd64f59..6157c0c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -132,6 +132,14 @@ fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst)
init(opcode, 0, dst, src, 0);
}
+fs_inst::fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0)
+{
+ fs_reg *src = ralloc_array(this, fs_reg, 3);
+ src[0] = src0;
+ init(opcode, exec_size, dst, src, 1);
+}
+
fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0)
{
fs_reg *src = ralloc_array(this, fs_reg, 3);
@@ -139,6 +147,15 @@ fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0)
init(opcode, 0, dst, src, 1);
}
+fs_inst::fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0, const fs_reg &src1)
+{
+ fs_reg *src = ralloc_array(this, fs_reg, 3);
+ src[0] = src0;
+ src[1] = src1;
+ init(opcode, exec_size, dst, src, 2);
+}
+
fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
const fs_reg &src1)
{
@@ -148,6 +165,16 @@ fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
init(opcode, 0, dst, src, 2);
}
+fs_inst::fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0, const fs_reg &src1, const fs_reg &src2)
+{
+ fs_reg *src = ralloc_array(this, fs_reg, 3);
+ src[0] = src0;
+ src[1] = src1;
+ src[2] = src2;
+ init(opcode, exec_size, dst, src, 3);
+}
+
fs_inst::fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
const fs_reg &src1, const fs_reg &src2)
{
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index bb98717..7574133 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -202,9 +202,15 @@ public:
fs_inst();
fs_inst(enum opcode opcode, uint8_t exec_size);
fs_inst(enum opcode opcode, const fs_reg &dst);
+ fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0);
fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0);
+ fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0, const fs_reg &src1);
fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
const fs_reg &src1);
+ fs_inst(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
+ const fs_reg &src0, const fs_reg &src1, const fs_reg &src2);
fs_inst(enum opcode opcode, const fs_reg &dst, const fs_reg &src0,
const fs_reg &src1, const fs_reg &src2);
fs_inst(enum opcode opcode, const fs_reg &dst, fs_reg src[], int sources);
--
2.1.0
More information about the mesa-dev
mailing list