From 6aefc5167a64e05580dcf1afc70efa496ed145ac Mon Sep 17 00:00:00 2001 From: Kimplul Date: Tue, 27 Jun 2023 13:00:19 +0300 Subject: add immediate loading --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index c0e757f..78f9f9e 100644 --- a/src/main.c +++ b/src/main.c @@ -10,20 +10,20 @@ int main() ctx_t ctx; compile_start(&ctx); - compile_uli(&ctx, 0); // total in a - compile_movao(&ctx); + compile_fast_lia(&ctx, 0); // total in a - compile_uli(&ctx, 0); - compile_movyo(&ctx); // iter in y + compile_fast_liy(&ctx, 0); void *top = compile_movxa(&ctx); // iter + total in a compile_add(&ctx); compile_incy(&ctx); // increment iter - compile_uli(&ctx, 1000000000); // limit in o + compile_fast_lio(&ctx, 1000000000); // limit in o compile_subyo(&ctx); - compile_uli(&ctx, (uintptr_t)top); // branch target in o + compile_fast_lio(&ctx, (uintptr_t)top); // branch target in o + /* if we already know the offset, we could generate a ban with immediate + * offsets to save one register? */ compile_ban(&ctx); compile_end(&ctx); -- cgit v1.3