From: nasm-bot f. J. K. S. <jin...@in...> - 2013-09-21 12:30:29
|
Commit-ID: fe0ee08586f9cb31e8bc52200818a5bbb9d4c149 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=fe0ee08586f9cb31e8bc52200818a5bbb9d4c149 Author: Jin Kyu Song <jin...@in...> AuthorDate: Fri, 23 Aug 2013 18:40:49 -0700 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Wed, 28 Aug 2013 14:27:25 +0400 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...@in...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- test/gas2nasm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/gas2nasm.py b/test/gas2nasm.py index de16745..a00af92 100755 --- a/test/gas2nasm.py +++ b/test/gas2nasm.py @@ -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) |