continue;
if (def->saturate)
continue;
+ if (ins->op == AGX_OPCODE_FCMPSEL && s >= 2)
+ continue;
ins->src[s] = agx_compose_float_src(src, def->src[0]);
}
bool float_src = is_float;
- /* cmpselsrc takes integer immediates only */
- if (s >= 2 && I->op == AGX_OPCODE_FCMPSEL)
- float_src = false;
+ /* fcmpsel takes first 2 as floats specially */
+ if (s < 2 && I->op == AGX_OPCODE_FCMPSEL)
+ float_src = true;
if (I->op == AGX_OPCODE_ST_TILE && s == 0)
continue;
if (I->op == AGX_OPCODE_ZS_EMIT && s != 0)
agx_optimizer_copyprop(defs, I);
/* Propagate fmov down */
- if (info.is_float)
+ if (info.is_float || I->op == AGX_OPCODE_FCMPSEL)
agx_optimizer_fmov(defs, I);
/* Inline immediates if we can. TODO: systematic */
if (is_16 && !is_cmpsel)
assert((src_short & (1 << 9)) == 0);
- if (info.is_float) {
+ if (info.is_float || (I->op == AGX_OPCODE_FCMPSEL && !is_cmpsel)) {
unsigned fmod = agx_pack_float_mod(I->src[s]);
unsigned fmod_offset = is_16 ? 9 : 10;
src_short |= (fmod << fmod_offset);