X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftv%2Ftv.c;h=933c55f4f0ef2447f3765d6efeb41e58dd16b063;hb=51894b3a1df63952817e3f673e8760e64de971d7;hp=9c821badb0927e1bedae6aec6e5402aa7b3d0657;hpb=31fc92ec27c0274f5f24c515094afd40a04ab1a9;p=libfirm diff --git a/ir/tv/tv.c b/ir/tv/tv.c index 9c821badb..933c55f4f 100644 --- a/ir/tv/tv.c +++ b/ir/tv/tv.c @@ -36,10 +36,8 @@ #include #include #include -#ifdef HAVE_STRINGS_H -#include -#endif #include +#include #include "bitfiddle.h" #include "tv_t.h" @@ -858,7 +856,7 @@ int tarval_is_minus_one(ir_tarval *a) /* * comparison */ -pn_Cmp tarval_cmp(ir_tarval *a, ir_tarval *b) +ir_relation tarval_cmp(ir_tarval *a, ir_tarval *b) { carry_flag = -1; @@ -867,10 +865,10 @@ pn_Cmp tarval_cmp(ir_tarval *a, ir_tarval *b) } if (a == tarval_undefined || b == tarval_undefined) - return pn_Cmp_False; + return ir_relation_false; if (a->mode != b->mode) - return pn_Cmp_False; + return ir_relation_false; if (get_mode_n_vector_elems(a->mode) > 1) { /* vector arithmetic not implemented yet */ @@ -883,36 +881,33 @@ pn_Cmp tarval_cmp(ir_tarval *a, ir_tarval *b) case irms_memory: case irms_auxiliary: if (a == b) - return pn_Cmp_Eq; - return pn_Cmp_False; + return ir_relation_equal; + return ir_relation_false; case irms_float_number: - /* it should be safe to enable this even if other arithmetic is disabled */ - /*if (no_float) - return pn_Cmp_False;*/ /* * BEWARE: we cannot compare a == b here, because * a NaN is always Unordered to any other value, even to itself! */ switch (fc_comp((const fp_value*) a->value, (const fp_value*) b->value)) { - case -1: return pn_Cmp_Lt; - case 0: return pn_Cmp_Eq; - case 1: return pn_Cmp_Gt; - case 2: return pn_Cmp_Uo; - default: return pn_Cmp_False; + case -1: return ir_relation_less; + case 0: return ir_relation_equal; + case 1: return ir_relation_greater; + case 2: return ir_relation_unordered; + default: return ir_relation_false; } case irms_reference: case irms_int_number: if (a == b) - return pn_Cmp_Eq; - return sc_comp(a->value, b->value) == 1 ? pn_Cmp_Gt : pn_Cmp_Lt; + return ir_relation_equal; + return sc_comp(a->value, b->value) == 1 ? ir_relation_greater : ir_relation_less; case irms_internal_boolean: if (a == b) - return pn_Cmp_Eq; - return a == tarval_b_true ? pn_Cmp_Gt : pn_Cmp_Lt; + return ir_relation_equal; + return a == tarval_b_true ? ir_relation_greater : ir_relation_less; } - return pn_Cmp_False; + return ir_relation_false; } /*