Revision 2c277908 target-ppc/op_helper.c
b/target-ppc/op_helper.c | ||
---|---|---|
2066 | 2066 |
#undef MRGHI |
2067 | 2067 |
#undef MRGLO |
2068 | 2068 |
|
2069 |
#define VMUL_DO(name, mul_element, prod_element, evenp) \ |
|
2070 |
void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
|
2071 |
{ \ |
|
2072 |
int i; \ |
|
2073 |
VECTOR_FOR_INORDER_I(i, prod_element) { \ |
|
2074 |
if (evenp) { \ |
|
2075 |
r->prod_element[i] = a->mul_element[i*2+HI_IDX] * b->mul_element[i*2+HI_IDX]; \ |
|
2076 |
} else { \ |
|
2077 |
r->prod_element[i] = a->mul_element[i*2+LO_IDX] * b->mul_element[i*2+LO_IDX]; \ |
|
2078 |
} \ |
|
2079 |
} \ |
|
2080 |
} |
|
2081 |
#define VMUL(suffix, mul_element, prod_element) \ |
|
2082 |
VMUL_DO(mule##suffix, mul_element, prod_element, 1) \ |
|
2083 |
VMUL_DO(mulo##suffix, mul_element, prod_element, 0) |
|
2084 |
VMUL(sb, s8, s16) |
|
2085 |
VMUL(sh, s16, s32) |
|
2086 |
VMUL(ub, u8, u16) |
|
2087 |
VMUL(uh, u16, u32) |
|
2088 |
#undef VMUL_DO |
|
2089 |
#undef VMUL |
|
2090 |
|
|
2069 | 2091 |
#undef VECTOR_FOR_INORDER_I |
2070 | 2092 |
#undef HI_IDX |
2071 | 2093 |
#undef LO_IDX |
Also available in: Unified diff