mirror of https://github.com/xqemu/xqemu.git
target-ppc: Fix Altivec Shifts
Fix the implementation of the Altivec shift left and shift right instructions (vsl, vsr) which erroneously inverts shift direction on big endian hosts. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
36cbde7c30
commit
24e669ba53
|
@ -1552,13 +1552,6 @@ void helper_vlogefp(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HOST_WORDS_BIGENDIAN)
|
|
||||||
#define LEFT 0
|
|
||||||
#define RIGHT 1
|
|
||||||
#else
|
|
||||||
#define LEFT 1
|
|
||||||
#define RIGHT 0
|
|
||||||
#endif
|
|
||||||
/* The specification says that the results are undefined if all of the
|
/* The specification says that the results are undefined if all of the
|
||||||
* shift counts are not identical. We check to make sure that they are
|
* shift counts are not identical. We check to make sure that they are
|
||||||
* to conform to what real hardware appears to do. */
|
* to conform to what real hardware appears to do. */
|
||||||
|
@ -1588,11 +1581,9 @@ void helper_vlogefp(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *b)
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
VSHIFT(l, LEFT)
|
VSHIFT(l, 1)
|
||||||
VSHIFT(r, RIGHT)
|
VSHIFT(r, 0)
|
||||||
#undef VSHIFT
|
#undef VSHIFT
|
||||||
#undef LEFT
|
|
||||||
#undef RIGHT
|
|
||||||
|
|
||||||
#define VSL(suffix, element, mask) \
|
#define VSL(suffix, element, mask) \
|
||||||
void helper_vsl##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
void helper_vsl##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
|
||||||
|
|
Loading…
Reference in New Issue