Commit 2c2779080c2dbdeaefca59742be9648dd1878044
1 parent
3b430048
Add vmul{e,o}{s,u}{b,h} 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@6164 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
38 additions
and
0 deletions
target-ppc/helper.h
... | ... | @@ -129,6 +129,14 @@ DEF_HELPER_3(vmrglw, void, avr, avr, avr) |
129 | 129 | DEF_HELPER_3(vmrghb, void, avr, avr, avr) |
130 | 130 | DEF_HELPER_3(vmrghh, void, avr, avr, avr) |
131 | 131 | DEF_HELPER_3(vmrghw, void, avr, avr, avr) |
132 | +DEF_HELPER_3(vmulesb, void, avr, avr, avr) | |
133 | +DEF_HELPER_3(vmulesh, void, avr, avr, avr) | |
134 | +DEF_HELPER_3(vmuleub, void, avr, avr, avr) | |
135 | +DEF_HELPER_3(vmuleuh, void, avr, avr, avr) | |
136 | +DEF_HELPER_3(vmulosb, void, avr, avr, avr) | |
137 | +DEF_HELPER_3(vmulosh, void, avr, avr, avr) | |
138 | +DEF_HELPER_3(vmuloub, void, avr, avr, avr) | |
139 | +DEF_HELPER_3(vmulouh, void, avr, avr, avr) | |
132 | 140 | |
133 | 141 | DEF_HELPER_1(efscfsi, i32, i32) |
134 | 142 | DEF_HELPER_1(efscfui, i32, i32) | ... | ... |
target-ppc/op_helper.c
... | ... | @@ -2066,6 +2066,28 @@ VMRG(w, u32) |
2066 | 2066 | #undef MRGHI |
2067 | 2067 | #undef MRGLO |
2068 | 2068 | |
2069 | +#define VMUL_DO(name, mul_element, prod_element, evenp) \ | |
2070 | + void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ | |
2071 | + { \ | |
2072 | + int i; \ | |
2073 | + VECTOR_FOR_INORDER_I(i, prod_element) { \ | |
2074 | + if (evenp) { \ | |
2075 | + r->prod_element[i] = a->mul_element[i*2+HI_IDX] * b->mul_element[i*2+HI_IDX]; \ | |
2076 | + } else { \ | |
2077 | + r->prod_element[i] = a->mul_element[i*2+LO_IDX] * b->mul_element[i*2+LO_IDX]; \ | |
2078 | + } \ | |
2079 | + } \ | |
2080 | + } | |
2081 | +#define VMUL(suffix, mul_element, prod_element) \ | |
2082 | + VMUL_DO(mule##suffix, mul_element, prod_element, 1) \ | |
2083 | + VMUL_DO(mulo##suffix, mul_element, prod_element, 0) | |
2084 | +VMUL(sb, s8, s16) | |
2085 | +VMUL(sh, s16, s32) | |
2086 | +VMUL(ub, u8, u16) | |
2087 | +VMUL(uh, u16, u32) | |
2088 | +#undef VMUL_DO | |
2089 | +#undef VMUL | |
2090 | + | |
2069 | 2091 | #undef VECTOR_FOR_INORDER_I |
2070 | 2092 | #undef HI_IDX |
2071 | 2093 | #undef LO_IDX | ... | ... |
target-ppc/translate.c
... | ... | @@ -6211,6 +6211,14 @@ GEN_VXFORM(vmrghw, 6, 2); |
6211 | 6211 | GEN_VXFORM(vmrglb, 6, 4); |
6212 | 6212 | GEN_VXFORM(vmrglh, 6, 5); |
6213 | 6213 | GEN_VXFORM(vmrglw, 6, 6); |
6214 | +GEN_VXFORM(vmuloub, 4, 0); | |
6215 | +GEN_VXFORM(vmulouh, 4, 1); | |
6216 | +GEN_VXFORM(vmulosb, 4, 4); | |
6217 | +GEN_VXFORM(vmulosh, 4, 5); | |
6218 | +GEN_VXFORM(vmuleub, 4, 8); | |
6219 | +GEN_VXFORM(vmuleuh, 4, 9); | |
6220 | +GEN_VXFORM(vmulesb, 4, 12); | |
6221 | +GEN_VXFORM(vmulesh, 4, 13); | |
6214 | 6222 | |
6215 | 6223 | /*** SPE extension ***/ |
6216 | 6224 | /* Register moves */ | ... | ... |