[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RESEND v3 7/8] target/ppc: Implemented vector module word/doublew
From: |
Lucas Mateus Castro(alqotel) |
Subject: |
[PATCH RESEND v3 7/8] target/ppc: Implemented vector module word/doubleword |
Date: |
Wed, 25 May 2022 10:49:53 -0300 |
From: "Lucas Mateus Castro (alqotel)" <lucas.araujo@eldorado.org.br>
Implement the following PowerISA v3.1 instructions:
vmodsw: Vector Modulo Signed Word
vmoduw: Vector Modulo Unsigned Word
vmodsd: Vector Modulo Signed Doubleword
vmodud: Vector Modulo Unsigned Doubleword
Signed-off-by: Lucas Mateus Castro (alqotel) <lucas.araujo@eldorado.org.br>
---
target/ppc/insn32.decode | 5 +++++
target/ppc/translate/vmx-impl.c.inc | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/target/ppc/insn32.decode b/target/ppc/insn32.decode
index 5b2d7824a0..75fa206b39 100644
--- a/target/ppc/insn32.decode
+++ b/target/ppc/insn32.decode
@@ -802,3 +802,8 @@ VDIVESD 000100 ..... ..... ..... 01111001011 @VX
VDIVEUD 000100 ..... ..... ..... 01011001011 @VX
VDIVESQ 000100 ..... ..... ..... 01100001011 @VX
VDIVEUQ 000100 ..... ..... ..... 01000001011 @VX
+
+VMODSW 000100 ..... ..... ..... 11110001011 @VX
+VMODUW 000100 ..... ..... ..... 11010001011 @VX
+VMODSD 000100 ..... ..... ..... 11111001011 @VX
+VMODUD 000100 ..... ..... ..... 11011001011 @VX
diff --git a/target/ppc/translate/vmx-impl.c.inc
b/target/ppc/translate/vmx-impl.c.inc
index f00aa64bf9..78277fb018 100644
--- a/target/ppc/translate/vmx-impl.c.inc
+++ b/target/ppc/translate/vmx-impl.c.inc
@@ -3365,6 +3365,11 @@ static void do_diveu_i32(TCGv_i32 t, TCGv_i32 a,
TCGv_i32 b)
DIVS32(do_divesw, do_dives_i32)
DIVU32(do_diveuw, do_diveu_i32)
+DIVS32(do_modsw, tcg_gen_rem_i32)
+DIVU32(do_moduw, tcg_gen_remu_i32)
+DIVS64(do_modsd, tcg_gen_rem_i64)
+DIVU64(do_modud, tcg_gen_remu_i64)
+
TRANS_FLAGS2(ISA310, VDIVESW, do_vdiv_vmod, MO_32, do_divesw, NULL)
TRANS_FLAGS2(ISA310, VDIVEUW, do_vdiv_vmod, MO_32, do_diveuw, NULL)
TRANS_FLAGS2(ISA310, VDIVESD, do_vx_helper, gen_helper_VDIVESD)
@@ -3372,6 +3377,11 @@ TRANS_FLAGS2(ISA310, VDIVEUD, do_vx_helper,
gen_helper_VDIVEUD)
TRANS_FLAGS2(ISA310, VDIVESQ, do_vx_helper, gen_helper_VDIVESQ)
TRANS_FLAGS2(ISA310, VDIVEUQ, do_vx_helper, gen_helper_VDIVEUQ)
+TRANS_FLAGS2(ISA310, VMODSW, do_vdiv_vmod, MO_32, do_modsw , NULL)
+TRANS_FLAGS2(ISA310, VMODUW, do_vdiv_vmod, MO_32, do_moduw, NULL)
+TRANS_FLAGS2(ISA310, VMODSD, do_vdiv_vmod, MO_64, NULL, do_modsd)
+TRANS_FLAGS2(ISA310, VMODUD, do_vdiv_vmod, MO_64, NULL, do_modud)
+
#undef DIVS32
#undef DIVU32
#undef DIVS64
--
2.31.1
- [PATCH RESEND v3 0/8] VDIV/VMOD Implementation, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 1/8] target/ppc: Implemented vector divide instructions, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 2/8] target/ppc: Implemented vector divide quadword, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 3/8] target/ppc: Implemented vector divide extended word, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 4/8] host-utils: Implemented unsigned 256-by-128 division, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 5/8] host-utils: Implemented signed 256-by-128 division, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 6/8] target/ppc: Implemented remaining vector divide extended, Lucas Mateus Castro(alqotel), 2022/05/25
- [PATCH RESEND v3 7/8] target/ppc: Implemented vector module word/doubleword,
Lucas Mateus Castro(alqotel) <=
- [PATCH RESEND v3 8/8] target/ppc: Implemented vector module quadword, Lucas Mateus Castro(alqotel), 2022/05/25