diff options
author | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2011-04-24 21:22:40 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@s141.Millennium.Berkeley.EDU> | 2011-04-24 21:22:40 -0700 |
commit | cd0bb4d0a40c04f09c9d87f03e40b5575312c9a8 (patch) | |
tree | d396d9d4337c5c1eff4079222b1f7d2f6b8741d9 | |
parent | 61915e42bffd5f4a14c9c6508398a211824393fc (diff) | |
download | riscv-opcodes-cd0bb4d0a40c04f09c9d87f03e40b5575312c9a8.zip riscv-opcodes-cd0bb4d0a40c04f09c9d87f03e40b5575312c9a8.tar.gz riscv-opcodes-cd0bb4d0a40c04f09c9d87f03e40b5575312c9a8.tar.bz2 |
[xcc,sim,opcodes] added c.addiw
-rw-r--r-- | inst.v | 1 | ||||
-rw-r--r-- | opcodes | 2 | ||||
-rwxr-xr-x | parse-opcodes | 27 |
3 files changed, 4 insertions, 26 deletions
@@ -261,3 +261,4 @@ `define C_SUB3 32'b00000000000000000000000000000000 `define C_OR3 32'b00000000000000000000000000000000 `define C_AND3 32'b00000000000000000000000000000000 +`define C_ADDIW 32'b00000000000000000000000000000000 @@ -354,3 +354,5 @@ c.add3 crds crs1s crs2bs 9..8=0 4..0=28 c.sub3 crds crs1s crs2bs 9..8=1 4..0=28 c.or3 crds crs1s crs2bs 9..8=2 4..0=28 c.and3 crds crs1s crs2bs 9..8=3 4..0=28 + +c.addiw cimm6 crd 4..0=29 diff --git a/parse-opcodes b/parse-opcodes index bd120fd..c1d1845 100755 --- a/parse-opcodes +++ b/parse-opcodes @@ -112,42 +112,17 @@ def make_switch(match,mask): break if not done: - print ' switch((insn.bits >> 0x%x) & 0x%x)' % (funct_base,(1<<funct_size)-1) - print ' {' - for funct in range(0,1<<funct_size): - has_some_instruction = 0 - for name in match.iterkeys(): - if ((opc << opcode_base | funct << funct_base) & mask[name]) == (match[name] & (opcode_mask | funct_mask)): - has_some_instruction = 1 - if not has_some_instruction: continue - print ' case 0x%x:' % funct - print ' {' - done = 0 - for name in match.iterkeys(): - name2 = name.replace('.','_') - # case 1: opcode + funct code completely describe insn - if ((opc << opcode_base | funct << funct_base) & mask[name]) == match[name] and ((opcode_mask | funct_mask) & mask[name]) == mask[name]: - print ' #include "insns/%s.h"' % name2 - print ' break;' - done = 1 - break if not done: for name in match.iterkeys(): name2 = name.replace('.','_') # case 2: general case: opcode + funct incompletely describe insn - if ((opc << opcode_base | funct << funct_base) & mask[name]) == (match[name] & (opcode_mask | funct_mask)): + if ((opc << opcode_base) & mask[name]) == (match[name] & opcode_mask): print ' if((insn.bits & 0x%x) == 0x%x)' % (mask[name],match[name]) print ' {' print ' #include "insns/%s.h"' % name2 print ' break;' print ' }' print ' throw trap_illegal_instruction;' - print ' }' - print ' default:' - print ' {' - print ' throw trap_illegal_instruction;' - print ' }' - print ' }' print ' break;' print ' }' print ' default:' |