X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firmode.c;h=35924f6d63a5773e72d7d5a1800c5bf389ac1844;hb=2ece936daec565575739be72f568a241207a5083;hp=da2171c444ab818c8ad88ab51a1ab5b32fa15c26;hpb=64d71aea0b14b42c3016ef251cc4b6f48003b2f7;p=libfirm diff --git a/ir/ir/irmode.c b/ir/ir/irmode.c index da2171c44..35924f6d6 100644 --- a/ir/ir/irmode.c +++ b/ir/ir/irmode.c @@ -49,6 +49,22 @@ static int num_modes = 0; /** The list of all currently existing modes. */ static ir_mode **mode_list; +const char *get_mode_arithmetic_name(ir_mode_arithmetic ari) +{ +#define X(a) case a: return #a + switch (ari) { + X(irma_uninitialized); + X(irma_none); + X(irma_twos_complement); + X(irma_ones_complement); + X(irma_int_BCD); + X(irma_ieee754); + X(irma_float_BCD); + default: return ""; + } +#undef X +} + /** * Compare modes that don't need to have their code field * correctly set @@ -467,7 +483,7 @@ tarval *get_mode_NAN(ir_mode *mode) { return get_tarval_nan(mode); } -int is_mode(void *thing) { +int is_mode(const void *thing) { if (get_kind(thing) == k_ir_mode) return 1; else @@ -745,7 +761,9 @@ void init_mode(void) { newmode.name = new_id_from_chars("E", 1); newmode.code = irm_E; newmode.sign = 1; - newmode.size = 80; + /* note that the tarval module is calculating with 80 bits, but we use + * 96 bits, as that is what will be stored to memory by most hardware */ + newmode.size = 96; mode_E = register_mode(&newmode);