Commit 7b239bec41a1a9c961474bcd2e4afad6900400a2
1 parent
d79f0809
Add vs{l,r}o instructions.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6167 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
31 additions
and
0 deletions
target-ppc/helper.h
... | ... | @@ -146,6 +146,8 @@ DEF_HELPER_3(vsrw, void, avr, avr, avr) |
146 | 146 | DEF_HELPER_3(vslb, void, avr, avr, avr) |
147 | 147 | DEF_HELPER_3(vslh, void, avr, avr, avr) |
148 | 148 | DEF_HELPER_3(vslw, void, avr, avr, avr) |
149 | +DEF_HELPER_3(vslo, void, avr, avr, avr) | |
150 | +DEF_HELPER_3(vsro, void, avr, avr, avr) | |
149 | 151 | |
150 | 152 | DEF_HELPER_1(efscfsi, i32, i32) |
151 | 153 | DEF_HELPER_1(efscfui, i32, i32) | ... | ... |
target-ppc/op_helper.c
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | * License along with this library; if not, write to the Free Software |
18 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA |
19 | 19 | */ |
20 | +#include <string.h> | |
20 | 21 | #include "exec.h" |
21 | 22 | #include "host-utils.h" |
22 | 23 | #include "helper.h" |
... | ... | @@ -2103,6 +2104,19 @@ VSL(h, u16) |
2103 | 2104 | VSL(w, u32) |
2104 | 2105 | #undef VSL |
2105 | 2106 | |
2107 | +void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) | |
2108 | +{ | |
2109 | + int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf; | |
2110 | + | |
2111 | +#if defined (WORDS_BIGENDIAN) | |
2112 | + memmove (&r->u8[0], &a->u8[sh], 16-sh); | |
2113 | + memset (&r->u8[16-sh], 0, sh); | |
2114 | +#else | |
2115 | + memmove (&r->u8[sh], &a->u8[0], 16-sh); | |
2116 | + memset (&r->u8[0], 0, sh); | |
2117 | +#endif | |
2118 | +} | |
2119 | + | |
2106 | 2120 | #define VSR(suffix, element) \ |
2107 | 2121 | void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
2108 | 2122 | { \ |
... | ... | @@ -2121,6 +2135,19 @@ VSR(h, u16) |
2121 | 2135 | VSR(w, u32) |
2122 | 2136 | #undef VSR |
2123 | 2137 | |
2138 | +void helper_vsro (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) | |
2139 | +{ | |
2140 | + int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf; | |
2141 | + | |
2142 | +#if defined (WORDS_BIGENDIAN) | |
2143 | + memmove (&r->u8[sh], &a->u8[0], 16-sh); | |
2144 | + memset (&r->u8[0], 0, sh); | |
2145 | +#else | |
2146 | + memmove (&r->u8[0], &a->u8[sh], 16-sh); | |
2147 | + memset (&r->u8[16-sh], 0, sh); | |
2148 | +#endif | |
2149 | +} | |
2150 | + | |
2124 | 2151 | #undef VECTOR_FOR_INORDER_I |
2125 | 2152 | #undef HI_IDX |
2126 | 2153 | #undef LO_IDX | ... | ... |
target-ppc/translate.c
... | ... | @@ -6228,6 +6228,8 @@ GEN_VXFORM(vsrw, 2, 10); |
6228 | 6228 | GEN_VXFORM(vsrab, 2, 12); |
6229 | 6229 | GEN_VXFORM(vsrah, 2, 13); |
6230 | 6230 | GEN_VXFORM(vsraw, 2, 14); |
6231 | +GEN_VXFORM(vslo, 6, 16); | |
6232 | +GEN_VXFORM(vsro, 6, 17); | |
6231 | 6233 | |
6232 | 6234 | /*** SPE extension ***/ |
6233 | 6235 | /* Register moves */ | ... | ... |