On 1/5/22 9:44 AM, WANG Xuerui wrote:
+static void tcg_out_test_alignment(TCGContext *s, bool is_ld, TCGReg addr_reg,
+                                   unsigned a_bits)
+{
+    TCGLabelQemuLdst *l = new_ldst_label(s);
+
+    l->is_ld = is_ld;
+    l->addrlo_reg = addr_reg;
+
+    tcg_debug_assert(a_bits < TCG_TARGET_REG_BITS);
+    tcg_out_opc_bstrpick_d(s, TCG_REG_TMP1, addr_reg, 0, a_bits - 1);

Looks good.  My only comment is wrt using bstrpick vs andi.
I haven't found any pipeline or timing info for loongarch,
so I don't know if either way is best.

With bstrpick, you can drop the assert.

Reviewed-by: Richard Henderson <[email protected]>


r~

Reply via email to