mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
target-ppc: Add xxextractuw instruction
xxextractuw: VSX Vector Extract Unsigned Word Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
0f358a0710
commit
8ad901e558
4 changed files with 62 additions and 0 deletions
|
@ -2001,6 +2001,32 @@ VEXTRACT(uw, u32)
|
|||
VEXTRACT(d, u64)
|
||||
#undef VEXTRACT
|
||||
|
||||
void helper_xxextractuw(CPUPPCState *env, target_ulong xtn,
|
||||
target_ulong xbn, uint32_t index)
|
||||
{
|
||||
ppc_vsr_t xt, xb;
|
||||
size_t es = sizeof(uint32_t);
|
||||
uint32_t ext_index;
|
||||
int i;
|
||||
|
||||
getVSR(xbn, &xb, env);
|
||||
memset(&xt, 0, sizeof(xt));
|
||||
|
||||
#if defined(HOST_WORDS_BIGENDIAN)
|
||||
ext_index = index;
|
||||
for (i = 0; i < es; i++, ext_index++) {
|
||||
xt.u8[8 - es + i] = xb.u8[ext_index % 16];
|
||||
}
|
||||
#else
|
||||
ext_index = 15 - index;
|
||||
for (i = es - 1; i >= 0; i--, ext_index--) {
|
||||
xt.u8[8 + i] = xb.u8[ext_index % 16];
|
||||
}
|
||||
#endif
|
||||
|
||||
putVSR(xtn, &xt, env);
|
||||
}
|
||||
|
||||
#define VEXT_SIGNED(name, element, mask, cast, recast) \
|
||||
void helper_##name(ppc_avr_t *r, ppc_avr_t *b) \
|
||||
{ \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue