mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
target-ppc: Altivec 2.07: Add Vector Count Leading Zeroes
This patch adds the Vector Count Leading Zeroes instructions introduced in Power ISA Version 2.07 - vclzb, vclzh, vclzw and vclzd. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
953f0f5842
commit
f293f04ab5
|
@ -273,6 +273,11 @@ DEF_HELPER_4(vcfsx, void, env, avr, avr, i32)
|
|||
DEF_HELPER_4(vctuxs, void, env, avr, avr, i32)
|
||||
DEF_HELPER_4(vctsxs, void, env, avr, avr, i32)
|
||||
|
||||
DEF_HELPER_2(vclzb, void, avr, avr)
|
||||
DEF_HELPER_2(vclzh, void, avr, avr)
|
||||
DEF_HELPER_2(vclzw, void, avr, avr)
|
||||
DEF_HELPER_2(vclzd, void, avr, avr)
|
||||
|
||||
DEF_HELPER_2(xsadddp, void, env, i32)
|
||||
DEF_HELPER_2(xssubdp, void, env, i32)
|
||||
DEF_HELPER_2(xsmuldp, void, env, i32)
|
||||
|
|
|
@ -1524,6 +1524,35 @@ VUPK(lsh, s32, s16, UPKLO)
|
|||
#undef UPKHI
|
||||
#undef UPKLO
|
||||
|
||||
#define VGENERIC_DO(name, element) \
|
||||
void helper_v##name(ppc_avr_t *r, ppc_avr_t *b) \
|
||||
{ \
|
||||
int i; \
|
||||
\
|
||||
VECTOR_FOR_INORDER_I(i, element) { \
|
||||
r->element[i] = name(b->element[i]); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define clzb(v) ((v) ? clz32((uint32_t)(v) << 24) : 8)
|
||||
#define clzh(v) ((v) ? clz32((uint32_t)(v) << 16) : 16)
|
||||
#define clzw(v) clz32((v))
|
||||
#define clzd(v) clz64((v))
|
||||
|
||||
VGENERIC_DO(clzb, u8)
|
||||
VGENERIC_DO(clzh, u16)
|
||||
VGENERIC_DO(clzw, u32)
|
||||
VGENERIC_DO(clzd, u64)
|
||||
|
||||
#undef clzb
|
||||
#undef clzh
|
||||
#undef clzw
|
||||
#undef clzd
|
||||
|
||||
|
||||
#undef VGENERIC_DO
|
||||
|
||||
|
||||
#undef VECTOR_FOR_INORDER_I
|
||||
#undef HI_IDX
|
||||
#undef LO_IDX
|
||||
|
|
|
@ -7283,6 +7283,10 @@ GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20)
|
|||
GEN_VAFORM_PAIRED(vsel, vperm, 21)
|
||||
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23)
|
||||
|
||||
GEN_VXFORM_NOA(vclzb, 1, 28)
|
||||
GEN_VXFORM_NOA(vclzh, 1, 29)
|
||||
GEN_VXFORM_NOA(vclzw, 1, 30)
|
||||
GEN_VXFORM_NOA(vclzd, 1, 31)
|
||||
/*** VSX extension ***/
|
||||
|
||||
static inline TCGv_i64 cpu_vsrh(int n)
|
||||
|
@ -10504,6 +10508,11 @@ GEN_VAFORM_PAIRED(vmsumshm, vmsumshs, 20),
|
|||
GEN_VAFORM_PAIRED(vsel, vperm, 21),
|
||||
GEN_VAFORM_PAIRED(vmaddfp, vnmsubfp, 23),
|
||||
|
||||
GEN_VXFORM_207(vclzb, 1, 28),
|
||||
GEN_VXFORM_207(vclzh, 1, 29),
|
||||
GEN_VXFORM_207(vclzw, 1, 30),
|
||||
GEN_VXFORM_207(vclzd, 1, 31),
|
||||
|
||||
GEN_HANDLER_E(lxsdx, 0x1F, 0x0C, 0x12, 0, PPC_NONE, PPC2_VSX),
|
||||
GEN_HANDLER_E(lxsiwax, 0x1F, 0x0C, 0x02, 0, PPC_NONE, PPC2_VSX207),
|
||||
GEN_HANDLER_E(lxsiwzx, 0x1F, 0x0C, 0x00, 0, PPC_NONE, PPC2_VSX207),
|
||||
|
|
Loading…
Reference in a new issue