On Mon, May 11, 2026 at 1:58 PM Richard Henderson <[email protected]> wrote: > > On 5/11/26 13:22, James Hilliard wrote: > > +static bool trans_mtp(DisasContext *ctx, arg_r2 *a, unsigned int index) > > +{ > > + TCGv_i64 value = tcg_temp_new_i64(); > > + > > + /* > > + * Octeon3 two-source MTP forms load lane index from rs and lane index > > + 3 > > + * from rt. Legacy one-source forms encode rt as $zero. > > + */ > > + gen_load_gpr(value, a->rs); > > + octeon_store_p(index, value); > > + gen_load_gpr(value, a->rt); > > + octeon_store_p(index + 3, value); > > + if (index == 0) { > > + /* > > + * The hardware description and register-state table define P1 as > > zero; > > + * model P2/P4/P5 as zero for deterministic emulation. > > + */ > > + TCGv_i64 zero = tcg_constant_i64(0); > > + > > + octeon_store_p(1, zero); > > + octeon_store_p(2, zero); > > + octeon_store_p(4, zero); > > + octeon_store_p(5, zero); > > Likewise, where does this come from?
CN50XX-HM-0.99E is OCTEON Plus documentation and covers the older three-lane product state. Its MTP0 definition is P0 = rs. It does not define the OCTEON III rt source or the high product lanes P3..P5. The behavior modeled here is from CN71XX/OCTEON III. CN71XX defines MTP0 as loading P0 from rs, loading P3 from rt, and setting P1 to zero in the description/register-state table. It marks P2/P4/P5 architecturally unpredictable; I modeled those lanes as zero for deterministic emulation. The P1/P2/P4/P5 handling is therefore not from the CN50XX/OCTEON Plus MTP0 definition. It follows the newer OCTEON III product-state definition. The legacy form remains encoding-compatible because cnMIPS II MTP0 rs maps to cnMIPS III MTP0 rs, $0, but the modeled state side effects follow the OCTEON III definition. > The octeon2 manual for MTP* are quite simple, writing to just the one > register. I don't think you have an OCTEON 2 manual, you told me off-list you only had the CN50XX-HM-0.99E manual which is OCTEON plus/OCTEON 1, not OCTEON 2. I do not have a copy of the OCTEON 2 manual although the OCTEON 3 manual presumably should cover just about everything there. I emailed you a copy of the newer CN71XX-HM-0.991E OCTEON 3 manual I found yesterday.
