On 10/21/21 12:45 PM, matheus.fe...@eldorado.org.br wrote:
From: "Bruno Larsen (billionai)" <bruno.lar...@eldorado.org.br>
Implemented XXSPLTI32DX emulation using decodetree
Signed-off-by: Bruno Larsen (billionai) <bruno.lar...@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.fe...@eldorado.org.br>
---
target/ppc/insn64.decode | 11 ++++++++
target/ppc/translate/vsx-impl.c.inc | 41 +++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
diff --git a/target/ppc/insn64.decode b/target/ppc/insn64.decode
index 880ac3edc7..8d8d5d5729 100644
--- a/target/ppc/insn64.decode
+++ b/target/ppc/insn64.decode
@@ -32,6 +32,14 @@
...... ..... ra:5 ................ \
&PLS_D si=%pls_si rt=%rt_tsxp
+# Format 8RR:D
+%8rr_si 32:s16 0:16
+%8rr_xt 16:1 21:5
+&8RR_D_IX xt ix si:int32_t
What is it about this field that says signed, expecially? It doesn't seem wrong, of
course, but you are jumping through extra hoops here...
+ get_cpu_vsrh(t0, a->xt);
+ get_cpu_vsrl(t1, a->xt);
+
+ tcg_gen_movi_i64(new_val, a->si);
+ if (a->ix) {
+ tcg_gen_movi_i64(mask, 0x00000000ffffffff);
+ tcg_gen_shli_i64(new_val, new_val, 32);
+ } else {
+ tcg_gen_movi_i64(mask, 0xffffffff00000000);
+ }
+ tcg_gen_and_i64(t0, t0, mask);
+ tcg_gen_or_i64(t0, t0, new_val);
+ tcg_gen_and_i64(t1, t1, mask);
+ tcg_gen_or_i64(t1, t1, new_val);
+
+ set_cpu_vsrh(a->xt, t0);
+ set_cpu_vsrl(a->xt, t1);
You're working too hard here. I think you should just store the two int32_t at the
correct offsets. And failing that, use tcg_gen_deposit_i64.
r~