Revision b068d6a7 target-ppc/op_helper.h
b/target-ppc/op_helper.h | ||
---|---|---|
277 | 277 |
|
278 | 278 |
/* Inlined helpers: used in micro-operation as well as helpers */ |
279 | 279 |
/* Generic fixed-point helpers */ |
280 |
static inline int _do_cntlzw (uint32_t val) |
|
280 |
static always_inline int _do_cntlzw (uint32_t val)
|
|
281 | 281 |
{ |
282 | 282 |
int cnt = 0; |
283 | 283 |
if (!(val & 0xFFFF0000UL)) { |
... | ... | |
306 | 306 |
return cnt; |
307 | 307 |
} |
308 | 308 |
|
309 |
static inline int _do_cntlzd (uint64_t val) |
|
309 |
static always_inline int _do_cntlzd (uint64_t val)
|
|
310 | 310 |
{ |
311 | 311 |
int cnt = 0; |
312 | 312 |
#if HOST_LONG_BITS == 64 |
... | ... | |
350 | 350 |
#if defined(TARGET_PPCEMB) |
351 | 351 |
/* SPE extension */ |
352 | 352 |
/* Single precision floating-point helpers */ |
353 |
static inline uint32_t _do_efsabs (uint32_t val) |
|
353 |
static always_inline uint32_t _do_efsabs (uint32_t val)
|
|
354 | 354 |
{ |
355 | 355 |
return val & ~0x80000000; |
356 | 356 |
} |
357 |
static inline uint32_t _do_efsnabs (uint32_t val) |
|
357 |
static always_inline uint32_t _do_efsnabs (uint32_t val)
|
|
358 | 358 |
{ |
359 | 359 |
return val | 0x80000000; |
360 | 360 |
} |
361 |
static inline uint32_t _do_efsneg (uint32_t val) |
|
361 |
static always_inline uint32_t _do_efsneg (uint32_t val)
|
|
362 | 362 |
{ |
363 | 363 |
return val ^ 0x80000000; |
364 | 364 |
} |
365 |
static inline uint32_t _do_efsadd (uint32_t op1, uint32_t op2) |
|
365 |
static always_inline uint32_t _do_efsadd (uint32_t op1, uint32_t op2)
|
|
366 | 366 |
{ |
367 | 367 |
union { |
368 | 368 |
uint32_t u; |
... | ... | |
373 | 373 |
u1.f = float32_add(u1.f, u2.f, &env->spe_status); |
374 | 374 |
return u1.u; |
375 | 375 |
} |
376 |
static inline uint32_t _do_efssub (uint32_t op1, uint32_t op2) |
|
376 |
static always_inline uint32_t _do_efssub (uint32_t op1, uint32_t op2)
|
|
377 | 377 |
{ |
378 | 378 |
union { |
379 | 379 |
uint32_t u; |
... | ... | |
384 | 384 |
u1.f = float32_sub(u1.f, u2.f, &env->spe_status); |
385 | 385 |
return u1.u; |
386 | 386 |
} |
387 |
static inline uint32_t _do_efsmul (uint32_t op1, uint32_t op2) |
|
387 |
static always_inline uint32_t _do_efsmul (uint32_t op1, uint32_t op2)
|
|
388 | 388 |
{ |
389 | 389 |
union { |
390 | 390 |
uint32_t u; |
... | ... | |
395 | 395 |
u1.f = float32_mul(u1.f, u2.f, &env->spe_status); |
396 | 396 |
return u1.u; |
397 | 397 |
} |
398 |
static inline uint32_t _do_efsdiv (uint32_t op1, uint32_t op2) |
|
398 |
static always_inline uint32_t _do_efsdiv (uint32_t op1, uint32_t op2)
|
|
399 | 399 |
{ |
400 | 400 |
union { |
401 | 401 |
uint32_t u; |
... | ... | |
407 | 407 |
return u1.u; |
408 | 408 |
} |
409 | 409 |
|
410 |
static inline int _do_efststlt (uint32_t op1, uint32_t op2) |
|
410 |
static always_inline int _do_efststlt (uint32_t op1, uint32_t op2)
|
|
411 | 411 |
{ |
412 | 412 |
union { |
413 | 413 |
uint32_t u; |
... | ... | |
417 | 417 |
u2.u = op2; |
418 | 418 |
return float32_lt(u1.f, u2.f, &env->spe_status) ? 1 : 0; |
419 | 419 |
} |
420 |
static inline int _do_efststgt (uint32_t op1, uint32_t op2) |
|
420 |
static always_inline int _do_efststgt (uint32_t op1, uint32_t op2)
|
|
421 | 421 |
{ |
422 | 422 |
union { |
423 | 423 |
uint32_t u; |
... | ... | |
427 | 427 |
u2.u = op2; |
428 | 428 |
return float32_le(u1.f, u2.f, &env->spe_status) ? 0 : 1; |
429 | 429 |
} |
430 |
static inline int _do_efststeq (uint32_t op1, uint32_t op2) |
|
430 |
static always_inline int _do_efststeq (uint32_t op1, uint32_t op2)
|
|
431 | 431 |
{ |
432 | 432 |
union { |
433 | 433 |
uint32_t u; |
... | ... | |
438 | 438 |
return float32_eq(u1.f, u2.f, &env->spe_status) ? 1 : 0; |
439 | 439 |
} |
440 | 440 |
/* Double precision floating-point helpers */ |
441 |
static inline int _do_efdtstlt (uint64_t op1, uint64_t op2) |
|
441 |
static always_inline int _do_efdtstlt (uint64_t op1, uint64_t op2)
|
|
442 | 442 |
{ |
443 | 443 |
union { |
444 | 444 |
uint64_t u; |
... | ... | |
448 | 448 |
u2.u = op2; |
449 | 449 |
return float64_lt(u1.f, u2.f, &env->spe_status) ? 1 : 0; |
450 | 450 |
} |
451 |
static inline int _do_efdtstgt (uint64_t op1, uint64_t op2) |
|
451 |
static always_inline int _do_efdtstgt (uint64_t op1, uint64_t op2)
|
|
452 | 452 |
{ |
453 | 453 |
union { |
454 | 454 |
uint64_t u; |
... | ... | |
458 | 458 |
u2.u = op2; |
459 | 459 |
return float64_le(u1.f, u2.f, &env->spe_status) ? 0 : 1; |
460 | 460 |
} |
461 |
static inline int _do_efdtsteq (uint64_t op1, uint64_t op2) |
|
461 |
static always_inline int _do_efdtsteq (uint64_t op1, uint64_t op2)
|
|
462 | 462 |
{ |
463 | 463 |
union { |
464 | 464 |
uint64_t u; |
Also available in: Unified diff