summaryrefslogtreecommitdiff
path: root/risc-v/hgen/parser.hgen
diff options
context:
space:
mode:
Diffstat (limited to 'risc-v/hgen/parser.hgen')
-rw-r--r--risc-v/hgen/parser.hgen7
1 files changed, 5 insertions, 2 deletions
diff --git a/risc-v/hgen/parser.hgen b/risc-v/hgen/parser.hgen
index dc61e566..82bb1d5b 100644
--- a/risc-v/hgen/parser.hgen
+++ b/risc-v/hgen/parser.hgen
@@ -13,9 +13,9 @@
| RTYPE reg COMMA reg COMMA reg
{ `RISCVRType ($6, $4, $2, $1.op) }
| LOAD reg COMMA NUM LPAR reg RPAR
- { `RISCVLoad($4, $6, $2, $1.unsigned, $1.width, $1.aq) }
+ { `RISCVLoad($4, $6, $2, $1.unsigned, $1.width, $1.aq, $1.rl) }
| STORE reg COMMA NUM LPAR reg RPAR
- { `RISCVStore($4, $2, $6, $1.width, $1.rl) }
+ { `RISCVStore($4, $2, $6, $1.width, $1.aq, $1.rl) }
| ADDIW reg COMMA reg COMMA NUM
{ `RISCVADDIW ($6, $4, $2) }
| SHIFTW reg COMMA reg COMMA NUM
@@ -48,3 +48,6 @@
`RISCVStoreCon($1.aq, $1.rl, $4, $8, $1.width, $2) }
| AMO reg COMMA reg COMMA LPAR reg RPAR
{ `RISCVAMO($1.op, $1.aq, $1.rl, $4, $7, $1.width, $2) }
+| AMO reg COMMA reg COMMA NUM LPAR reg RPAR
+ { if $6 <> 0 then failwith "'amo<op>' offset must be 0" else
+ `RISCVAMO($1.op, $1.aq, $1.rl, $4, $8, $1.width, $2) }