static void process_i386_cpu_flag (FILE *table, char *flag, int macro, const char *comma, const char *indent) { char *str, *next, *last; bitfield flags [ARRAY_SIZE (cpu_flags)]; /* Copy the default cpu flags. */ memcpy (flags, cpu_flags, sizeof (cpu_flags)); if (strcasecmp (flag, "unknown") == 0) { unsigned int i; /* We turn on everything except for cpu64 in case of CPU_UNKNOWN_FLAGS. */ for (i = 0; i < ARRAY_SIZE (flags); i++) if (flags[i].position != Cpu64) flags[i].value = 1; } else if (strcmp (flag, "0")) { last = flag + strlen (flag); for (next = flag; next && next < last; ) { str = next_field (next, '|', &next); if (str) set_bitfield (str, flags, ARRAY_SIZE (flags)); } } output_cpu_flags (table, flags, ARRAY_SIZE (flags), macro, comma, indent); }
static void process_i386_cpu_flag (FILE *table, char *flag, int macro, const char *comma, const char *indent, int lineno) { char *str, *next, *last; unsigned int i; bitfield flags [ARRAY_SIZE (cpu_flags)]; /* Copy the default cpu flags. */ memcpy (flags, cpu_flags, sizeof (cpu_flags)); if (strcasecmp (flag, "unknown") == 0) { /* We turn on everything except for cpu64 in case of CPU_UNKNOWN_FLAGS. */ for (i = 0; i < ARRAY_SIZE (flags); i++) if (flags[i].position != Cpu64) flags[i].value = 1; } else if (flag[0] == '~') { last = flag + strlen (flag); if (flag[1] == '(') { last -= 1; next = flag + 2; if (*last != ')') fail (_("%s: %d: Missing `)' in bitfield: %s\n"), filename, lineno, flag); *last = '\0'; } else next = flag + 1; /* First we turn on everything except for cpu64. */ for (i = 0; i < ARRAY_SIZE (flags); i++) if (flags[i].position != Cpu64) flags[i].value = 1; /* Turn off selective bits. */ for (; next && next < last; ) { str = next_field (next, '|', &next, last); if (str) set_bitfield (str, flags, 0, ARRAY_SIZE (flags), lineno); } } else if (strcmp (flag, "0")) { /* Turn on selective bits. */ last = flag + strlen (flag); for (next = flag; next && next < last; ) { str = next_field (next, '|', &next, last); if (str) set_bitfield (str, flags, 1, ARRAY_SIZE (flags), lineno); } } output_cpu_flags (table, flags, ARRAY_SIZE (flags), macro, comma, indent); }