return true;
}
-static void gen_rbit32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn)
+/*
+ * Perform 32-bit operation fn on the low half of n;
+ * the high half of the output is zeroed.
+ */
+static void gen_wrap2_i32(TCGv_i64 d, TCGv_i64 n, NeonGenOneOpFn fn)
{
- TCGv_i32 t32 = tcg_temp_new_i32();
+ TCGv_i32 t = tcg_temp_new_i32();
- tcg_gen_extrl_i64_i32(t32, tcg_rn);
- gen_helper_rbit(t32, t32);
- tcg_gen_extu_i32_i64(tcg_rd, t32);
+ tcg_gen_extrl_i64_i32(t, n);
+ fn(t, t);
+ tcg_gen_extu_i32_i64(d, t);
+}
+
+static void gen_rbit32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn)
+{
+ gen_wrap2_i32(tcg_rd, tcg_rn, gen_helper_rbit);
}
static void gen_rev16_xx(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn, TCGv_i64 mask)
static void gen_cls32(TCGv_i64 tcg_rd, TCGv_i64 tcg_rn)
{
- TCGv_i32 t32 = tcg_temp_new_i32();
-
- tcg_gen_extrl_i64_i32(t32, tcg_rn);
- tcg_gen_clrsb_i32(t32, t32);
- tcg_gen_extu_i32_i64(tcg_rd, t32);
+ gen_wrap2_i32(tcg_rd, tcg_rn, tcg_gen_clrsb_i32);
}
TRANS(CLZ, gen_rr, a->rd, a->rn, a->sf ? gen_clz64 : gen_clz32)