ntt_CMP(c, dst, src[0], src[2], src[1]);
break;
- /* It would be nice if we could get this left as scalar in NIR, since
- * the TGSI op is scalar.
- */
case nir_op_frexp_sig:
- case nir_op_frexp_exp: {
- assert(src_64);
- struct ureg_dst temp = ntt_temp(c);
-
- for (int chan = 0; chan < 2; chan++) {
- int wm = 1 << chan;
-
- if (!(instr->dest.write_mask & wm))
- continue;
-
- struct ureg_dst dsts[2] = { temp, temp };
- if (instr->op == nir_op_frexp_sig) {
- dsts[0] = ureg_writemask(dst, ntt_64bit_write_mask(wm));
- } else {
- dsts[1] = ureg_writemask(dst, wm);
- }
-
- struct ureg_src chan_src = ureg_swizzle(src[0],
- chan * 2, chan * 2 + 1,
- chan * 2, chan * 2 + 1);
-
- struct ntt_insn *insn = ntt_insn(c, TGSI_OPCODE_DFRACEXP,
- dsts[0], chan_src,
- ureg_src_undef(),
- ureg_src_undef(),
- ureg_src_undef());
- insn->dst[1] = dsts[1];
- }
+ case nir_op_frexp_exp:
+ unreachable("covered by nir_lower_frexp()");
break;
- }
case nir_op_ldexp:
assert(dst_64); /* 32bit handled in table. */
/* Lower demote_if to if (cond) { demote } because TGSI doesn't have a DEMOTE_IF. */
NIR_PASS_V(s, nir_lower_discard_if, nir_lower_demote_if_to_cf);
+ NIR_PASS_V(s, nir_lower_frexp);
+
bool progress;
do {
progress = false;