|
| From: | Richard Henderson |
| Subject: | Re: [PATCH v3 09/37] target/ppc: Move Vector Compare Equal/Not Equal/Greater Than to decodetree |
| Date: | Fri, 11 Feb 2022 15:27:36 +1100 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 2/10/22 23:34, matheus.ferst@eldorado.org.br wrote:
+static void do_vcmp_rc(int vrt)
+{
+ TCGv_i64 t0, t1;
+
+ t0 = tcg_temp_new_i64();
+ t1 = tcg_temp_new_i64();
+
+ get_avr64(t0, vrt, true);
+ tcg_gen_ctpop_i64(t1, t0);
+ get_avr64(t0, vrt, false);
+ tcg_gen_ctpop_i64(t0, t0);
+ tcg_gen_add_i64(t1, t0, t1);
I don't understand the ctpop here. I would have expected:
tcg_gen_and_i64(set, t0, t1);
tcg_gen_or_i64(clr, t0, t1);
tcg_gen_setcondi_i64(TCG_COND_EQ, set, set, -1); /* all bits set */
tcg_gen_setcondi_i64(TCG_COND_EQ, clr, clr, 0); /* all bits clear */
+static bool do_vcmp(DisasContext *ctx, arg_VC *a, TCGCond cond, int vece)
+{
+ REQUIRE_VECTOR(ctx);
+
+ tcg_gen_gvec_cmp(cond, vece, avr_full_offset(a->vrt),
+ avr_full_offset(a->vra), avr_full_offset(a->vrb), 16, 16);
+ tcg_gen_gvec_shli(vece, avr_full_offset(a->vrt), avr_full_offset(a->vrt),
+ (8 << vece) - 1, 16, 16);
+ tcg_gen_gvec_sari(vece, avr_full_offset(a->vrt), avr_full_offset(a->vrt),
+ (8 << vece) - 1, 16, 16);
Vector compare already produces -1; no need for anything beyond the cmp. r~
| [Prev in Thread] | Current Thread | [Next in Thread] |