Revision cd633b10 target-ppc/op_helper.c

b/target-ppc/op_helper.c
2145 2145
VSL(w, u32)
2146 2146
#undef VSL
2147 2147

  
2148
void helper_vsldoi (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, uint32_t shift)
2149
{
2150
    int sh = shift & 0xf;
2151
    int i;
2152
    ppc_avr_t result;
2153

  
2154
#if defined(WORDS_BIGENDIAN)
2155
    for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
2156
        int index = sh + i;
2157
        if (index > 0xf) {
2158
            result.u8[i] = b->u8[index-0x10];
2159
        } else {
2160
            result.u8[i] = a->u8[index];
2161
        }
2162
    }
2163
#else
2164
    for (i = 0; i < ARRAY_SIZE(r->u8); i++) {
2165
        int index = (16 - sh) + i;
2166
        if (index > 0xf) {
2167
            result.u8[i] = a->u8[index-0x10];
2168
        } else {
2169
            result.u8[i] = b->u8[index];
2170
        }
2171
    }
2172
#endif
2173
    *r = result;
2174
}
2175

  
2148 2176
void helper_vslo (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)
2149 2177
{
2150 2178
  int sh = (b->u8[LO_IDX*0xf] >> 3) & 0xf;

Also available in: Unified diff