Add vcmpequ{b, h, w} and vcmpgt{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@6236 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
0cbcd90636
commit
1add6e234a
|
@ -123,6 +123,24 @@ DEF_HELPER_3(vminuw, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmaxub, void, avr, avr, avr)
|
DEF_HELPER_3(vmaxub, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmaxuh, void, avr, avr, avr)
|
DEF_HELPER_3(vmaxuh, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmaxuw, void, avr, avr, avr)
|
DEF_HELPER_3(vmaxuw, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequb, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequh, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequw, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtub, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtuh, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtuw, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsb, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsh, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsw, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequb_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequh_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpequw_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtub_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtuh_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtuw_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsb_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsh_dot, void, avr, avr, avr)
|
||||||
|
DEF_HELPER_3(vcmpgtsw_dot, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmrglb, void, avr, avr, avr)
|
DEF_HELPER_3(vmrglb, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmrglh, void, avr, avr, avr)
|
DEF_HELPER_3(vmrglh, void, avr, avr, avr)
|
||||||
DEF_HELPER_3(vmrglw, void, avr, avr, avr)
|
DEF_HELPER_3(vmrglw, void, avr, avr, avr)
|
||||||
|
|
|
@ -2101,6 +2101,42 @@ VAVG(w, s32, int64_t, u32, uint64_t)
|
||||||
#undef VAVG_DO
|
#undef VAVG_DO
|
||||||
#undef VAVG
|
#undef VAVG
|
||||||
|
|
||||||
|
#define VCMP_DO(suffix, compare, element, record) \
|
||||||
|
void helper_vcmp##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
||||||
|
{ \
|
||||||
|
uint32_t ones = (uint32_t)-1; \
|
||||||
|
uint32_t all = ones; \
|
||||||
|
uint32_t none = 0; \
|
||||||
|
int i; \
|
||||||
|
for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
|
||||||
|
uint32_t result = (a->element[i] compare b->element[i] ? ones : 0x0); \
|
||||||
|
switch (sizeof (a->element[0])) { \
|
||||||
|
case 4: r->u32[i] = result; break; \
|
||||||
|
case 2: r->u16[i] = result; break; \
|
||||||
|
case 1: r->u8[i] = result; break; \
|
||||||
|
} \
|
||||||
|
all &= result; \
|
||||||
|
none |= result; \
|
||||||
|
} \
|
||||||
|
if (record) { \
|
||||||
|
env->crf[6] = ((all != 0) << 3) | ((none == 0) << 1); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
#define VCMP(suffix, compare, element) \
|
||||||
|
VCMP_DO(suffix, compare, element, 0) \
|
||||||
|
VCMP_DO(suffix##_dot, compare, element, 1)
|
||||||
|
VCMP(equb, ==, u8)
|
||||||
|
VCMP(equh, ==, u16)
|
||||||
|
VCMP(equw, ==, u32)
|
||||||
|
VCMP(gtub, >, u8)
|
||||||
|
VCMP(gtuh, >, u16)
|
||||||
|
VCMP(gtuw, >, u32)
|
||||||
|
VCMP(gtsb, >, s8)
|
||||||
|
VCMP(gtsh, >, s16)
|
||||||
|
VCMP(gtsw, >, s32)
|
||||||
|
#undef VCMP_DO
|
||||||
|
#undef VCMP
|
||||||
|
|
||||||
void helper_vmhaddshs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
|
void helper_vmhaddshs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
|
||||||
{
|
{
|
||||||
int sat = 0;
|
int sat = 0;
|
||||||
|
|
|
@ -6380,6 +6380,16 @@ GEN_VXFORM(vsumsws, 4, 30);
|
||||||
GEN_VXRFORM1(name, name, #name, opc2, opc3) \
|
GEN_VXRFORM1(name, name, #name, opc2, opc3) \
|
||||||
GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
|
GEN_VXRFORM1(name##_dot, name##_, #name ".", opc2, (opc3 | (0x1 << 4)))
|
||||||
|
|
||||||
|
GEN_VXRFORM(vcmpequb, 3, 0)
|
||||||
|
GEN_VXRFORM(vcmpequh, 3, 1)
|
||||||
|
GEN_VXRFORM(vcmpequw, 3, 2)
|
||||||
|
GEN_VXRFORM(vcmpgtsb, 3, 12)
|
||||||
|
GEN_VXRFORM(vcmpgtsh, 3, 13)
|
||||||
|
GEN_VXRFORM(vcmpgtsw, 3, 14)
|
||||||
|
GEN_VXRFORM(vcmpgtub, 3, 8)
|
||||||
|
GEN_VXRFORM(vcmpgtuh, 3, 9)
|
||||||
|
GEN_VXRFORM(vcmpgtuw, 3, 10)
|
||||||
|
|
||||||
#define GEN_VXFORM_NOA(name, opc2, opc3) \
|
#define GEN_VXFORM_NOA(name, opc2, opc3) \
|
||||||
GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) \
|
GEN_HANDLER(name, 0x04, opc2, opc3, 0x001f0000, PPC_ALTIVEC) \
|
||||||
{ \
|
{ \
|
||||||
|
|
Loading…
Reference in a new issue