Revision d79f0809 target-ppc/op_helper.c

b/target-ppc/op_helper.c
2088 2088
#undef VMUL_DO
2089 2089
#undef VMUL
2090 2090

  
2091
#define VSL(suffix, element)                                            \
2092
    void helper_vsl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)  \
2093
    {                                                                   \
2094
        int i;                                                          \
2095
        for (i = 0; i < ARRAY_SIZE(r->element); i++) {                  \
2096
            unsigned int mask = ((1 << (3 + (sizeof (a->element[0]) >> 1))) - 1); \
2097
            unsigned int shift = b->element[i] & mask;                  \
2098
            r->element[i] = a->element[i] << shift;                     \
2099
        }                                                               \
2100
    }
2101
VSL(b, u8)
2102
VSL(h, u16)
2103
VSL(w, u32)
2104
#undef VSL
2105

  
2091 2106
#define VSR(suffix, element)                                            \
2092 2107
    void helper_vsr##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)  \
2093 2108
    {                                                                   \

Also available in: Unified diff