Unified · Split
| @@ -220,8 +220,17 @@ emitf(char *s, Ins *i, E *e) · 219 unmodified lines | ||
| 220 | 220 | c = *s++; |
| 221 | 221 | assert(c == '0' || c == '1'); |
| 222 | 222 | r = i->arg[c - '0']; |
| 223 | − assert(isreg(r) && "TODO emit non reg addresses"); | |
| 224 | − fprintf(e->f, "[%s]", rname(r.val, Kl)); | |
| 223 | + switch (rtype(r)) { | |
| 224 | + default: | |
| 225 | + die("todo (arm emit): unhandled ref"); | |
| 226 | + case RTmp: | |
| 227 | + assert(isreg(r)); | |
| 228 | + fprintf(e->f, "[%s]", rname(r.val, Kl)); | |
| 229 | + break; | |
| 230 | + case RSlot: | |
| 231 | + fprintf(e->f, "[sp, %"PRIu64"]", slot(r.val, e)); | |
| 232 | + break; | |
| 233 | + } | |
| 225 | 234 | break; |
| 226 | 235 | } |
| 227 | 236 | } |