Revision 5335a145 target-ppc/op_helper.c
b/target-ppc/op_helper.c | ||
---|---|---|
2190 | 2190 |
*r = result; |
2191 | 2191 |
} |
2192 | 2192 |
|
2193 |
#if defined(WORDS_BIGENDIAN) |
|
2194 |
#define PKBIG 1 |
|
2195 |
#else |
|
2196 |
#define PKBIG 0 |
|
2197 |
#endif |
|
2198 |
#define VPK(suffix, from, to, cvt, dosat) \ |
|
2199 |
void helper_vpk##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
|
2200 |
{ \ |
|
2201 |
int i; \ |
|
2202 |
int sat = 0; \ |
|
2203 |
ppc_avr_t result; \ |
|
2204 |
ppc_avr_t *a0 = PKBIG ? a : b; \ |
|
2205 |
ppc_avr_t *a1 = PKBIG ? b : a; \ |
|
2206 |
VECTOR_FOR_INORDER_I (i, from) { \ |
|
2207 |
result.to[i] = cvt(a0->from[i], &sat); \ |
|
2208 |
result.to[i+ARRAY_SIZE(r->from)] = cvt(a1->from[i], &sat); \ |
|
2209 |
} \ |
|
2210 |
*r = result; \ |
|
2211 |
if (dosat && sat) { \ |
|
2212 |
env->vscr |= (1 << VSCR_SAT); \ |
|
2213 |
} \ |
|
2214 |
} |
|
2215 |
#define I(x, y) (x) |
|
2216 |
VPK(shss, s16, s8, cvtshsb, 1) |
|
2217 |
VPK(shus, s16, u8, cvtshub, 1) |
|
2218 |
VPK(swss, s32, s16, cvtswsh, 1) |
|
2219 |
VPK(swus, s32, u16, cvtswuh, 1) |
|
2220 |
VPK(uhus, u16, u8, cvtuhub, 1) |
|
2221 |
VPK(uwus, u32, u16, cvtuwuh, 1) |
|
2222 |
VPK(uhum, u16, u8, I, 0) |
|
2223 |
VPK(uwum, u32, u16, I, 0) |
|
2224 |
#undef I |
|
2225 |
#undef VPK |
|
2226 |
#undef PKBIG |
|
2227 |
|
|
2193 | 2228 |
#define VROTATE(suffix, element) \ |
2194 | 2229 |
void helper_vrl##suffix (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ |
2195 | 2230 |
{ \ |
Also available in: Unified diff