mirror of
https://github.com/qemu/qemu.git
synced 2025-01-22 13:33:25 +08:00
Add vmrg{l,h}{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@6163 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
fad6cb1a56
commit
3b43004804
@ -123,6 +123,12 @@ 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_3(vmrglb, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmrglh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmrglw, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmrghb, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmrghh, void, avr, avr, avr)
|
||||
DEF_HELPER_3(vmrghw, void, avr, avr, avr)
|
||||
|
||||
DEF_HELPER_1(efscfsi, i32, i32)
|
||||
DEF_HELPER_1(efscfui, i32, i32)
|
||||
|
@ -2031,6 +2031,41 @@ VMINMAX(uw, u32)
|
||||
#undef VMINMAX_DO
|
||||
#undef VMINMAX
|
||||
|
||||
#define VMRG_DO(name, element, highp) \
|
||||
void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
||||
{ \
|
||||
ppc_avr_t result; \
|
||||
int i; \
|
||||
size_t n_elems = ARRAY_SIZE(r->element); \
|
||||
for (i = 0; i < n_elems/2; i++) { \
|
||||
if (highp) { \
|
||||
result.element[i*2+HI_IDX] = a->element[i]; \
|
||||
result.element[i*2+LO_IDX] = b->element[i]; \
|
||||
} else { \
|
||||
result.element[n_elems - i*2 - (1+HI_IDX)] = b->element[n_elems - i - 1]; \
|
||||
result.element[n_elems - i*2 - (1+LO_IDX)] = a->element[n_elems - i - 1]; \
|
||||
} \
|
||||
} \
|
||||
*r = result; \
|
||||
}
|
||||
#if defined(WORDS_BIGENDIAN)
|
||||
#define MRGHI 0
|
||||
#define MRGL0 1
|
||||
#else
|
||||
#define MRGHI 1
|
||||
#define MRGLO 0
|
||||
#endif
|
||||
#define VMRG(suffix, element) \
|
||||
VMRG_DO(mrgl##suffix, element, MRGHI) \
|
||||
VMRG_DO(mrgh##suffix, element, MRGLO)
|
||||
VMRG(b, u8)
|
||||
VMRG(h, u16)
|
||||
VMRG(w, u32)
|
||||
#undef VMRG_DO
|
||||
#undef VMRG
|
||||
#undef MRGHI
|
||||
#undef MRGLO
|
||||
|
||||
#undef VECTOR_FOR_INORDER_I
|
||||
#undef HI_IDX
|
||||
#undef LO_IDX
|
||||
|
@ -6205,6 +6205,12 @@ GEN_VXFORM(vavguw, 1, 18);
|
||||
GEN_VXFORM(vavgsb, 1, 20);
|
||||
GEN_VXFORM(vavgsh, 1, 21);
|
||||
GEN_VXFORM(vavgsw, 1, 22);
|
||||
GEN_VXFORM(vmrghb, 6, 0);
|
||||
GEN_VXFORM(vmrghh, 6, 1);
|
||||
GEN_VXFORM(vmrghw, 6, 2);
|
||||
GEN_VXFORM(vmrglb, 6, 4);
|
||||
GEN_VXFORM(vmrglh, 6, 5);
|
||||
GEN_VXFORM(vmrglw, 6, 6);
|
||||
|
||||
/*** SPE extension ***/
|
||||
/* Register moves */
|
||||
|
Loading…
Reference in New Issue
Block a user