From 729800593ad08e168328bb397e843a90ccf2363a Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 17 Nov 2020 22:05:45 -0800 Subject: 7266 --- html/mu_instructions.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'html') diff --git a/html/mu_instructions.html b/html/mu_instructions.html index ee8f60c1..073ff552 100644 --- a/html/mu_instructions.html +++ b/html/mu_instructions.html @@ -337,17 +337,17 @@ var/reg: (addr T) <- address var2: T # Array operations -var/reg <- index arr/rega: (addr array T), idx/regi: int +var/reg: (addr T) <- index arr/rega: (addr array T), idx/regi: int | if size-of(T) is 1, 2, 4 or 8 => "(__check-mu-array-bounds *" rega " %" regi " " size-of(T) ")" "8d/copy-address *(" rega "+" regi "<<" log2(size-of(T)) "+4) " reg "/r32" -var/reg <- index arr: (array T len), idx/regi: int +var/reg: (addr T) <- index arr: (array T len), idx/regi: int => "(__check-mu-array-bounds *(ebp+" arr.stack-offset ") %" regi " " size-of(T) ")" "8d/copy-address *(ebp+" regi "<<" log2(size-of(T)) "+" (arr.stack-offset + 4) ") " reg "/r32" -var/reg <- index arr/rega: (addr array T), n +var/reg: (addr T) <- index arr/rega: (addr array T), n => "(__check-mu-array-bounds *" rega " " n " " size-of(T) ")" "8d/copy-address *(" rega "+" (n*size-of(T)+4) ") " reg "/r32" -var/reg <- index arr: (array T len), n +var/reg: (addr T) <- index arr: (array T len), n => "(__check-mu-array-bounds *(ebp+" arr.stack-offset ") " n " " size-of(T) ")" "8d/copy-address *(ebp+" (arr.stack-offset+4+n*size-of(T)) ") " reg "/r32" @@ -355,13 +355,13 @@ var/reg: (offset T) <- compute-offset arr: ( => "69/multiply %" regi " " size-of(T) "/imm32 " reg "/r32" var/reg: (offset T) <- compute-offset arr: (addr array T), idx: int # arr can be in reg or mem => "69/multiply *(ebp+" idx.stack-offset ") " size-of(T) "/imm32 " reg "/r32" -var/reg <- index arr/rega: (addr array T), o/rego: (offset T) +var/reg: (addr T) <- index arr/rega: (addr array T), o/rego: (offset T) => "(__check-mu-array-bounds %" rega " %" rego " 1 \"" function-name "\")" "8d/copy-address *(" rega "+" rego "+4) " reg "/r32" Computing the length of an array is complex. -var/reg <- length arr/reg2: (addr array T) +var/reg: int <- length arr/reg2: (addr array T) | if T is byte (TODO) => "8b/-> *" reg2 " " reg "/r32" | if size-of(T) is 4 or 8 or 16 or 32 or 64 or 128 -- cgit 1.4.1-2-gfad0