#include "smap.h"
#include "mcgg.h"
-static char rcsid[] = "$Id$";
+#define REGATTR_INT 0
+#define REGATTR_LONG 1
+#define REGATTR_FLOAT 2
+#define REGATTR_DOUBLE 3
int maxcost = SHRT_MAX / 2;
rule(®, tree(&NOPL, tree(®, NULL, NULL), NULL))->cost = 1;
rule(®, tree(&NOPD, tree(®, NULL, NULL), NULL))->cost = 1;
rule(NULL, tree(&RET, NULL, NULL))->cost = 1;
+
+ }
+
+ {
+ struct regattr* attr = makeregattr("int");
+ assert(attr->number == REGATTR_INT);
+ attr = makeregattr("long");
+ assert(attr->number == REGATTR_LONG);
+ attr = makeregattr("float");
+ assert(attr->number == REGATTR_FLOAT);
+ attr = makeregattr("double");
+ assert(attr->number == REGATTR_DOUBLE);
}
yyin = infp;
assert(rc->number == i);
print("%1\"%s\",\n", rc->name);
- printh("#define %P%s_ATTR (1U<<%d)\n", rc->name, rc->number);
+ if (rc->number > REGATTR_DOUBLE)
+ printh("#define %P%s_ATTR (1U<<%d)\n", rc->name, rc->number);
}
print("};\n\n");
printh("\n");
for (i=0; i<registers.count; i++)
{
struct reg* r = registers.item[i].right;
+ uint32_t type = r->attrs & TYPE_ATTRS;
assert(r->number == i);
+ if (type & (type-1))
+ yyerror("register %s has more than one type attribute set", r->name);
print("%1{ \"%s\", 0x%x, %Pregister_names_%d_%s, %Pregister_aliases_%d_%s },\n",
r->name, r->attrs, i, r->name, i, r->name);