softfloat: Name rounding mode enum

Give the previously unnamed enum a typedef name.  Use the packed
attribute so that we do not affect the layout of the float_status
struct.  Use it in the prototypes of relevant functions.

Adjust switch statements as necessary to avoid compiler warnings.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2020-05-05 09:01:49 -07:00
parent a828b373bd
commit 3dede407cc
6 changed files with 66 additions and 51 deletions

View file

@ -58,7 +58,8 @@ static inline void set_float_detect_tininess(bool val, float_status *status)
status->tininess_before_rounding = val;
}
static inline void set_float_rounding_mode(int val, float_status *status)
static inline void set_float_rounding_mode(FloatRoundMode val,
float_status *status)
{
status->float_rounding_mode = val;
}
@ -99,7 +100,7 @@ static inline bool get_float_detect_tininess(float_status *status)
return status->tininess_before_rounding;
}
static inline int get_float_rounding_mode(float_status *status)
static inline FloatRoundMode get_float_rounding_mode(float_status *status)
{
return status->float_rounding_mode;
}