diff --git a/crates/xcl/src/gpu/dxil/ops.rs b/crates/xcl/src/gpu/dxil/ops.rs index cf7d47b145..0949a5c066 100644 --- a/crates/xcl/src/gpu/dxil/ops.rs +++ b/crates/xcl/src/gpu/dxil/ops.rs @@ -333,6 +333,12 @@ impl Shader { let rhi = self.m.cast(CastOp::ZExt, rhi, t); return self.m.bin(BinOp::Or, rlo, rhi); } + // AMD's driver also returns `x | bfrev(x)` for some `Bfrev.i32(values of a + // computed i64 expression)` and for `Bfrev.i32(countbits(...))` (fuzz seed 1599). + // The group-swap sequence is exact on every adapter and only costs a few ALU ops. + if t == self.m.i32() { + return self.bfrev32_shifts(v); + } self.op(30, "unary", Some(t), t, &[v], FnAttrs::ReadNone) }