Revision 3670669c target-arm/helper.c
b/target-arm/helper.c | ||
---|---|---|
347 | 347 |
return count; |
348 | 348 |
} |
349 | 349 |
|
350 |
int32_t HELPER(sdiv)(int32_t num, int32_t den) |
|
351 |
{ |
|
352 |
if (den == 0) |
|
353 |
return 0; |
|
354 |
return num / den; |
|
355 |
} |
|
356 |
|
|
357 |
uint32_t HELPER(udiv)(uint32_t num, uint32_t den) |
|
358 |
{ |
|
359 |
if (den == 0) |
|
360 |
return 0; |
|
361 |
return num / den; |
|
362 |
} |
|
363 |
|
|
364 |
uint32_t HELPER(rbit)(uint32_t x) |
|
365 |
{ |
|
366 |
x = ((x & 0xff000000) >> 24) |
|
367 |
| ((x & 0x00ff0000) >> 8) |
|
368 |
| ((x & 0x0000ff00) << 8) |
|
369 |
| ((x & 0x000000ff) << 24); |
|
370 |
x = ((x & 0xf0f0f0f0) >> 4) |
|
371 |
| ((x & 0x0f0f0f0f) << 4); |
|
372 |
x = ((x & 0x88888888) >> 3) |
|
373 |
| ((x & 0x44444444) >> 1) |
|
374 |
| ((x & 0x22222222) << 1) |
|
375 |
| ((x & 0x11111111) << 3); |
|
376 |
return x; |
|
377 |
} |
|
378 |
|
|
350 | 379 |
#if defined(CONFIG_USER_ONLY) |
351 | 380 |
|
352 | 381 |
void do_interrupt (CPUState *env) |
Also available in: Unified diff