const unsigned int bps = sizeof (a.array[0]) * CHAR_BIT;
i386_cpu_flags f = { .array[0] = 0 };
- switch (ARRAY_SIZE(a.array))
+ switch (ARRAY_SIZE (a.array))
{
case 1:
f.array[CpuAttrEnums / bps]
- |= (a.array[0] >> CpuIsaBits) << (CpuAttrEnums % bps);
- if (CpuAttrEnums % bps > CpuIsaBits)
+#ifndef WORDS_BIGENDIAN
+ |= (a.array[0] >> CpuIsaBits) << (CpuAttrEnums % bps);
+#else
+ |= (a.array[0] << CpuIsaBits) >> (CpuAttrEnums % bps);
+#endif
+ if (CpuMax / bps > CpuAttrEnums / bps)
f.array[CpuAttrEnums / bps + 1]
+#ifndef WORDS_BIGENDIAN
= (a.array[0] >> CpuIsaBits) >> (bps - CpuAttrEnums % bps);
+#else
+ = (a.array[0] << CpuIsaBits) << (bps - CpuAttrEnums % bps);
+#endif
break;
+
default:
abort ();
}
if (a.bitfield.isa)
+#ifndef WORDS_BIGENDIAN
f.array[(a.bitfield.isa - 1) / bps] |= 1u << ((a.bitfield.isa - 1) % bps);
+#else
+ f.array[(a.bitfield.isa - 1) / bps] |= 1u << (~(a.bitfield.isa - 1) % bps);
+#endif
return f;
}
active_cpu_flags.array[i / 32] |= 1U << (i % 32);
}
- fprintf (table, "%d } }%s\n", flags[i].value, comma);
+#if defined(CpuAttrUnused) != defined(CpuUnused)
+ if (mode <= 0)
+# ifdef CpuUnused
+ fprintf (table, " } }%s\n", comma);
+# else
+ fprintf (table, "%d, 0 } }%s\n", flags[i].value, comma);
+# endif
+ else
+#endif
+ fprintf (table, "%d } }%s\n", flags[i].value, comma);
}
static void