Revisión | 71bfd65c5fcd72f8af2735905415c7ce4220f6dc (tree) |
---|---|
Tiempo | 2020-05-20 00:41:45 |
Autor | Richard Henderson <richard.henderson@lina...> |
Commiter | Richard Henderson |
softfloat: Name compare relation enum
Give the previously unnamed enum a typedef name. Use it in the
prototypes of compare functions. Use it to hold the results
of the compare functions.
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>
@@ -2848,8 +2848,8 @@ MINMAX(64, maxnummag, false, true, true) | ||
2848 | 2848 | #undef MINMAX |
2849 | 2849 | |
2850 | 2850 | /* Floating point compare */ |
2851 | -static int compare_floats(FloatParts a, FloatParts b, bool is_quiet, | |
2852 | - float_status *s) | |
2851 | +static FloatRelation compare_floats(FloatParts a, FloatParts b, bool is_quiet, | |
2852 | + float_status *s) | |
2853 | 2853 | { |
2854 | 2854 | if (is_nan(a.cls) || is_nan(b.cls)) { |
2855 | 2855 | if (!is_quiet || |
@@ -2920,17 +2920,17 @@ COMPARE(soft_f64_compare, QEMU_SOFTFLOAT_ATTR, 64) | ||
2920 | 2920 | |
2921 | 2921 | #undef COMPARE |
2922 | 2922 | |
2923 | -int float16_compare(float16 a, float16 b, float_status *s) | |
2923 | +FloatRelation float16_compare(float16 a, float16 b, float_status *s) | |
2924 | 2924 | { |
2925 | 2925 | return soft_f16_compare(a, b, false, s); |
2926 | 2926 | } |
2927 | 2927 | |
2928 | -int float16_compare_quiet(float16 a, float16 b, float_status *s) | |
2928 | +FloatRelation float16_compare_quiet(float16 a, float16 b, float_status *s) | |
2929 | 2929 | { |
2930 | 2930 | return soft_f16_compare(a, b, true, s); |
2931 | 2931 | } |
2932 | 2932 | |
2933 | -static int QEMU_FLATTEN | |
2933 | +static FloatRelation QEMU_FLATTEN | |
2934 | 2934 | f32_compare(float32 xa, float32 xb, bool is_quiet, float_status *s) |
2935 | 2935 | { |
2936 | 2936 | union_float32 ua, ub; |
@@ -2959,17 +2959,17 @@ f32_compare(float32 xa, float32 xb, bool is_quiet, float_status *s) | ||
2959 | 2959 | return soft_f32_compare(ua.s, ub.s, is_quiet, s); |
2960 | 2960 | } |
2961 | 2961 | |
2962 | -int float32_compare(float32 a, float32 b, float_status *s) | |
2962 | +FloatRelation float32_compare(float32 a, float32 b, float_status *s) | |
2963 | 2963 | { |
2964 | 2964 | return f32_compare(a, b, false, s); |
2965 | 2965 | } |
2966 | 2966 | |
2967 | -int float32_compare_quiet(float32 a, float32 b, float_status *s) | |
2967 | +FloatRelation float32_compare_quiet(float32 a, float32 b, float_status *s) | |
2968 | 2968 | { |
2969 | 2969 | return f32_compare(a, b, true, s); |
2970 | 2970 | } |
2971 | 2971 | |
2972 | -static int QEMU_FLATTEN | |
2972 | +static FloatRelation QEMU_FLATTEN | |
2973 | 2973 | f64_compare(float64 xa, float64 xb, bool is_quiet, float_status *s) |
2974 | 2974 | { |
2975 | 2975 | union_float64 ua, ub; |
@@ -2998,12 +2998,12 @@ f64_compare(float64 xa, float64 xb, bool is_quiet, float_status *s) | ||
2998 | 2998 | return soft_f64_compare(ua.s, ub.s, is_quiet, s); |
2999 | 2999 | } |
3000 | 3000 | |
3001 | -int float64_compare(float64 a, float64 b, float_status *s) | |
3001 | +FloatRelation float64_compare(float64 a, float64 b, float_status *s) | |
3002 | 3002 | { |
3003 | 3003 | return f64_compare(a, b, false, s); |
3004 | 3004 | } |
3005 | 3005 | |
3006 | -int float64_compare_quiet(float64 a, float64 b, float_status *s) | |
3006 | +FloatRelation float64_compare_quiet(float64 a, float64 b, float_status *s) | |
3007 | 3007 | { |
3008 | 3008 | return f64_compare(a, b, true, s); |
3009 | 3009 | } |
@@ -7892,8 +7892,9 @@ int float128_unordered_quiet(float128 a, float128 b, float_status *status) | ||
7892 | 7892 | return 0; |
7893 | 7893 | } |
7894 | 7894 | |
7895 | -static inline int floatx80_compare_internal(floatx80 a, floatx80 b, | |
7896 | - int is_quiet, float_status *status) | |
7895 | +static inline FloatRelation | |
7896 | +floatx80_compare_internal(floatx80 a, floatx80 b, bool is_quiet, | |
7897 | + float_status *status) | |
7897 | 7898 | { |
7898 | 7899 | bool aSign, bSign; |
7899 | 7900 |
@@ -7939,18 +7940,20 @@ static inline int floatx80_compare_internal(floatx80 a, floatx80 b, | ||
7939 | 7940 | } |
7940 | 7941 | } |
7941 | 7942 | |
7942 | -int floatx80_compare(floatx80 a, floatx80 b, float_status *status) | |
7943 | +FloatRelation floatx80_compare(floatx80 a, floatx80 b, float_status *status) | |
7943 | 7944 | { |
7944 | 7945 | return floatx80_compare_internal(a, b, 0, status); |
7945 | 7946 | } |
7946 | 7947 | |
7947 | -int floatx80_compare_quiet(floatx80 a, floatx80 b, float_status *status) | |
7948 | +FloatRelation floatx80_compare_quiet(floatx80 a, floatx80 b, | |
7949 | + float_status *status) | |
7948 | 7950 | { |
7949 | 7951 | return floatx80_compare_internal(a, b, 1, status); |
7950 | 7952 | } |
7951 | 7953 | |
7952 | -static inline int float128_compare_internal(float128 a, float128 b, | |
7953 | - int is_quiet, float_status *status) | |
7954 | +static inline FloatRelation | |
7955 | +float128_compare_internal(float128 a, float128 b, bool is_quiet, | |
7956 | + float_status *status) | |
7954 | 7957 | { |
7955 | 7958 | bool aSign, bSign; |
7956 | 7959 |
@@ -7983,12 +7986,13 @@ static inline int float128_compare_internal(float128 a, float128 b, | ||
7983 | 7986 | } |
7984 | 7987 | } |
7985 | 7988 | |
7986 | -int float128_compare(float128 a, float128 b, float_status *status) | |
7989 | +FloatRelation float128_compare(float128 a, float128 b, float_status *status) | |
7987 | 7990 | { |
7988 | 7991 | return float128_compare_internal(a, b, 0, status); |
7989 | 7992 | } |
7990 | 7993 | |
7991 | -int float128_compare_quiet(float128 a, float128 b, float_status *status) | |
7994 | +FloatRelation float128_compare_quiet(float128 a, float128 b, | |
7995 | + float_status *status) | |
7992 | 7996 | { |
7993 | 7997 | return float128_compare_internal(a, b, 1, status); |
7994 | 7998 | } |
@@ -85,12 +85,13 @@ this code that are retained. | ||
85 | 85 | /*---------------------------------------------------------------------------- |
86 | 86 | | Software IEC/IEEE floating-point ordering relations |
87 | 87 | *----------------------------------------------------------------------------*/ |
88 | -enum { | |
88 | + | |
89 | +typedef enum { | |
89 | 90 | float_relation_less = -1, |
90 | 91 | float_relation_equal = 0, |
91 | 92 | float_relation_greater = 1, |
92 | 93 | float_relation_unordered = 2 |
93 | -}; | |
94 | +} FloatRelation; | |
94 | 95 | |
95 | 96 | #include "fpu/softfloat-types.h" |
96 | 97 | #include "fpu/softfloat-helpers.h" |
@@ -231,8 +232,8 @@ float16 float16_maxnum(float16, float16, float_status *status); | ||
231 | 232 | float16 float16_minnummag(float16, float16, float_status *status); |
232 | 233 | float16 float16_maxnummag(float16, float16, float_status *status); |
233 | 234 | float16 float16_sqrt(float16, float_status *status); |
234 | -int float16_compare(float16, float16, float_status *status); | |
235 | -int float16_compare_quiet(float16, float16, float_status *status); | |
235 | +FloatRelation float16_compare(float16, float16, float_status *status); | |
236 | +FloatRelation float16_compare_quiet(float16, float16, float_status *status); | |
236 | 237 | |
237 | 238 | int float16_is_quiet_nan(float16, float_status *status); |
238 | 239 | int float16_is_signaling_nan(float16, float_status *status); |
@@ -350,8 +351,8 @@ int float32_eq_quiet(float32, float32, float_status *status); | ||
350 | 351 | int float32_le_quiet(float32, float32, float_status *status); |
351 | 352 | int float32_lt_quiet(float32, float32, float_status *status); |
352 | 353 | int float32_unordered_quiet(float32, float32, float_status *status); |
353 | -int float32_compare(float32, float32, float_status *status); | |
354 | -int float32_compare_quiet(float32, float32, float_status *status); | |
354 | +FloatRelation float32_compare(float32, float32, float_status *status); | |
355 | +FloatRelation float32_compare_quiet(float32, float32, float_status *status); | |
355 | 356 | float32 float32_min(float32, float32, float_status *status); |
356 | 357 | float32 float32_max(float32, float32, float_status *status); |
357 | 358 | float32 float32_minnum(float32, float32, float_status *status); |
@@ -506,8 +507,8 @@ int float64_eq_quiet(float64, float64, float_status *status); | ||
506 | 507 | int float64_le_quiet(float64, float64, float_status *status); |
507 | 508 | int float64_lt_quiet(float64, float64, float_status *status); |
508 | 509 | int float64_unordered_quiet(float64, float64, float_status *status); |
509 | -int float64_compare(float64, float64, float_status *status); | |
510 | -int float64_compare_quiet(float64, float64, float_status *status); | |
510 | +FloatRelation float64_compare(float64, float64, float_status *status); | |
511 | +FloatRelation float64_compare_quiet(float64, float64, float_status *status); | |
511 | 512 | float64 float64_min(float64, float64, float_status *status); |
512 | 513 | float64 float64_max(float64, float64, float_status *status); |
513 | 514 | float64 float64_minnum(float64, float64, float_status *status); |
@@ -630,8 +631,8 @@ int floatx80_eq_quiet(floatx80, floatx80, float_status *status); | ||
630 | 631 | int floatx80_le_quiet(floatx80, floatx80, float_status *status); |
631 | 632 | int floatx80_lt_quiet(floatx80, floatx80, float_status *status); |
632 | 633 | int floatx80_unordered_quiet(floatx80, floatx80, float_status *status); |
633 | -int floatx80_compare(floatx80, floatx80, float_status *status); | |
634 | -int floatx80_compare_quiet(floatx80, floatx80, float_status *status); | |
634 | +FloatRelation floatx80_compare(floatx80, floatx80, float_status *status); | |
635 | +FloatRelation floatx80_compare_quiet(floatx80, floatx80, float_status *status); | |
635 | 636 | int floatx80_is_quiet_nan(floatx80, float_status *status); |
636 | 637 | int floatx80_is_signaling_nan(floatx80, float_status *status); |
637 | 638 | floatx80 floatx80_silence_nan(floatx80, float_status *status); |
@@ -842,8 +843,8 @@ int float128_eq_quiet(float128, float128, float_status *status); | ||
842 | 843 | int float128_le_quiet(float128, float128, float_status *status); |
843 | 844 | int float128_lt_quiet(float128, float128, float_status *status); |
844 | 845 | int float128_unordered_quiet(float128, float128, float_status *status); |
845 | -int float128_compare(float128, float128, float_status *status); | |
846 | -int float128_compare_quiet(float128, float128, float_status *status); | |
846 | +FloatRelation float128_compare(float128, float128, float_status *status); | |
847 | +FloatRelation float128_compare_quiet(float128, float128, float_status *status); | |
847 | 848 | int float128_is_quiet_nan(float128, float_status *status); |
848 | 849 | int float128_is_signaling_nan(float128, float_status *status); |
849 | 850 | float128 float128_silence_nan(float128, float_status *status); |
@@ -281,7 +281,7 @@ float64 VFP_HELPER(sqrt, d)(float64 a, CPUARMState *env) | ||
281 | 281 | return float64_sqrt(a, &env->vfp.fp_status); |
282 | 282 | } |
283 | 283 | |
284 | -static void softfloat_to_vfp_compare(CPUARMState *env, int cmp) | |
284 | +static void softfloat_to_vfp_compare(CPUARMState *env, FloatRelation cmp) | |
285 | 285 | { |
286 | 286 | uint32_t flags; |
287 | 287 | switch (cmp) { |
@@ -523,7 +523,8 @@ uint64_t HELPER(fcnv_t_d_udw)(CPUHPPAState *env, float64 arg) | ||
523 | 523 | return ret; |
524 | 524 | } |
525 | 525 | |
526 | -static void update_fr0_cmp(CPUHPPAState *env, uint32_t y, uint32_t c, int r) | |
526 | +static void update_fr0_cmp(CPUHPPAState *env, uint32_t y, | |
527 | + uint32_t c, FloatRelation r) | |
527 | 528 | { |
528 | 529 | uint32_t shadow = env->fr0_shadow; |
529 | 530 |
@@ -565,7 +566,7 @@ static void update_fr0_cmp(CPUHPPAState *env, uint32_t y, uint32_t c, int r) | ||
565 | 566 | void HELPER(fcmp_s)(CPUHPPAState *env, float32 a, float32 b, |
566 | 567 | uint32_t y, uint32_t c) |
567 | 568 | { |
568 | - int r; | |
569 | + FloatRelation r; | |
569 | 570 | if (c & 1) { |
570 | 571 | r = float32_compare(a, b, &env->fp_status); |
571 | 572 | } else { |
@@ -578,7 +579,7 @@ void HELPER(fcmp_s)(CPUHPPAState *env, float32 a, float32 b, | ||
578 | 579 | void HELPER(fcmp_d)(CPUHPPAState *env, float64 a, float64 b, |
579 | 580 | uint32_t y, uint32_t c) |
580 | 581 | { |
581 | - int r; | |
582 | + FloatRelation r; | |
582 | 583 | if (c & 1) { |
583 | 584 | r = float64_compare(a, b, &env->fp_status); |
584 | 585 | } else { |
@@ -420,7 +420,7 @@ static const int fcom_ccval[4] = {0x0100, 0x4000, 0x0000, 0x4500}; | ||
420 | 420 | |
421 | 421 | void helper_fcom_ST0_FT0(CPUX86State *env) |
422 | 422 | { |
423 | - int ret; | |
423 | + FloatRelation ret; | |
424 | 424 | |
425 | 425 | ret = floatx80_compare(ST0, FT0, &env->fp_status); |
426 | 426 | env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; |
@@ -428,7 +428,7 @@ void helper_fcom_ST0_FT0(CPUX86State *env) | ||
428 | 428 | |
429 | 429 | void helper_fucom_ST0_FT0(CPUX86State *env) |
430 | 430 | { |
431 | - int ret; | |
431 | + FloatRelation ret; | |
432 | 432 | |
433 | 433 | ret = floatx80_compare_quiet(ST0, FT0, &env->fp_status); |
434 | 434 | env->fpus = (env->fpus & ~0x4500) | fcom_ccval[ret + 1]; |
@@ -439,7 +439,7 @@ static const int fcomi_ccval[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C}; | ||
439 | 439 | void helper_fcomi_ST0_FT0(CPUX86State *env) |
440 | 440 | { |
441 | 441 | int eflags; |
442 | - int ret; | |
442 | + FloatRelation ret; | |
443 | 443 | |
444 | 444 | ret = floatx80_compare(ST0, FT0, &env->fp_status); |
445 | 445 | eflags = cpu_cc_compute_all(env, CC_OP); |
@@ -450,7 +450,7 @@ void helper_fcomi_ST0_FT0(CPUX86State *env) | ||
450 | 450 | void helper_fucomi_ST0_FT0(CPUX86State *env) |
451 | 451 | { |
452 | 452 | int eflags; |
453 | - int ret; | |
453 | + FloatRelation ret; | |
454 | 454 | |
455 | 455 | ret = floatx80_compare_quiet(ST0, FT0, &env->fp_status); |
456 | 456 | eflags = cpu_cc_compute_all(env, CC_OP); |
@@ -1031,7 +1031,7 @@ static const int comis_eflags[4] = {CC_C, CC_Z, 0, CC_Z | CC_P | CC_C}; | ||
1031 | 1031 | |
1032 | 1032 | void helper_ucomiss(CPUX86State *env, Reg *d, Reg *s) |
1033 | 1033 | { |
1034 | - int ret; | |
1034 | + FloatRelation ret; | |
1035 | 1035 | float32 s0, s1; |
1036 | 1036 | |
1037 | 1037 | s0 = d->ZMM_S(0); |
@@ -1042,7 +1042,7 @@ void helper_ucomiss(CPUX86State *env, Reg *d, Reg *s) | ||
1042 | 1042 | |
1043 | 1043 | void helper_comiss(CPUX86State *env, Reg *d, Reg *s) |
1044 | 1044 | { |
1045 | - int ret; | |
1045 | + FloatRelation ret; | |
1046 | 1046 | float32 s0, s1; |
1047 | 1047 | |
1048 | 1048 | s0 = d->ZMM_S(0); |
@@ -1053,7 +1053,7 @@ void helper_comiss(CPUX86State *env, Reg *d, Reg *s) | ||
1053 | 1053 | |
1054 | 1054 | void helper_ucomisd(CPUX86State *env, Reg *d, Reg *s) |
1055 | 1055 | { |
1056 | - int ret; | |
1056 | + FloatRelation ret; | |
1057 | 1057 | float64 d0, d1; |
1058 | 1058 | |
1059 | 1059 | d0 = d->ZMM_D(0); |
@@ -1064,7 +1064,7 @@ void helper_ucomisd(CPUX86State *env, Reg *d, Reg *s) | ||
1064 | 1064 | |
1065 | 1065 | void helper_comisd(CPUX86State *env, Reg *d, Reg *s) |
1066 | 1066 | { |
1067 | - int ret; | |
1067 | + FloatRelation ret; | |
1068 | 1068 | float64 d0, d1; |
1069 | 1069 | |
1070 | 1070 | d0 = d->ZMM_D(0); |
@@ -155,13 +155,13 @@ FLOAT_CMP(un, unordered_quiet) | ||
155 | 155 | target_ulong helper_float_ ## name ## _d(CPUOpenRISCState *env, \ |
156 | 156 | uint64_t fdt0, uint64_t fdt1) \ |
157 | 157 | { \ |
158 | - int r = float64_compare_quiet(fdt0, fdt1, &env->fp_status); \ | |
158 | + FloatRelation r = float64_compare_quiet(fdt0, fdt1, &env->fp_status); \ | |
159 | 159 | return expr; \ |
160 | 160 | } \ |
161 | 161 | target_ulong helper_float_ ## name ## _s(CPUOpenRISCState *env, \ |
162 | 162 | uint32_t fdt0, uint32_t fdt1) \ |
163 | 163 | { \ |
164 | - int r = float32_compare_quiet(fdt0, fdt1, &env->fp_status); \ | |
164 | + FloatRelation r = float32_compare_quiet(fdt0, fdt1, &env->fp_status); \ | |
165 | 165 | return expr; \ |
166 | 166 | } |
167 | 167 |
@@ -770,8 +770,9 @@ VCMPNE(w, u32, uint32_t, 0) | ||
770 | 770 | \ |
771 | 771 | for (i = 0; i < ARRAY_SIZE(r->f32); i++) { \ |
772 | 772 | uint32_t result; \ |
773 | - int rel = float32_compare_quiet(a->f32[i], b->f32[i], \ | |
774 | - &env->vec_status); \ | |
773 | + FloatRelation rel = \ | |
774 | + float32_compare_quiet(a->f32[i], b->f32[i], \ | |
775 | + &env->vec_status); \ | |
775 | 776 | if (rel == float_relation_unordered) { \ |
776 | 777 | result = 0; \ |
777 | 778 | } else if (rel compare order) { \ |
@@ -803,15 +804,15 @@ static inline void vcmpbfp_internal(CPUPPCState *env, ppc_avr_t *r, | ||
803 | 804 | int all_in = 0; |
804 | 805 | |
805 | 806 | for (i = 0; i < ARRAY_SIZE(r->f32); i++) { |
806 | - int le_rel = float32_compare_quiet(a->f32[i], b->f32[i], | |
807 | - &env->vec_status); | |
807 | + FloatRelation le_rel = float32_compare_quiet(a->f32[i], b->f32[i], | |
808 | + &env->vec_status); | |
808 | 809 | if (le_rel == float_relation_unordered) { |
809 | 810 | r->u32[i] = 0xc0000000; |
810 | 811 | all_in = 1; |
811 | 812 | } else { |
812 | 813 | float32 bneg = float32_chs(b->f32[i]); |
813 | - int ge_rel = float32_compare_quiet(a->f32[i], bneg, | |
814 | - &env->vec_status); | |
814 | + FloatRelation ge_rel = float32_compare_quiet(a->f32[i], bneg, | |
815 | + &env->vec_status); | |
815 | 816 | int le = le_rel != float_relation_greater; |
816 | 817 | int ge = ge_rel != float_relation_less; |
817 | 818 |
@@ -112,7 +112,7 @@ static void handle_exceptions(CPUS390XState *env, bool XxC, uintptr_t retaddr) | ||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | -int float_comp_to_cc(CPUS390XState *env, int float_compare) | |
115 | +int float_comp_to_cc(CPUS390XState *env, FloatRelation float_compare) | |
116 | 116 | { |
117 | 117 | switch (float_compare) { |
118 | 118 | case float_relation_equal: |
@@ -368,7 +368,7 @@ uint64_t HELPER(lexb)(CPUS390XState *env, uint64_t ah, uint64_t al, | ||
368 | 368 | /* 32-bit FP compare */ |
369 | 369 | uint32_t HELPER(ceb)(CPUS390XState *env, uint64_t f1, uint64_t f2) |
370 | 370 | { |
371 | - int cmp = float32_compare_quiet(f1, f2, &env->fpu_status); | |
371 | + FloatRelation cmp = float32_compare_quiet(f1, f2, &env->fpu_status); | |
372 | 372 | handle_exceptions(env, false, GETPC()); |
373 | 373 | return float_comp_to_cc(env, cmp); |
374 | 374 | } |
@@ -376,7 +376,7 @@ uint32_t HELPER(ceb)(CPUS390XState *env, uint64_t f1, uint64_t f2) | ||
376 | 376 | /* 64-bit FP compare */ |
377 | 377 | uint32_t HELPER(cdb)(CPUS390XState *env, uint64_t f1, uint64_t f2) |
378 | 378 | { |
379 | - int cmp = float64_compare_quiet(f1, f2, &env->fpu_status); | |
379 | + FloatRelation cmp = float64_compare_quiet(f1, f2, &env->fpu_status); | |
380 | 380 | handle_exceptions(env, false, GETPC()); |
381 | 381 | return float_comp_to_cc(env, cmp); |
382 | 382 | } |
@@ -385,9 +385,9 @@ uint32_t HELPER(cdb)(CPUS390XState *env, uint64_t f1, uint64_t f2) | ||
385 | 385 | uint32_t HELPER(cxb)(CPUS390XState *env, uint64_t ah, uint64_t al, |
386 | 386 | uint64_t bh, uint64_t bl) |
387 | 387 | { |
388 | - int cmp = float128_compare_quiet(make_float128(ah, al), | |
389 | - make_float128(bh, bl), | |
390 | - &env->fpu_status); | |
388 | + FloatRelation cmp = float128_compare_quiet(make_float128(ah, al), | |
389 | + make_float128(bh, bl), | |
390 | + &env->fpu_status); | |
391 | 391 | handle_exceptions(env, false, GETPC()); |
392 | 392 | return float_comp_to_cc(env, cmp); |
393 | 393 | } |
@@ -675,7 +675,7 @@ uint64_t HELPER(fixb)(CPUS390XState *env, uint64_t ah, uint64_t al, | ||
675 | 675 | /* 32-bit FP compare and signal */ |
676 | 676 | uint32_t HELPER(keb)(CPUS390XState *env, uint64_t f1, uint64_t f2) |
677 | 677 | { |
678 | - int cmp = float32_compare(f1, f2, &env->fpu_status); | |
678 | + FloatRelation cmp = float32_compare(f1, f2, &env->fpu_status); | |
679 | 679 | handle_exceptions(env, false, GETPC()); |
680 | 680 | return float_comp_to_cc(env, cmp); |
681 | 681 | } |
@@ -683,7 +683,7 @@ uint32_t HELPER(keb)(CPUS390XState *env, uint64_t f1, uint64_t f2) | ||
683 | 683 | /* 64-bit FP compare and signal */ |
684 | 684 | uint32_t HELPER(kdb)(CPUS390XState *env, uint64_t f1, uint64_t f2) |
685 | 685 | { |
686 | - int cmp = float64_compare(f1, f2, &env->fpu_status); | |
686 | + FloatRelation cmp = float64_compare(f1, f2, &env->fpu_status); | |
687 | 687 | handle_exceptions(env, false, GETPC()); |
688 | 688 | return float_comp_to_cc(env, cmp); |
689 | 689 | } |
@@ -692,9 +692,9 @@ uint32_t HELPER(kdb)(CPUS390XState *env, uint64_t f1, uint64_t f2) | ||
692 | 692 | uint32_t HELPER(kxb)(CPUS390XState *env, uint64_t ah, uint64_t al, |
693 | 693 | uint64_t bh, uint64_t bl) |
694 | 694 | { |
695 | - int cmp = float128_compare(make_float128(ah, al), | |
696 | - make_float128(bh, bl), | |
697 | - &env->fpu_status); | |
695 | + FloatRelation cmp = float128_compare(make_float128(ah, al), | |
696 | + make_float128(bh, bl), | |
697 | + &env->fpu_status); | |
698 | 698 | handle_exceptions(env, false, GETPC()); |
699 | 699 | return float_comp_to_cc(env, cmp); |
700 | 700 | } |
@@ -264,7 +264,7 @@ void helper_fsqrtq(CPUSPARCState *env) | ||
264 | 264 | #define GEN_FCMP(name, size, reg1, reg2, FS, E) \ |
265 | 265 | target_ulong glue(helper_, name) (CPUSPARCState *env) \ |
266 | 266 | { \ |
267 | - int ret; \ | |
267 | + FloatRelation ret; \ | |
268 | 268 | target_ulong fsr; \ |
269 | 269 | if (E) { \ |
270 | 270 | ret = glue(size, _compare)(reg1, reg2, &env->fp_status); \ |
@@ -295,7 +295,7 @@ void helper_fsqrtq(CPUSPARCState *env) | ||
295 | 295 | #define GEN_FCMP_T(name, size, FS, E) \ |
296 | 296 | target_ulong glue(helper_, name)(CPUSPARCState *env, size src1, size src2)\ |
297 | 297 | { \ |
298 | - int ret; \ | |
298 | + FloatRelation ret; \ | |
299 | 299 | target_ulong fsr; \ |
300 | 300 | if (E) { \ |
301 | 301 | ret = glue(size, _compare)(src1, src2, &env->fp_status); \ |
@@ -174,8 +174,7 @@ float64 HELPER(ucf64_absd)(float64 a) | ||
174 | 174 | void HELPER(ucf64_cmps)(float32 a, float32 b, uint32_t c, |
175 | 175 | CPUUniCore32State *env) |
176 | 176 | { |
177 | - int flag; | |
178 | - flag = float32_compare_quiet(a, b, &env->ucf64.fp_status); | |
177 | + FloatRelation flag = float32_compare_quiet(a, b, &env->ucf64.fp_status); | |
179 | 178 | env->CF = 0; |
180 | 179 | switch (c & 0x7) { |
181 | 180 | case 0: /* F */ |
@@ -223,8 +222,7 @@ void HELPER(ucf64_cmps)(float32 a, float32 b, uint32_t c, | ||
223 | 222 | void HELPER(ucf64_cmpd)(float64 a, float64 b, uint32_t c, |
224 | 223 | CPUUniCore32State *env) |
225 | 224 | { |
226 | - int flag; | |
227 | - flag = float64_compare_quiet(a, b, &env->ucf64.fp_status); | |
225 | + FloatRelation flag = float64_compare_quiet(a, b, &env->ucf64.fp_status); | |
228 | 226 | env->CF = 0; |
229 | 227 | switch (c & 0x7) { |
230 | 228 | case 0: /* F */ |
@@ -139,7 +139,7 @@ void HELPER(oeq_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) | ||
139 | 139 | |
140 | 140 | void HELPER(ueq_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) |
141 | 141 | { |
142 | - int v = float32_compare_quiet(a, b, &env->fp_status); | |
142 | + FloatRelation v = float32_compare_quiet(a, b, &env->fp_status); | |
143 | 143 | set_br(env, v == float_relation_equal || v == float_relation_unordered, br); |
144 | 144 | } |
145 | 145 |
@@ -150,7 +150,7 @@ void HELPER(olt_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) | ||
150 | 150 | |
151 | 151 | void HELPER(ult_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) |
152 | 152 | { |
153 | - int v = float32_compare_quiet(a, b, &env->fp_status); | |
153 | + FloatRelation v = float32_compare_quiet(a, b, &env->fp_status); | |
154 | 154 | set_br(env, v == float_relation_less || v == float_relation_unordered, br); |
155 | 155 | } |
156 | 156 |
@@ -161,6 +161,6 @@ void HELPER(ole_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) | ||
161 | 161 | |
162 | 162 | void HELPER(ule_s)(CPUXtensaState *env, uint32_t br, float32 a, float32 b) |
163 | 163 | { |
164 | - int v = float32_compare_quiet(a, b, &env->fp_status); | |
164 | + FloatRelation v = float32_compare_quiet(a, b, &env->fp_status); | |
165 | 165 | set_br(env, v != float_relation_greater, br); |
166 | 166 | } |