X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbearch.c;h=f262c350c2d904ad5b77d2f5ce36e798a6bec2ad;hb=89dc24503c04139bb05504059b291d6d89f99661;hp=01087c4966807442b1d41bda03a4a301beabf061;hpb=9fcd5f662056f33a38dbd39f59dc5125718e04ed;p=libfirm diff --git a/ir/be/bearch.c b/ir/be/bearch.c index 01087c496..f262c350c 100644 --- a/ir/be/bearch.c +++ b/ir/be/bearch.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -208,7 +208,7 @@ int arch_get_allocatable_regs(const arch_env_t *env, const ir_node *irn, int pos void arch_put_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls, bitset_t *bs) { - int i; + unsigned i; (void) env; for(i = 0; i < cls->n_regs; ++i) { @@ -220,7 +220,7 @@ void arch_put_non_ignore_regs(const arch_env_t *env, int arch_count_non_ignore_regs(const arch_env_t *env, const arch_register_class_t *cls) { - int i; + unsigned i; int result = 0; (void) env; @@ -333,20 +333,29 @@ extern char *arch_register_req_format(char *buf, size_t len, } if(arch_register_req_is(req, should_be_same)) { - const ir_node *same = get_irn_n(skip_Proj_const(node), req->other_same[0]); - ir_snprintf(tmp, sizeof(tmp), " same to: %+F", same); - strncat(buf, tmp, len); - if (req->other_same[1] != -1) { - const ir_node *same2 = get_irn_n(skip_Proj_const(node), req->other_same[1]); - ir_snprintf(tmp, sizeof(tmp), "or %+F", same2); - strncat(buf, tmp, len); + const unsigned other = req->other_same; + int i; + + ir_snprintf(tmp, sizeof(tmp), " same to:"); + for (i = 0; 1U << i <= other; ++i) { + if (other & (1U << i)) { + ir_snprintf(tmp, sizeof(tmp), " %+F", get_irn_n(skip_Proj_const(node), i)); + strncat(buf, tmp, len); + } } } if(arch_register_req_is(req, should_be_different)) { - const ir_node *different = get_irn_n(skip_Proj_const(node), req->other_different); - ir_snprintf(tmp, sizeof(tmp), " different to: %+F", different); - strncat(buf, tmp, len); + const unsigned other = req->other_different; + int i; + + ir_snprintf(tmp, sizeof(tmp), " different from:"); + for (i = 0; 1U << i <= other; ++i) { + if (other & (1U << i)) { + ir_snprintf(tmp, sizeof(tmp), " %+F", get_irn_n(skip_Proj_const(node), i)); + strncat(buf, tmp, len); + } + } } return buf; @@ -356,7 +365,7 @@ static const arch_register_req_t no_requirement = { arch_register_req_type_none, NULL, NULL, - -1, - -1 + 0, + 0 }; const arch_register_req_t *arch_no_register_req = &no_requirement;