mirror of
https://github.com/stnolting/neorv32.git
synced 2025-04-23 13:47:33 -04:00
[sw] float_test: fix rounding
use round to nearby integral
This commit is contained in:
parent
36ae947c32
commit
36ae41d5b3
1 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@
|
|||
// # ********************************************************************************************* #
|
||||
// # BSD 3-Clause License #
|
||||
// # #
|
||||
// # Copyright (c) 2022, Stephan Nolting. All rights reserved. #
|
||||
// # Copyright (c) 2024, Stephan Nolting. All rights reserved. #
|
||||
// # #
|
||||
// # Redistribution and use in source and binary forms, with or without modification, are #
|
||||
// # permitted provided that the following conditions are met: #
|
||||
|
@ -670,7 +670,7 @@ uint32_t __attribute__ ((noinline)) riscv_emulate_fcvt_wus(float rs1) {
|
|||
|
||||
float opa = subnormal_flush(rs1);
|
||||
|
||||
return (uint32_t)roundf(opa);
|
||||
return (uint32_t)rint(opa);
|
||||
}
|
||||
|
||||
|
||||
|
@ -684,7 +684,7 @@ int32_t __attribute__ ((noinline)) riscv_emulate_fcvt_ws(float rs1) {
|
|||
|
||||
float opa = subnormal_flush(rs1);
|
||||
|
||||
return (int32_t)roundf(opa);
|
||||
return (int32_t)rint(opa);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue