summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2016-07-22 16:21:22 -0400
committerGravatar Benjamin Barenblat <bbaren@google.com>2016-07-22 16:21:22 -0400
commit42742e7c60ba40f00147c18dd7aeacd7a198bc82 (patch)
treea0e4b714cc06ce0192dcad3db3f837c87f363bcf
parentb42b8e75d42be692f464f4971610969d97e8da72 (diff)
Go: Return rs2 value for each instructionsHEADmaster
Some binary floating-point instructions (ab)use the rs2 value to hold additional instruction data, so we need that data in the Go assembler.
-rwxr-xr-xparse-opcodes4
1 files changed, 3 insertions, 1 deletions
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 '}'