return sv_extra, field
+def to_number(field):
+ if field.startswith("0x"):
+ return eval(field)
+ if field.startswith("0b"):
+ return eval(field)
+ return int(field)
+
+
# decodes svp64 assembly listings and creates EXT001 svp64 prefixes
class SVP64Asm:
def __init__(self, lst, bigendian=False, macros=None):
# identify if it is a special instruction
custom_insn_hook = CUSTOM_INSNS.get(opcode)
if custom_insn_hook is not None:
- fields = tuple(map(int, fields))
+ fields = tuple(map(to_number, fields))
insn = custom_insn_hook(fields)
log(opcode, bin(insn))
yield ".long 0x%x" % insn
]
lst = [
'sv.svstep./m=r3 2.v, 4, 0',
+ 'ternlogi 0,0,0,0x5'
]
isa = SVP64Asm(lst, macros=macros)
log("list", list(isa))