All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target/mips: Support Toshiba specific three-operand MADD and MADDU
@ 2018-10-14 14:29 Philippe Mathieu-Daudé
  2018-10-14 16:41 ` Fredrik Noring
  2018-10-24 18:01 ` Fredrik Noring
  0 siblings, 2 replies; 21+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-14 14:29 UTC (permalink / raw)
  To: Maciej W . Rozycki, Fredrik Noring, Richard Henderson,
	Aleksandar Markovic, Aurelien Jarno
  Cc: Philippe Mathieu-Daudé, qemu-devel, Jürgen Urban

The three-operand MADD and MADDU are specific to the
Toshiba TX19/TX39/TX79 cores.

The "32-Bit TX System RISC TX39 Family Architecture manual"
is available at https://wiki.qemu.org/File:DSAE0022432.pdf

Signed-off-by: Philippe Mathieu-Daudé<f4bug@amsat.org>
---
Based-on: 540683755a2357b670b107a29658531466be18f4.1539428198.git.noring@nocrew.org
"target/mips: Limited support for the R5900" from Fredrik Noring:
https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02731.html

 target/mips/translate.c | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/target/mips/translate.c b/target/mips/translate.c
index 2d5c0a8173..4b3168961c 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -3843,6 +3843,46 @@ static void gen_mul_txx9(DisasContext *ctx, uint32_t opc,
             tcg_temp_free_i32(t3);
         }
         break;
+    case OPC_MADD:
+        {
+            TCGv_i64 t2 = tcg_temp_new_i64();
+            TCGv_i64 t3 = tcg_temp_new_i64();
+
+            tcg_gen_ext_tl_i64(t2, t0);
+            tcg_gen_ext_tl_i64(t3, t1);
+            tcg_gen_mul_i64(t2, t2, t3);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
+            tcg_gen_add_i64(t2, t2, t3);
+            tcg_temp_free_i64(t3);
+            gen_move_low32(cpu_LO[acc], t2);
+            gen_move_high32(cpu_HI[acc], t2);
+            if (rd) {
+                gen_move_low32(cpu_gpr[rd], t2);
+            }
+            tcg_temp_free_i64(t2);
+        }
+        break;
+    case OPC_MADDU:
+        {
+            TCGv_i64 t2 = tcg_temp_new_i64();
+            TCGv_i64 t3 = tcg_temp_new_i64();
+
+            tcg_gen_ext32u_tl(t0, t0);
+            tcg_gen_ext32u_tl(t1, t1);
+            tcg_gen_extu_tl_i64(t2, t0);
+            tcg_gen_extu_tl_i64(t3, t1);
+            tcg_gen_mul_i64(t2, t2, t3);
+            tcg_gen_concat_tl_i64(t3, cpu_LO[acc], cpu_HI[acc]);
+            tcg_gen_add_i64(t2, t2, t3);
+            tcg_temp_free_i64(t3);
+            gen_move_low32(cpu_LO[acc], t2);
+            gen_move_high32(cpu_HI[acc], t2);
+            if (rd) {
+                gen_move_low32(cpu_gpr[rd], t2);
+            }
+            tcg_temp_free_i64(t2);
+        }
+        break;
     default:
         MIPS_INVAL("mul TXx9");
         generate_exception_end(ctx, EXCP_RI);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-10-29 15:45 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-14 14:29 [Qemu-devel] [PATCH] target/mips: Support Toshiba specific three-operand MADD and MADDU Philippe Mathieu-Daudé
2018-10-14 16:41 ` Fredrik Noring
2018-10-14 21:56   ` Philippe Mathieu-Daudé
2018-10-14 23:03     ` Maciej W. Rozycki
2018-10-15 17:02       ` Fredrik Noring
2018-10-16  9:43         ` Aleksandar Markovic
2018-10-16 18:19           ` Fredrik Noring
2018-10-16 18:37             ` Richard Henderson
2018-10-16 18:52               ` Fredrik Noring
2018-10-16 19:02                 ` Maciej W. Rozycki
2018-10-19 18:09                   ` Aleksandar Markovic
2018-10-28 19:43               ` Aleksandar Markovic
2018-10-28 20:00                 ` Maciej W. Rozycki
2018-10-29 11:52                 ` Aleksandar Markovic
2018-10-29 14:51                   ` Fredrik Noring
2018-10-29 15:03                     ` Aleksandar Markovic
2018-10-29 15:44                       ` Maciej W. Rozycki
2018-10-16 18:55             ` Maciej W. Rozycki
2018-10-15 15:36     ` Fredrik Noring
2018-10-24 18:01 ` Fredrik Noring
2018-10-26 11:17   ` Aleksandar Markovic

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.