python3 opid-check.py
-opid-opc.c: opid-opc-gen.c
-opid-dis.c: opid-dis-gen.c
-
-
opid-check: opid-check.o libopid.a
$(CC) $(CPPFLAGS) $(CFLAGS) -fPIC $< -o $@ -L. -l:libopid.a
$(AR) rcs $@ $^
+opid-dis.c: opid-dis-gen.c
+opid-opc.c: opid-opc-gen.c
+
+
$(GENS): codegen.py
SILENCELOG=true $(PYTHON) codegen.py $@ > $@
class StaticOperands(tuple): pass
class DynamicOperands(tuple): pass
class POTable(tuple): pass
-class Records(tuple): pass
+class RecordTable(tuple): pass
class DynamicOperandId(Struct):
static_operands=static_operands)
yield DynamicOperands(map(dynamic_operand, self.__dynamic_operand.items()))
- yield Records(map(record, sorted(self.__records.items())))
+ yield RecordTable(map(record, sorted(self.__records.items())))
yield POTable(self.__PO)
@mdis.dispatcher.Hook(insndb.Record)
class DisGenSource(Source):
class Walker(Walker):
- @mdis.dispatcher.Hook(DynamicOperand, Records)
+ @mdis.dispatcher.Hook(DynamicOperand, RecordTable)
def dispatch_ignore(self, node):
yield from ()
heads[index] = (counter - node[index])
tails[index] = counter
heads = [(tail - node[index]) for (index, tail) in enumerate(tails)]
- self.emit("static uint16_t const opid_opcode_hash[64][2] = {")
+ self.emit("static uint16_t const opid_opcode_table[64][2] = {")
with self:
for index in range(64):
head = heads[index]
self.emit("};")
yield node
- @mdis.dispatcher.Hook(Records)
+ @mdis.dispatcher.Hook(RecordTable)
@contextlib.contextmanager
def dispatch_records(self, node):
- self.emit("static struct opid_record const opid_records[] = {")
+ self.emit("static struct opid_record const opid_record_table[] = {")
with self: yield node
self.emit("};")
self.emit("")
#include "opid.h"
-static struct opid_record const opid_records[];
-static uint16_t const opid_opcode_hash[64][2];
+static struct opid_record const opid_record_table[];
+static uint16_t const opid_opcode_table[64][2];
#include "opid-opc-gen.c"
/* 5 */ (((insn >> UINT32_C(26)) & UINT32_C(1)) << UINT32_C(0)) |
UINT32_C(0)
);
- struct opid_record const *iter = &opid_records[opid_opcode_hash[PO][0]];
- struct opid_record const *tail = &opid_records[opid_opcode_hash[PO][1]];
+ struct opid_record const *iter = &opid_record_table[opid_opcode_table[PO][0]];
+ struct opid_record const *tail = &opid_record_table[opid_opcode_table[PO][1]];
for (; iter != tail; ++iter) {
struct opid_opcode const *opcode = &iter->opcode;