-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update parsing of STORE instruction to conform to Quil spec
According to the Quil spec, STORE's second argument must be a reference to an int, and its third argument can be either a memory reference or an immediate value. Fixes #425
- Loading branch information
1 parent
0b314e5
commit da305dc
Showing
6 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# test parsing invalid LOAD and STORE | ||
|
||
DECLARE ro BIT[4] | ||
DECLARE oct OCTET | ||
DECLARE x REAL[2] | ||
DECLARE int INTEGER[2] | ||
|
||
LOAD x x 1 | ||
LOAD x x[1] oct | ||
LOAD ro ro x | ||
|
||
STORE ro int x | ||
STORE ro 0 ro | ||
STORE x int int | ||
STORE int int x | ||
STORE ro int 1.0 | ||
STORE x int 1 | ||
STORE int int 2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# test parsing good LOAD and STORE | ||
|
||
DECLARE ro BIT[4] | ||
DECLARE oct OCTET | ||
DECLARE x REAL[2] | ||
DECLARE int INTEGER | ||
DECLARE ri INTEGER[2] | ||
|
||
LOAD x x int | ||
LOAD ro ro int | ||
|
||
STORE ro int ro | ||
STORE ro int ro[2] | ||
STORE x int x | ||
STORE ri int int | ||
STORE x int 1.1 | ||
STORE ri int 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters