Revision e97db91c target-arm/helper.c

b/target-arm/helper.c
4353 4353
    float_status *fpst = fpstp;
4354 4354
    return float64_muladd(a, b, c, 0, fpst);
4355 4355
}
4356

  
4357
/* ARMv8 round to integral */
4358
float32 HELPER(rints_exact)(float32 x, void *fp_status)
4359
{
4360
    return float32_round_to_int(x, fp_status);
4361
}
4362

  
4363
float64 HELPER(rintd_exact)(float64 x, void *fp_status)
4364
{
4365
    return float64_round_to_int(x, fp_status);
4366
}
4367

  
4368
float32 HELPER(rints)(float32 x, void *fp_status)
4369
{
4370
    int old_flags = get_float_exception_flags(fp_status), new_flags;
4371
    float32 ret;
4372

  
4373
    ret = float32_round_to_int(x, fp_status);
4374

  
4375
    /* Suppress any inexact exceptions the conversion produced */
4376
    if (!(old_flags & float_flag_inexact)) {
4377
        new_flags = get_float_exception_flags(fp_status);
4378
        set_float_exception_flags(new_flags & ~float_flag_inexact, fp_status);
4379
    }
4380

  
4381
    return ret;
4382
}
4383

  
4384
float64 HELPER(rintd)(float64 x, void *fp_status)
4385
{
4386
    int old_flags = get_float_exception_flags(fp_status), new_flags;
4387
    float64 ret;
4388

  
4389
    ret = float64_round_to_int(x, fp_status);
4390

  
4391
    new_flags = get_float_exception_flags(fp_status);
4392

  
4393
    /* Suppress any inexact exceptions the conversion produced */
4394
    if (!(old_flags & float_flag_inexact)) {
4395
        new_flags = get_float_exception_flags(fp_status);
4396
        set_float_exception_flags(new_flags & ~float_flag_inexact, fp_status);
4397
    }
4398

  
4399
    return ret;
4400
}

Also available in: Unified diff