qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 24/40] Add GEN_VXFORM_UIMM macro for subsequent inst


From: Nathan Froyd
Subject: [Qemu-devel] [PATCH 24/40] Add GEN_VXFORM_UIMM macro for subsequent instructions.
Date: Tue, 30 Dec 2008 19:10:06 -0800

Signed-off-by: Nathan Froyd <address@hidden>
---
 target-ppc/translate.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index d9c1e60..77e93cb 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -372,6 +372,8 @@ EXTRACT_SHELPER(SIMM, 0, 16);
 EXTRACT_HELPER(UIMM, 0, 16);
 /* 5 bits signed immediate value */
 EXTRACT_HELPER(SIMM5, 16, 5);
+/* 5 bits signed immediate value */
+EXTRACT_HELPER(UIMM5, 16, 5);
 /* Bit count */
 EXTRACT_HELPER(NB, 11, 5);
 /* Shift count */
@@ -6343,6 +6345,24 @@ GEN_VXFORM_SIMM(vspltisb, 6, 12);
 GEN_VXFORM_SIMM(vspltish, 6, 13);
 GEN_VXFORM_SIMM(vspltisw, 6, 14);
 
+#define GEN_VXFORM_UIMM(name, opc2, opc3)                               \
+    GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC)        \
+    {                                                                   \
+        TCGv_ptr rb, rd;                                                \
+        TCGv_i32 uimm;                                                  \
+        if (unlikely(!ctx->altivec_enabled)) {                          \
+            gen_exception(ctx, POWERPC_EXCP_VPU);                       \
+            return;                                                     \
+        }                                                               \
+        uimm = tcg_const_i32(UIMM5(ctx->opcode));                       \
+        rb = gen_avr_ptr(rB(ctx->opcode));                              \
+        rd = gen_avr_ptr(rD(ctx->opcode));                              \
+        gen_helper_##name (rd, rb, uimm);                               \
+        tcg_temp_free_i32(uimm);                                        \
+        tcg_temp_free_ptr(rb);                                          \
+        tcg_temp_free_ptr(rd);                                          \
+    }
+
 #define GEN_VXRFORM1(opname, name, str, opc2, opc3)                     \
     GEN_HANDLER2(name, str, 0x4, opc2, opc3, 0x00000000, PPC_ALTIVEC)   \
     {                                                                   \
-- 
1.6.0.5





reply via email to

[Prev in Thread] Current Thread [Next in Thread]