Skip to contentSkip to conversation

[6235] Add GEN_VXRFORM{, 1} macros for subsequent instructions

Qemu-devel Aurelien Jarno 1 participant 1 message Jan 8, 2009

lore
Share & tools
lore
#0 lore raw

Revision: 6235

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6235
Author:   aurel32
Date:     2009-01-08 18:54:26 +0000 (Thu, 08 Jan 2009)

Log Message:
-----------
Add GEN_VXRFORM{,1} macros for subsequent instructions

Modified Paths:
--------------
trunk/target-ppc/translate.c

Modified: trunk/target-ppc/translate.c
===================================================================

target-ppc/translate.c +21 -0
@@ -6359,6 +6359,27 @@
 GEN_VXFORM(vsum2sws, 4, 26);
 GEN_VXFORM(vsumsws, 4, 30);
 
+#define GEN_VXRFORM1(opname, name, str, opc2, opc3)                     \
+    GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC)   \
+    {                                                                   \
+        TCGv_ptr ra, rb, rd;                                            \
+        if (unlikely(!ctx->altivec_enabled)) {                          \
+            gen_exception(ctx, POWERPC_EXCP_VPU);                       \
+            return;                                                     \
+        }                                                               \
+        ra = gen_avr_ptr(rA(ctx->opcode));                              \
+        rb = gen_avr_ptr(rB(ctx->opcode));                              \
+        rd = gen_avr_ptr(rD(ctx->opcode));                              \
+        gen_helper_##opname (rd, ra, rb);                               \
+        tcg_temp_free_ptr(ra);                                          \
+        tcg_temp_free_ptr(rb);                                          \
+        tcg_temp_free_ptr(rd);                                          \
+    }
+
+#define GEN_VXRFORM(name, opc2, opc3)                                \
+    GEN_VXRFORM1(name, name, #name, opc2, opc3)                      \
+    GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
+
 #define GEN_VXFORM_NOA(name, opc2, opc3)                                \
     GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC)        \
     {                                                                   \