mirror of https://gitee.com/openkylin/qemu.git
Add v{min, max}{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@6157 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
fab3cbe901
commit
e40393399a
|
@ -111,6 +111,18 @@ 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_3(vminsb, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vminsh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vminsw, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxsb, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxsh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxsw, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vminub, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vminuh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vminuw, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxub, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxuh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmaxuw, void, avr, avr, avr)
|
||||
|
||||
DEF_HELPER_1(efscfsi, i32, i32)
|
||||
DEF_HELPER_1(efscfui, i32, i32)
|
||||
|
|
|
@ -2007,6 +2007,30 @@ VAVG(w, s32, int64_t, u32, uint64_t)
|
|||
#undef VAVG_DO
|
||||
#undef VAVG
|
||||
|
||||
#define VMINMAX_DO(name, compare, element) \
|
||||
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++) { \
|
||||
if (a->element[i] compare b->element[i]) { \
|
||||
r->element[i] = b->element[i]; \
|
||||
} else { \
|
||||
r->element[i] = a->element[i]; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
#define VMINMAX(suffix, element) \
|
||||
VMINMAX_DO(min##suffix, >, element) \
|
||||
VMINMAX_DO(max##suffix, <, element)
|
||||
VMINMAX(sb, s8)
|
||||
VMINMAX(sh, s16)
|
||||
VMINMAX(sw, s32)
|
||||
VMINMAX(ub, u8)
|
||||
VMINMAX(uh, u16)
|
||||
VMINMAX(uw, u32)
|
||||
#undef VMINMAX_DO
|
||||
#undef VMINMAX
|
||||
|
||||
#undef VECTOR_FOR_INORDER_I
|
||||
#undef HI_IDX
|
||||
#undef LO_IDX
|
||||
|
|
|
@ -6187,6 +6187,18 @@ GEN_VXFORM(vadduwm, 0, 2);
|
|||
GEN_VXFORM(vsububm, 0, 16);
|
||||
GEN_VXFORM(vsubuhm, 0, 17);
|
||||
GEN_VXFORM(vsubuwm, 0, 18);
|
||||
GEN_VXFORM(vmaxub, 1, 0);
|
||||
GEN_VXFORM(vmaxuh, 1, 1);
|
||||
GEN_VXFORM(vmaxuw, 1, 2);
|
||||
GEN_VXFORM(vmaxsb, 1, 4);
|
||||
GEN_VXFORM(vmaxsh, 1, 5);
|
||||
GEN_VXFORM(vmaxsw, 1, 6);
|
||||
GEN_VXFORM(vminub, 1, 8);
|
||||
GEN_VXFORM(vminuh, 1, 9);
|
||||
GEN_VXFORM(vminuw, 1, 10);
|
||||
GEN_VXFORM(vminsb, 1, 12);
|
||||
GEN_VXFORM(vminsh, 1, 13);
|
||||
GEN_VXFORM(vminsw, 1, 14);
|
||||
GEN_VXFORM(vavgub, 1, 16);
|
||||
GEN_VXFORM(vavguh, 1, 17);
|
||||
GEN_VXFORM(vavguw, 1, 18);
|
||||
|
|
Loading…
Reference in New Issue