From 42742e7c60ba40f00147c18dd7aeacd7a198bc82 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Fri, 22 Jul 2016 16:21:22 -0400 Subject: Go: Return rs2 value for each instructions Some binary floating-point instructions (ab)use the rs2 value to hold additional instruction data, so we need that data in the Go assembler. --- parse-opcodes | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parse-opcodes b/parse-opcodes index 0e37952..e575c1e 100755 --- a/parse-opcodes +++ b/parse-opcodes @@ -778,9 +778,10 @@ def print_go_insn(name): m = match[name] opcode = yank(m, 0, 7) funct3 = yank(m, 12, 3) + rs2 = yank(m, 20, 5) csr = yank(m, 20, 12) funct7 = yank(m, 25, 7) - print '\t\treturn &inst{0x%x, 0x%x, %d, 0x%x}, true' % (opcode, funct3, signed(csr, 12), funct7) + print '\t\treturn &inst{0x%x, 0x%x, 0x%x, %d, 0x%x}, true' % (opcode, funct3, rs2, signed(csr, 12), funct7) def make_go(): print '// Automatically generated by parse-opcodes' @@ -792,6 +793,7 @@ def make_go(): print 'type inst struct {' print '\topcode uint32' print '\tfunct3 uint32' + print '\trs2 uint32' print '\tcsr int64' print '\tfunct7 uint32' print '}' -- cgit v1.2.3