if ((op.value & op.mask) == (XO & op.mask)):
print (" match", bin(XO), insn.name)
assert table_entries[upper][lower] is None, \
- "entry %d %d should be empty " \
+ "entry %d %d (XO %s) should be empty " \
"contains %s conflicting %s" % \
- (lower, upper, str(table_entries[upper][lower]),
+ (lower, upper, bin(XO),
+ str(table_entries[upper][lower]),
insn.name)
table_entries[upper][lower] = insn.name
maxnamelen = max(maxnamelen, len(insn.name))
print (table_entries)
# now got the table: print it out
+ # create the markdown header. first line: | |00|01|10|11| |
table = []
line = [" "*6]
for j in range(1<<(half)):
line.append(maxme(maxnamelen, hdr))
line.append(" "*6)
table.append("|" + "|".join(line) + "|")
+ # second line: |--|--|--|--|--|--|
line = ["-"*6] + ["-"*maxnamelen] * (1<<(half)) + ["-"*6]
table.append("|" + "|".join(line) + "|")
+ # now the rows, the row number goes into first and last column
for i in range(1<<(bitlen-half)):
hdr = binmaxed(6, i)
line = [hdr]