#include "read-md.h"
#include "gensupport.h"
#include "vecprim.h"
+#include "fnmatch.h"
/* Flags for make_internal_attr's `special' parameter. */
#define ATTR_NONE 0
XEXP (rt_val, 1) = arg1;
}
}
- else if (GET_RTX_LENGTH (code) == 1
- && GET_RTX_FORMAT (code)[0] == 's')
+ else if (code == SYMBOL_REF
+ || (GET_RTX_LENGTH (code) == 1
+ && GET_RTX_FORMAT (code)[0] == 's'))
{
char *arg0 = va_arg (p, char *);
rtl_obstack = hash_obstack;
rt_val = rtx_alloc (code);
XSTR (rt_val, 0) = arg0;
+ if (code == SYMBOL_REF)
+ {
+ X0EXP (rt_val, 1) = NULL_RTX;
+ X0EXP (rt_val, 2) = NULL_RTX;
+ }
}
}
else if (GET_RTX_LENGTH (code) == 2
memcpy (new_str, str, len);
new_str[len] = '\0';
attr_hash_add_string (hashcode, new_str);
+ copy_md_ptr_loc (new_str, str);
return new_str; /* Return the new string. */
}
case CONST_DOUBLE:
case CONST_VECTOR:
case SYMBOL_REF:
+ case MATCH_TEST:
case CODE_LABEL:
case PC:
case CC0:
XEXP (exp, 0) = check_attr_test (XEXP (exp, 0), is_const, lineno);
break;
+ case MATCH_TEST:
+ exp = attr_rtx (MATCH_TEST, XSTR (exp, 0));
+ ATTR_IND_SIMPLIFIED_P (exp) = 1;
+ break;
+
case MATCH_OPERAND:
if (is_const)
fatal ("RTL operator \"%s\" not valid in constant attribute test",
rtx newexp;
int i;
+ while (GET_CODE (value) == ATTR)
+ {
+ struct attr_value *av = NULL;
+
+ attr = find_attr (&XSTR (value, 0), 0);
+
+ if (insn_code_values)
+ {
+ struct attr_value_list *iv;
+ for (iv = insn_code_values[insn_code]; iv; iv = iv->next)
+ if (iv->attr == attr)
+ {
+ av = iv->av;
+ break;
+ }
+ }
+ else
+ {
+ struct insn_ent *ie;
+ for (av = attr->first_value; av; av = av->next)
+ for (ie = av->first_insn; ie; ie = ie->next)
+ if (ie->def->insn_code == insn_code)
+ goto got_av;
+ }
+ if (av)
+ {
+ got_av:
+ value = av->value;
+ }
+ }
+
switch (GET_CODE (value))
{
case CONST_STRING:
case CONST_INT:
case CONST_DOUBLE:
case CONST_VECTOR:
+ case MATCH_TEST:
case SYMBOL_REF:
case CODE_LABEL:
case PC:
printf (HOST_WIDE_INT_PRINT_DEC, XWINT (exp, 0));
break;
+ case MATCH_TEST:
+ print_c_condition (XSTR (exp, 0));
+ if (flags & FLG_BITWISE)
+ printf (" != 0");
+ break;
+
/* A random C expression. */
case SYMBOL_REF:
print_c_condition (XSTR (exp, 0));
must_extract = 1;
return;
+ case MATCH_TEST:
case EQ_ATTR_ALT:
must_extract = must_constrain = 1;
break;
case ATTR:
{
struct attr_desc *attr2 = find_attr (&XSTR (value, 0), 0);
+ if (attr->enum_name)
+ printf ("(enum %s)", attr->enum_name);
+ else if (!attr->is_numeric)
+ printf ("(enum attr_%s)", attr->name);
+ else if (!attr2->is_numeric)
+ printf ("(int)");
+
printf ("get_attr_%s (%s)", attr2->name,
(attr2->is_const ? "" : "insn"));
}
struct bypass_list
{
struct bypass_list *next;
- const char *insn;
+ const char *pattern;
};
static struct bypass_list *all_bypasses;
s = attr_string (s, len);
for (b = all_bypasses; b; b = b->next)
- if (s == b->insn)
+ if (s == b->pattern)
return; /* already got that one */
b = oballoc (struct bypass_list);
- b->insn = s;
+ b->pattern = s;
b->next = all_bypasses;
all_bypasses = b;
n_bypasses++;
list. */
for (r = all_insn_reservs; r; r = r->next)
for (b = all_bypasses; b; b = b->next)
- if (r->name == b->insn)
+ if (fnmatch (b->pattern, r->name, 0) == 0)
r->bypassed = true;
}
printf ("#include \"recog.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"output.h\"\n");
- printf ("#include \"toplev.h\"\n");
+ printf ("#include \"diagnostic-core.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"function.h\"\n");
printf ("\n");