From 27b1e19ebec31eca1d29c4b8f18408b02c172578 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 24 May 2020 19:46:47 -0700 Subject: 6392 - 'length' instruction done in all complexity --- mu_instructions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mu_instructions') diff --git a/mu_instructions b/mu_instructions index 754f51bb..865572eb 100644 --- a/mu_instructions +++ b/mu_instructions @@ -191,7 +191,7 @@ var/reg <- length arr/reg2: (addr array T) | if size-of(T) is 4 or 8 or 16 or 32 or 64 or 128 => "8b/-> *" reg2 " " reg "/r32" "c1/shift 5/subop/logic-right %" reg " " log2(size-of(T)) "/imm8" - | otherwise (TODO) + | otherwise x86 has no instruction to divide by a literal, so we need up to 3 extra registers! eax/edx for division and say ecx => if reg is not eax -- cgit 1.4.1-2-gfad0