Revision 16d5b3ca target-arm/helper.c
b/target-arm/helper.c | ||
---|---|---|
3976 | 3976 |
} |
3977 | 3977 |
|
3978 | 3978 |
/* VFP3 fixed point conversion. */ |
3979 |
#define VFP_CONV_FIX(name, p, fsz, isz, itype) \
|
|
3979 |
#define VFP_CONV_FIX_FLOAT(name, p, fsz, isz, itype) \
|
|
3980 | 3980 |
float##fsz HELPER(vfp_##name##to##p)(uint##isz##_t x, uint32_t shift, \ |
3981 | 3981 |
void *fpstp) \ |
3982 | 3982 |
{ \ |
... | ... | |
3984 | 3984 |
float##fsz tmp; \ |
3985 | 3985 |
tmp = itype##_to_##float##fsz(x, fpst); \ |
3986 | 3986 |
return float##fsz##_scalbn(tmp, -(int)shift, fpst); \ |
3987 |
} \ |
|
3988 |
uint##isz##_t HELPER(vfp_to##name##p)(float##fsz x, uint32_t shift, \ |
|
3989 |
void *fpstp) \ |
|
3987 |
} |
|
3988 |
|
|
3989 |
#define VFP_CONV_FLOAT_FIX_ROUND(name, p, fsz, isz, itype, round) \ |
|
3990 |
uint##isz##_t HELPER(vfp_to##name##p##round)(float##fsz x, \ |
|
3991 |
uint32_t shift, \ |
|
3992 |
void *fpstp) \ |
|
3990 | 3993 |
{ \ |
3991 | 3994 |
float_status *fpst = fpstp; \ |
3992 | 3995 |
float##fsz tmp; \ |
... | ... | |
3995 | 3998 |
return 0; \ |
3996 | 3999 |
} \ |
3997 | 4000 |
tmp = float##fsz##_scalbn(x, shift, fpst); \ |
3998 |
return float##fsz##_to_##itype##_round_to_zero(tmp, fpst); \
|
|
4001 |
return float##fsz##_to_##itype##round(tmp, fpst); \
|
|
3999 | 4002 |
} |
4000 | 4003 |
|
4004 |
#define VFP_CONV_FIX(name, p, fsz, isz, itype) \ |
|
4005 |
VFP_CONV_FIX_FLOAT(name, p, fsz, isz, itype) \ |
|
4006 |
VFP_CONV_FLOAT_FIX_ROUND(name, p, fsz, isz, itype, _round_to_zero) |
|
4007 |
|
|
4001 | 4008 |
VFP_CONV_FIX(sh, d, 64, 64, int16) |
4002 | 4009 |
VFP_CONV_FIX(sl, d, 64, 64, int32) |
4003 | 4010 |
VFP_CONV_FIX(uh, d, 64, 64, uint16) |
... | ... | |
4007 | 4014 |
VFP_CONV_FIX(uh, s, 32, 32, uint16) |
4008 | 4015 |
VFP_CONV_FIX(ul, s, 32, 32, uint32) |
4009 | 4016 |
#undef VFP_CONV_FIX |
4017 |
#undef VFP_CONV_FIX_FLOAT |
|
4018 |
#undef VFP_CONV_FLOAT_FIX_ROUND |
|
4010 | 4019 |
|
4011 | 4020 |
/* Half precision conversions. */ |
4012 | 4021 |
static float32 do_fcvt_f16_to_f32(uint32_t a, CPUARMState *env, float_status *s) |
Also available in: Unified diff