X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firmode.c;h=08bca22eb7121fc23a2e212a0b2909446f85f547;hb=f250d98f949371038744bd320096fa98f4b218fe;hp=a21ca88b5e9d77e6f28a5471acac524bb54906ed;hpb=d4d15a26cfb838f1952ecd16352d3c6bd28d23f2;p=libfirm diff --git a/ir/ir/irmode.c b/ir/ir/irmode.c index a21ca88b5..08bca22eb 100644 --- a/ir/ir/irmode.c +++ b/ir/ir/irmode.c @@ -25,23 +25,20 @@ */ #include "config.h" -#ifdef HAVE_STDLIB_H -# include -#endif -#ifdef HAVE_STRING_H -# include -#endif +#include +#include -# include +#include -# include "irprog_t.h" -# include "irmode_t.h" -# include "ident.h" -# include "tv_t.h" -# include "obst.h" -# include "irhooks.h" -# include "irtools.h" -# include "array.h" +#include "irprog_t.h" +#include "irmode_t.h" +#include "ident.h" +#include "tv_t.h" +#include "obst.h" +#include "irhooks.h" +#include "irtools.h" +#include "array.h" +#include "error.h" /** Obstack to hold all modes. */ static struct obstack modes; @@ -52,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 @@ -748,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);