about summary refs log tree commit diff stats
path: root/mu_summary
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-03-14 14:46:45 -0700
committerKartik Agaram <vc@akkartik.com>2020-03-14 14:46:45 -0700
commit114641e2c81805bd99a5713237af3fb16d7ddc10 (patch)
tree0b709296b72184a430e149f44c665bd58bbe79c4 /mu_summary
parent6db056110bc9bab90092b29908085a9befd5956e (diff)
downloadmu-114641e2c81805bd99a5713237af3fb16d7ddc10.tar.gz
6145 - 'address' operator
This could be a can of worms, but I think I have a set of checks that will
keep use of addresses type-safe.
Diffstat (limited to 'mu_summary')
-rw-r--r--mu_summary8
1 files changed, 6 insertions, 2 deletions
diff --git a/mu_summary b/mu_summary
index 7ecea2b1..d098d28f 100644
--- a/mu_summary
+++ b/mu_summary
@@ -195,6 +195,10 @@ Similarly, conditional loops:
   loop-if-addr>=
   loop-if-addr>= label
 
+## Address operations
+
+  var/reg: (addr T) <- address var: T         # var must be in mem (on the stack)
+
 ## Array operations
 
   var/reg: int <- length arr/reg: (addr array T)
@@ -203,8 +207,8 @@ Similarly, conditional loops:
   var/reg: (addr T) <- index arr/reg: (addr array T), n
   var/reg: (addr T) <- index arr: (array T sz), n
 
-  var/reg: (offset T) <- compute-offset arr: (addr array T), idx/reg: int  # arr can be in reg or mem
-  var/reg: (offset T) <- compute-offset arr: (addr array T), idx: int  # arr can be in reg or mem
+  var/reg: (offset T) <- compute-offset arr: (addr array T), idx/reg: int     # arr can be in reg or mem
+  var/reg: (offset T) <- compute-offset arr: (addr array T), idx: int         # arr can be in reg or mem
   var/reg: (addr T) <- index arr/reg: (addr array T), idx/reg: (offset T)
 
 ## User-defined types