[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH RFC v0 2/6] target-ppc: add vabsdu[b, h, w] instru
From: |
Nikunj A Dadhania |
Subject: |
Re: [Qemu-ppc] [PATCH RFC v0 2/6] target-ppc: add vabsdu[b, h, w] instructions |
Date: |
Wed, 27 Jul 2016 11:49:45 +0530 |
User-agent: |
Notmuch/0.21 (https://notmuchmail.org) Emacs/25.0.94.1 (x86_64-redhat-linux-gnu) |
David Gibson <address@hidden> writes:
> [ Unknown signature status ]
> On Wed, Jul 27, 2016 at 12:56:54AM +0530, Nikunj A Dadhania wrote:
>> From: Sandipan Das <address@hidden>
>>
>> Adds following instructions:
>>
>> vabsdub: Vector Absolute Difference Unsigned Byte
>> vabsduh: Vector Absolute Difference Unsigned Halfword
>> vabsduw: Vector Absolute Difference Unsigned Word
>>
>> Signed-off-by: Sandipan Das <address@hidden>
>> [ use ISA300 define and abs() ]
>> Signed-off-by: Nikunj A Dadhania <address@hidden>
>> ---
>> target-ppc/helper.h | 3 +++
>> target-ppc/int_helper.c | 23 +++++++++++++++++++++++
>> target-ppc/translate.c | 15 ++++++++++++---
>> 3 files changed, 38 insertions(+), 3 deletions(-)
>>
>> diff --git a/target-ppc/helper.h b/target-ppc/helper.h
>> index 68fd19e..ff6287e 100644
>> --- a/target-ppc/helper.h
>> +++ b/target-ppc/helper.h
>> @@ -118,6 +118,9 @@ DEF_HELPER_3(vsubudm, void, avr, avr, avr)
>> DEF_HELPER_3(vavgub, void, avr, avr, avr)
>> DEF_HELPER_3(vavguh, void, avr, avr, avr)
>> DEF_HELPER_3(vavguw, void, avr, avr, avr)
>> +DEF_HELPER_3(vabsdub, void, avr, avr, avr)
>> +DEF_HELPER_3(vabsduh, void, avr, avr, avr)
>> +DEF_HELPER_3(vabsduw, void, avr, avr, avr)
>> DEF_HELPER_3(vavgsb, void, avr, avr, avr)
>> DEF_HELPER_3(vavgsh, void, avr, avr, avr)
>> DEF_HELPER_3(vavgsw, void, avr, avr, avr)
>> diff --git a/target-ppc/int_helper.c b/target-ppc/int_helper.c
>> index 15947ad..c1b341c 100644
>> --- a/target-ppc/int_helper.c
>> +++ b/target-ppc/int_helper.c
>> @@ -629,6 +629,29 @@ VAVG(w, s32, int64_t, u32, uint64_t)
>> #undef VAVG_DO
>> #undef VAVG
>>
>> +#define VABSDU_DO(name, element, etype) \
>
> You don't appear to actually use the type parameter.
Right, after adding abs(), its not required.
>
>> +void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \
>> +{ \
>> + int i; \
>> + \
>> + for (i = 0; i < ARRAY_SIZE(r->element); i++) { \
>> + r->element[i] = abs(a->element[i] - b->element[i]); \
>> + } \
>> +}
>> +
>> +/* VABSDU - Vector absolute difference unsigned
>> + * name - instruction mnemonic suffix (b: byte, h: halfword, w: word)
>> + * element - element type to access from vector
>> + * etype - internal data type to use for elements
>> + */
>> +#define VABSDU(type, element, etype) \
>> + VABSDU_DO(absdu##type, element, etype)
>> +VABSDU(b, u8, uint16_t)
>> +VABSDU(h, u16, uint32_t)
>> +VABSDU(w, u32, uint64_t)
>> +#undef VABSDU_DO
>> +#undef VABSDU
>> +
Regards
Nikunj
- [Qemu-ppc] [PATCH RFC v0 0/6] POWER9 TCG enablements - part2, Nikunj A Dadhania, 2016/07/26
- [Qemu-ppc] [PATCH RFC v0 1/6] target-ppc: add dtstsfi[q] instructions, Nikunj A Dadhania, 2016/07/26
- [Qemu-ppc] [PATCH RFC v0 2/6] target-ppc: add vabsdu[b, h, w] instructions, Nikunj A Dadhania, 2016/07/26
- [Qemu-ppc] [PATCH RFC v0 3/6] target-ppc: add vcmpnez[b, h, w][.] instructions, Nikunj A Dadhania, 2016/07/26
- [Qemu-ppc] [PATCH RFC v0 4/6] target-ppc: add vslv instruction, Nikunj A Dadhania, 2016/07/26
- [Qemu-ppc] [PATCH RFC v0 5/6] target-ppc: add vsrv instruction, Nikunj A Dadhania, 2016/07/26