qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6176] Add vupk{h,l}px instructions.
@ 2009-01-04 22:11 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2009-01-04 22:11 UTC (permalink / raw)
  To: qemu-devel

Revision: 6176
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6176
Author:   aurel32
Date:     2009-01-04 22:11:10 +0000 (Sun, 04 Jan 2009)

Log Message:
-----------
Add vupk{h,l}px instructions.

Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/target-ppc/helper.h
    trunk/target-ppc/op_helper.c
    trunk/target-ppc/translate.c

Modified: trunk/target-ppc/helper.h
===================================================================
--- trunk/target-ppc/helper.h	2009-01-04 22:10:59 UTC (rev 6175)
+++ trunk/target-ppc/helper.h	2009-01-04 22:11:10 UTC (rev 6176)
@@ -159,6 +159,8 @@
 DEF_HELPER_3(vspltb, void, avr, avr, i32)
 DEF_HELPER_3(vsplth, void, avr, avr, i32)
 DEF_HELPER_3(vspltw, void, avr, avr, i32)
+DEF_HELPER_2(vupkhpx, void, avr, avr)
+DEF_HELPER_2(vupklpx, void, avr, avr)
 
 DEF_HELPER_1(efscfsi, i32, i32)
 DEF_HELPER_1(efscfui, i32, i32)

Modified: trunk/target-ppc/op_helper.c
===================================================================
--- trunk/target-ppc/op_helper.c	2009-01-04 22:10:59 UTC (rev 6175)
+++ trunk/target-ppc/op_helper.c	2009-01-04 22:11:10 UTC (rev 6176)
@@ -2248,6 +2248,35 @@
     }
 }
 
+#if defined(WORDS_BIGENDIAN)
+#define UPKHI 1
+#define UPKLO 0
+#else
+#define UPKHI 0
+#define UPKLO 1
+#endif
+#define VUPKPX(suffix, hi)                                      \
+    void helper_vupk##suffix (ppc_avr_t *r, ppc_avr_t *b)       \
+    {                                                           \
+        int i;                                                  \
+        ppc_avr_t result;                                       \
+        for (i = 0; i < ARRAY_SIZE(r->u32); i++) {              \
+            uint16_t e = b->u16[hi ? i : i+4];                  \
+            uint8_t a = (e >> 15) ? 0xff : 0;                   \
+            uint8_t r = (e >> 10) & 0x1f;                       \
+            uint8_t g = (e >> 5) & 0x1f;                        \
+            uint8_t b = e & 0x1f;                               \
+            result.u32[i] = (a << 24) | (r << 16) | (g << 8) | b;       \
+        }                                                               \
+        *r = result;                                                    \
+    }
+VUPKPX(lpx, UPKLO)
+VUPKPX(hpx, UPKHI)
+#undef VUPKPX
+
+#undef UPKHI
+#undef UPKLO
+
 #undef VECTOR_FOR_INORDER_I
 #undef HI_IDX
 #undef LO_IDX

Modified: trunk/target-ppc/translate.c
===================================================================
--- trunk/target-ppc/translate.c	2009-01-04 22:10:59 UTC (rev 6175)
+++ trunk/target-ppc/translate.c	2009-01-04 22:11:10 UTC (rev 6176)
@@ -6289,6 +6289,9 @@
         tcg_temp_free_ptr(rd);                                         \
     }
 
+GEN_VXFORM_NOA(vupkhpx, 7, 13);
+GEN_VXFORM_NOA(vupklpx, 7, 15);
+
 #define GEN_VXFORM_SIMM(name, opc2, opc3)                               \
     GEN_HANDLER(name, 0x04, opc2, opc3, 0x00000000, PPC_ALTIVEC)        \
     {                                                                   \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-01-04 22:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-04 22:11 [Qemu-devel] [6176] Add vupk{h,l}px instructions Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).