diff options
author | Bharata B Rao <bharata@linux.vnet.ibm.com> | 2016-10-30 08:44:57 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2016-11-15 10:05:50 +1100 |
commit | 09a245e187efa64d1a42900ec1172087d8e8afda (patch) | |
tree | c6d8921fc8c22a87d70abe37c43aea5e423e822e /target-ppc/int_helper.c | |
parent | 3e00884f4e9f96cb25c03175d1848dd0eb2a22a8 (diff) |
target-ppc: add vrldnm and vrlwnm instructions
vrldnm: Vector Rotate Left Doubleword then AND with Mask
vrlwnm: Vector Rotate Left Word then AND with Mask
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target-ppc/int_helper.c')
-rw-r--r-- | target-ppc/int_helper.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c index e96dfe4ee6..8237bf5857 100644 --- a/target-ppc/int_helper.c +++ b/target-ppc/int_helper.c @@ -1718,7 +1718,7 @@ void helper_vrsqrtefp(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *b) } } -#define VRLMI(name, size, element) \ +#define VRLMI(name, size, element, insert) \ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ int i; \ @@ -1733,12 +1733,18 @@ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ begin = extract##size(src2, 16, 6); \ rot_val = rol##size(src1, shift); \ mask = mask_u##size(begin, end); \ - r->element[i] = (rot_val & mask) | (src3 & ~mask); \ + if (insert) { \ + r->element[i] = (rot_val & mask) | (src3 & ~mask); \ + } else { \ + r->element[i] = (rot_val & mask); \ + } \ } \ } -VRLMI(vrldmi, 64, u64); -VRLMI(vrlwmi, 32, u32); +VRLMI(vrldmi, 64, u64, 1); +VRLMI(vrlwmi, 32, u32, 1); +VRLMI(vrldnm, 64, u64, 0); +VRLMI(vrlwnm, 32, u32, 0); void helper_vsel(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) |