summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-08-23 18:40:49 -0700
committerCyrill Gorcunov <gorcunov@gmail.com>2013-08-28 14:27:25 +0400
commitfe0ee08586f9cb31e8bc52200818a5bbb9d4c149 (patch)
treeae86bdc129e1b41d002ab4f3913d0114b06e15b8
parentf9442f67d5ab30bb6ab5b713d87e50797a982e80 (diff)
downloadnasm-fe0ee08586f9cb31e8bc52200818a5bbb9d4c149.tar.gz
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>
-rwxr-xr-xtest/gas2nasm.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/gas2nasm.py b/test/gas2nasm.py
index de167456..a00af923 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)