On 5/17/26 22:29, James Hilliard wrote:
+static bool trans_octeon_cp2_mf_u32(DisasContext *ctx, arg_cp2 *a, int offset)
+{
+ TCGv_i64 value = tcg_temp_new_i64();
+
+ tcg_gen_ld32u_i64(value, tcg_env, offset);
+ gen_store_gpr(value, a->rt);
+ return true;
+}
I suspect this should always be signed. It's the mips way.
One spot check:
+CP2_MF_U32(CVM_MF_CRC_POLYNOMIAL, crc_poly);
is in fact
rt = sign_extend(CRCPOLY<31:0>)
+static bool trans_octeon_cp2_mf_helper(DisasContext *ctx, arg_cp2 *a,
+ uint32_t sel)
+{
+ TCGv_i64 value = tcg_temp_new_i64();
+
+ gen_helper_octeon_cop2_dmfc2(value, tcg_env, tcg_constant_i32(sel));
+ gen_store_gpr(value, a->rt);
+ return true;
+}
Do not smush decode back into one helper with a selector.
Use a separate helper function for each operation.
+static bool trans_octeon_cp2_mt_resinp(DisasContext *ctx, arg_cp2 *a,
+ unsigned int index)
+{
+ TCGv_i64 value = tcg_temp_new_i64();
+
+ gen_load_gpr(value, a->rt);
+ tcg_gen_st_i64(value, tcg_env,
+ OCTEON_CRYPTO_OFFSET(aes_input[index]));
+ tcg_gen_st_i64(value, tcg_env,
+ OCTEON_CRYPTO_OFFSET(aes_result[index]));
+ return true;
+}
Why does the document say AESRESINP[] and you're using two arrays?
+
+static bool trans_octeon_cp2_mt_helper(DisasContext *ctx, arg_cp2 *a,
+ uint32_t sel)
+{
+ TCGv_i64 value = tcg_temp_new_i64();
+
+ gen_load_gpr(value, a->rt);
+ gen_helper_octeon_cop2_dmtc2(tcg_env, value, tcg_constant_i32(sel));
+ return true;
+}
Likewise use separate helpers.
I really wanted these, and the helpers, added in batches of (much) less than 1000 lines
each. How about a bare minimum of the Subcategory sections of Table 2-7: CRC, 3DES, etc?
r~