mirror of https://gitee.com/openkylin/qemu.git
Add vavg{s,u}{b,h,w} 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@6156 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7872c51c1a
commit
fab3cbe901
|
@ -105,6 +105,13 @@ DEF_HELPER_3(vadduwm, void, avr, avr, avr)
|
|||
DEF_HELPER_3(vsububm, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vsubuhm, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vsubuwm, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavgub, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavguh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavguw, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavgsb, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavgsh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vavgsw, void, avr, avr, avr)
|
||||
|
||||
DEF_HELPER_1(efscfsi, i32, i32)
|
||||
DEF_HELPER_1(efscfui, i32, i32)
|
||||
DEF_HELPER_1(efscfuf, i32, i32)
|
||||
|
|
|
@ -1988,6 +1988,25 @@ VARITH(uwm, u32)
|
|||
#undef VARITH_DO
|
||||
#undef VARITH
|
||||
|
||||
#define VAVG_DO(name, element, etype) \
|
||||
void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
||||
{ \
|
||||
int i; \
|
||||
for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
|
||||
etype x = (etype)a->element[i] + (etype)b->element[i] + 1; \
|
||||
r->element[i] = x >> 1; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define VAVG(type, signed_element, signed_type, unsigned_element, unsigned_type) \
|
||||
VAVG_DO(avgs##type, signed_element, signed_type) \
|
||||
VAVG_DO(avgu##type, unsigned_element, unsigned_type)
|
||||
VAVG(b, s8, int16_t, u8, uint16_t)
|
||||
VAVG(h, s16, int32_t, u16, uint32_t)
|
||||
VAVG(w, s32, int64_t, u32, uint64_t)
|
||||
#undef VAVG_DO
|
||||
#undef VAVG
|
||||
|
||||
#undef VECTOR_FOR_INORDER_I
|
||||
#undef HI_IDX
|
||||
#undef LO_IDX
|
||||
|
|
|
@ -6187,6 +6187,13 @@ GEN_VXFORM(vadduwm, 0, 2);
|
|||
GEN_VXFORM(vsububm, 0, 16);
|
||||
GEN_VXFORM(vsubuhm, 0, 17);
|
||||
GEN_VXFORM(vsubuwm, 0, 18);
|
||||
GEN_VXFORM(vavgub, 1, 16);
|
||||
GEN_VXFORM(vavguh, 1, 17);
|
||||
GEN_VXFORM(vavguw, 1, 18);
|
||||
GEN_VXFORM(vavgsb, 1, 20);
|
||||
GEN_VXFORM(vavgsh, 1, 21);
|
||||
GEN_VXFORM(vavgsw, 1, 22);
|
||||
|
||||
/*** SPE extension ***/
|
||||
/* Register moves */
|
||||
|
||||
|
|
Loading…
Reference in New Issue