/* 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)) {
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);
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);
}
}
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);
/* 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);
+ }
}
/**