Revision b04ae981 target-ppc/op_helper.c

b/target-ppc/op_helper.c
2093 2093
#undef MRGHI
2094 2094
#undef MRGLO
2095 2095

  
2096
void helper_vmsummbm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
2097
{
2098
    int32_t prod[16];
2099
    int i;
2100

  
2101
    for (i = 0; i < ARRAY_SIZE(r->s8); i++) {
2102
        prod[i] = (int32_t)a->s8[i] * b->u8[i];
2103
    }
2104

  
2105
    VECTOR_FOR_INORDER_I(i, s32) {
2106
        r->s32[i] = c->s32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] + prod[4*i+3];
2107
    }
2108
}
2109

  
2110
void helper_vmsumubm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
2111
{
2112
    uint16_t prod[16];
2113
    int i;
2114

  
2115
    for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
2116
        prod[i] = a->u8[i] * b->u8[i];
2117
    }
2118

  
2119
    VECTOR_FOR_INORDER_I(i, u32) {
2120
        r->u32[i] = c->u32[i] + prod[4*i] + prod[4*i+1] + prod[4*i+2] + prod[4*i+3];
2121
    }
2122
}
2123

  
2096 2124
#define VMUL_DO(name, mul_element, prod_element, evenp)                 \
2097 2125
    void helper_v##name (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)      \
2098 2126
    {                                                                   \

Also available in: Unified diff