summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2015-02-14 06:28:12 +0800
committerChia-I Wu <[email protected]>2015-02-14 06:52:36 +0800
commit8323796840a343ee39687cc8e8b424ee43d6fee7 (patch)
tree8459b0044e018ed75b6fcddbc7909d9bdbcdbacc /src/gallium/drivers/ilo
parentc62507f42cf7ea8ce3c3b843f488c6efd26f17dc (diff)
ilo: fix JIP/UIP on Gen8
UIP is in DW2 and JIP is in DW3 on Gen8. Also, the units are in bytes.
Diffstat (limited to 'src/gallium/drivers/ilo')
-rw-r--r--src/gallium/drivers/ilo/shader/toy_compiler_asm.c8
-rw-r--r--src/gallium/drivers/ilo/shader/toy_legalize.c26
2 files changed, 25 insertions, 9 deletions
diff --git a/src/gallium/drivers/ilo/shader/toy_compiler_asm.c b/src/gallium/drivers/ilo/shader/toy_compiler_asm.c
index 0977d60c2c4..1f465a3b13b 100644
--- a/src/gallium/drivers/ilo/shader/toy_compiler_asm.c
+++ b/src/gallium/drivers/ilo/shader/toy_compiler_asm.c
@@ -444,8 +444,12 @@ translate_src_gen6(const struct codegen *cg, int idx)
/* special treatment may be needed if any of the operand is immediate */
if (cg->src[0].file == GEN6_FILE_IMM) {
assert(!cg->src[0].absolute && !cg->src[0].negate);
- /* only the last src operand can be an immediate */
- assert(src_is_null(cg, 1));
+
+ /* only the last src operand can be an immediate unless it is Gen8+ */
+ assert(ilo_dev_gen(cg->dev) >= ILO_GEN(8) || src_is_null(cg, 1));
+
+ if (!src_is_null(cg, 1))
+ return cg->src[idx].origin;
if (idx == 0) {
if (ilo_dev_gen(cg->dev) >= ILO_GEN(8)) {
diff --git a/src/gallium/drivers/ilo/shader/toy_legalize.c b/src/gallium/drivers/ilo/shader/toy_legalize.c
index f1bacbdc1b1..4e573caadf4 100644
--- a/src/gallium/drivers/ilo/shader/toy_legalize.c
+++ b/src/gallium/drivers/ilo/shader/toy_legalize.c
@@ -335,7 +335,9 @@ patch_while_jip(struct toy_compiler *tc, struct toy_inst *inst)
dist--;
}
- if (ilo_dev_gen(tc->dev) >= ILO_GEN(7))
+ if (ilo_dev_gen(tc->dev) >= ILO_GEN(8))
+ inst->src[1] = tsrc_imm_d(dist * 16);
+ else if (ilo_dev_gen(tc->dev) >= ILO_GEN(7))
inst->src[1] = tsrc_imm_w(dist * 2);
else
inst->dst = tdst_imm_w(dist * 2);
@@ -388,13 +390,16 @@ patch_if_else_jip(struct toy_compiler *tc, struct toy_inst *inst)
dist++;
}
- if (ilo_dev_gen(tc->dev) >= ILO_GEN(7)) {
+ if (ilo_dev_gen(tc->dev) >= ILO_GEN(8)) {
+ inst->dst.type = TOY_TYPE_D;
+ inst->src[0] = tsrc_imm_d(uip * 8);
+ inst->src[1] = tsrc_imm_d(jip * 8);
+ } else if (ilo_dev_gen(tc->dev) >= ILO_GEN(7)) {
/* what should the type be? */
inst->dst.type = TOY_TYPE_D;
inst->src[0].type = TOY_TYPE_D;
inst->src[1] = tsrc_imm_d(uip << 16 | jip);
- }
- else {
+ } else {
inst->dst = tdst_imm_w(jip);
}
}
@@ -431,7 +436,9 @@ patch_endif_jip(struct toy_compiler *tc, struct toy_inst *inst)
if (!found)
dist = 1;
- if (ilo_dev_gen(tc->dev) >= ILO_GEN(7))
+ if (ilo_dev_gen(tc->dev) >= ILO_GEN(8))
+ inst->src[1] = tsrc_imm_d(dist * 16);
+ else if (ilo_dev_gen(tc->dev) >= ILO_GEN(7))
inst->src[1] = tsrc_imm_w(dist * 2);
else
inst->dst = tdst_imm_w(dist * 2);
@@ -495,8 +502,13 @@ patch_break_continue_jip(struct toy_compiler *tc, struct toy_inst *inst)
/* should the type be D or W? */
inst->dst.type = TOY_TYPE_D;
- inst->src[0].type = TOY_TYPE_D;
- inst->src[1] = tsrc_imm_d(uip << 16 | jip);
+ if (ilo_dev_gen(tc->dev) >= ILO_GEN(8)) {
+ inst->src[0] = tsrc_imm_d(uip * 8);
+ inst->src[1] = tsrc_imm_d(jip * 8);
+ } else {
+ inst->src[0].type = TOY_TYPE_D;
+ inst->src[1] = tsrc_imm_d(uip << 16 | jip);
+ }
}
/**