softfloat: Use FloatRelation within partsN_compare
As the return type is FloatRelation, it's clearer to use the type for 'cmp' within the function. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220401132240.79730-3-richard.henderson@linaro.org>
This commit is contained in:
parent
b880867f15
commit
9343c88444
@ -1327,16 +1327,19 @@ static FloatRelation partsN(compare)(FloatPartsN *a, FloatPartsN *b,
|
|||||||
float_status *s, bool is_quiet)
|
float_status *s, bool is_quiet)
|
||||||
{
|
{
|
||||||
int ab_mask = float_cmask(a->cls) | float_cmask(b->cls);
|
int ab_mask = float_cmask(a->cls) | float_cmask(b->cls);
|
||||||
int cmp;
|
|
||||||
|
|
||||||
if (likely(ab_mask == float_cmask_normal)) {
|
if (likely(ab_mask == float_cmask_normal)) {
|
||||||
|
FloatRelation cmp;
|
||||||
|
|
||||||
if (a->sign != b->sign) {
|
if (a->sign != b->sign) {
|
||||||
goto a_sign;
|
goto a_sign;
|
||||||
}
|
}
|
||||||
if (a->exp != b->exp) {
|
if (a->exp == b->exp) {
|
||||||
cmp = a->exp < b->exp ? -1 : 1;
|
|
||||||
} else {
|
|
||||||
cmp = frac_cmp(a, b);
|
cmp = frac_cmp(a, b);
|
||||||
|
} else if (a->exp < b->exp) {
|
||||||
|
cmp = float_relation_less;
|
||||||
|
} else {
|
||||||
|
cmp = float_relation_greater;
|
||||||
}
|
}
|
||||||
if (a->sign) {
|
if (a->sign) {
|
||||||
cmp = -cmp;
|
cmp = -cmp;
|
||||||
|
Loading…
Reference in New Issue
Block a user