Revision eae07261 target-ppc/op_helper.c

b/target-ppc/op_helper.c
2166 2166
    }
2167 2167
}
2168 2168

  
2169
void helper_vmsumshm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
2170
{
2171
    int32_t prod[8];
2172
    int i;
2173

  
2174
    for (i = 0; i < ARRAY_SIZE(r->s16); i++) {
2175
        prod[i] = a->s16[i] * b->s16[i];
2176
    }
2177

  
2178
    VECTOR_FOR_INORDER_I(i, s32) {
2179
        r->s32[i] = c->s32[i] + prod[2*i] + prod[2*i+1];
2180
    }
2181
}
2182

  
2183
void helper_vmsumshs (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
2184
{
2185
    int32_t prod[8];
2186
    int i;
2187
    int sat = 0;
2188

  
2189
    for (i = 0; i < ARRAY_SIZE(r->s16); i++) {
2190
        prod[i] = (int32_t)a->s16[i] * b->s16[i];
2191
    }
2192

  
2193
    VECTOR_FOR_INORDER_I (i, s32) {
2194
        int64_t t = (int64_t)c->s32[i] + prod[2*i] + prod[2*i+1];
2195
        r->u32[i] = cvtsdsw(t, &sat);
2196
    }
2197

  
2198
    if (sat) {
2199
        env->vscr |= (1 << VSCR_SAT);
2200
    }
2201
}
2202

  
2169 2203
void helper_vmsumubm (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c)
2170 2204
{
2171 2205
    uint16_t prod[16];

Also available in: Unified diff