return bi_pack_fma_addmin(bundle.fma, regs);
case BI_MOV:
return bi_pack_fma_1src(bundle.fma, regs, BIFROST_FMA_OP_MOV);
- case BI_SHIFT:
- unreachable("Packing todo");
case BI_SELECT:
return bi_pack_fma_select(bundle.fma, regs);
case BI_ROUND:
case BI_MINMAX:
return bi_pack_add_addmin(bundle.add, regs);
case BI_MOV:
- case BI_SHIFT:
case BI_STORE:
unreachable("Packing todo");
case BI_STORE_VAR:
case BI_MINMAX: return "minmax";
case BI_MOV: return "mov";
case BI_SELECT: return "select";
- case BI_SHIFT: return "shift";
case BI_STORE: return "store";
case BI_STORE_VAR: return "store_var";
case BI_SPECIAL: return "special";
[BI_MOV] = BI_SCHED_ALL,
[BI_FMOV] = BI_MODS | BI_SCHED_ALL,
[BI_REDUCE_FMA] = BI_SCHED_FMA,
- [BI_SHIFT] = BI_SCHED_ALL,
[BI_STORE] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR | BI_DATA_REG_SRC,
[BI_STORE_VAR] = BI_SCHED_HI_LATENCY | BI_SCHED_ADD | BI_VECTOR | BI_DATA_REG_SRC,
[BI_SPECIAL] = BI_SCHED_ADD | BI_SCHED_SLOW,
case nir_op_ior:
case nir_op_ixor:
case nir_op_inot:
+ case nir_op_ishl:
return BI_BITWISE;
BI_CASE_CMP(nir_op_flt)
alu.op.bitwise = BI_BITWISE_OR;
alu.bitwise.src_invert[0] = true;
alu.src[1] = BIR_INDEX_ZERO;
+ /* zero shift */
+ alu.src[2] = BIR_INDEX_ZERO;
+ alu.src_types[2] = alu.src_types[1];
+ break;
+ case nir_op_ishl:
+ alu.op.bitwise = BI_BITWISE_OR;
+ /* move src1 to src2 and replace with zero. underlying op is (src0 << src2) | src1 */
+ alu.src[2] = alu.src[1];
+ alu.src_types[2] = alu.src_types[1];
+ alu.src[1] = BIR_INDEX_ZERO;
break;
case nir_op_fmax:
case nir_op_imax:
break;
case nir_op_iand:
alu.op.bitwise = BI_BITWISE_AND;
+ /* zero shift */
+ alu.src[2] = BIR_INDEX_ZERO;
+ alu.src_types[2] = alu.src_types[1];
break;
case nir_op_ior:
alu.op.bitwise = BI_BITWISE_OR;
+ /* zero shift */
+ alu.src[2] = BIR_INDEX_ZERO;
+ alu.src_types[2] = alu.src_types[1];
break;
case nir_op_ixor:
alu.op.bitwise = BI_BITWISE_XOR;
+ /* zero shift */
+ alu.src[2] = BIR_INDEX_ZERO;
+ alu.src_types[2] = alu.src_types[1];
break;
case nir_op_f2i32:
alu.roundmode = BIFROST_RTZ;
bi_fuse_cond(&alu, instr->src[0],
&constants_left, &constant_shift, comps, false);
#endif
- } else if (alu.type == BI_BITWISE) {
- /* Implicit shift argument... at some point we should fold */
- alu.src[2] = BIR_INDEX_ZERO;
- alu.src_types[2] = alu.src_types[1];
}
bi_emit(ctx, alu);