[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 25/42] target-ppc: add vspltis{b, h, w} instructions
From: |
Nathan Froyd |
Subject: |
[Qemu-devel] [PATCH 25/42] target-ppc: add vspltis{b, h, w} instructions. |
Date: |
Sun, 14 Dec 2008 18:14:58 -0800 |
Signed-off-by: Nathan Froyd <address@hidden>
---
target-ppc/helper.h | 3 +++
target-ppc/op_helper.c | 16 ++++++++++++++++
target-ppc/translate.c | 4 ++++
3 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/target-ppc/helper.h b/target-ppc/helper.h
index 02e3c10..9fbcc4a 100644
--- a/target-ppc/helper.h
+++ b/target-ppc/helper.h
@@ -179,6 +179,9 @@ DEF_HELPER_3(vrlw, void, avr, avr, avr)
DEF_HELPER_3(vsl, void, avr, avr, avr)
DEF_HELPER_3(vsr, void, avr, avr, avr)
DEF_HELPER_4(vsldoi, void, avr, avr, avr, i32)
+DEF_HELPER_2(vspltisb, void, avr, i32)
+DEF_HELPER_2(vspltish, void, avr, i32)
+DEF_HELPER_2(vspltisw, void, avr, i32)
DEF_HELPER_1(efscfsi, i32, i32)
DEF_HELPER_1(efscfui, i32, i32)
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 310a46c..ac99324 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -2354,6 +2354,22 @@ void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t
*b)
#endif
}
+#define VSPLTI(suffix, element, splat_type) \
+ void helper_vspltis##suffix (ppc_avr_t *r, uint32_t splat) \
+ { \
+ splat_type x = (splat_type)splat; \
+ /* 5-bit sign extension. */ \
+ if (x & 0x10) \
+ x -= 0x20; \
+ VECTOR_FOR (element) { \
+ r->element[i] = x; \
+ } \
+ }
+VSPLTI(b, s8, int8_t)
+VSPLTI(h, s16, int16_t)
+VSPLTI(w, s32, int32_t)
+#undef VSPLTI
+
#define VSR(suffix, element) \
void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
{ \
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 20ebb10..4867f7e 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -6313,6 +6313,10 @@ GEN_VXFORM(vsr, 708);
tcg_temp_free(rd); \
}
+GEN_VXFORM_SIMM(vspltisb, 780);
+GEN_VXFORM_SIMM(vspltish, 844);
+GEN_VXFORM_SIMM(vspltisw, 908);
+
#define GEN_VXRFORM1(opname, name, str, xo, rc) \
GEN_HANDLER2(name, str, 0x4, (xo >> 1) & 0x1f, ((xo >> 6) & 0x1f) | (rc <<
4), 0x00000000, PPC_ALTIVEC) \
{ \
--
1.6.0.5
- [Qemu-devel] [PATCH 37/42] target-ppc: add vmh{, r}addshs instructions., (continued)
- [Qemu-devel] [PATCH 37/42] target-ppc: add vmh{, r}addshs instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 33/42] target-ppc: add vsel and vperm instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 05/42] target-ppc: add v{add, sub}u{b, h, w}m instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 11/42] target-ppc: add vscr access macros., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 16/42] target-ppc: add vs{l,r}o instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 20/42] target-ppc: add v{add, sub}{s, u}{b, h, w}s instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 38/42] target-ppc: add vmsumuh{m, s} instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 41/42] target-ppc: add {l, st}ve{b, h, w}x instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 24/42] target-ppc: add GEN_VXFORM_SIMM macro for subsequent instructions., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 40/42] target-ppc: add vmladduhm instruction., Nathan Froyd, 2008/12/14
- [Qemu-devel] [PATCH 25/42] target-ppc: add vspltis{b, h, w} instructions.,
Nathan Froyd <=
- Re: [Qemu-devel] [PATCH] target-ppc: add Altivec instructions, patch-bomb version, Aurelien Jarno, 2008/12/15