mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
AVX-512: Add a feature to generate a raw bytecode file
From gas testsuite file, a text file containing raw bytecodes is useful when verifying the output of NASM. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
f9442f67d5
commit
fe0ee08586
@ -21,6 +21,9 @@ def setup():
|
||||
parser.add_option('-b', dest='bits', action='store',
|
||||
default="",
|
||||
help='Bits for output ASM file.')
|
||||
parser.add_option('-r', dest='raw_output', action='store',
|
||||
default="",
|
||||
help='Name for raw output bytes in text')
|
||||
(options, args) = parser.parse_args()
|
||||
return options
|
||||
|
||||
@ -77,11 +80,19 @@ def write(data, options):
|
||||
outstr = outstrfmt % tuple(insn)
|
||||
out.write(outstr)
|
||||
|
||||
def write_rawbytes(data, options):
|
||||
if options.raw_output:
|
||||
with open(options.raw_output, 'wb') as out:
|
||||
for insn in data:
|
||||
out.write(insn[0] + '\n')
|
||||
|
||||
if __name__ == "__main__":
|
||||
options = setup()
|
||||
recs = read(options)
|
||||
print "AVX3.1 instructions"
|
||||
|
||||
write_rawbytes(recs, options)
|
||||
|
||||
recs = commas(recs)
|
||||
|
||||
write(recs, options)
|
||||
|
Loading…
Reference in New Issue
Block a user