aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-06-27 13:00:19 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-06-27 13:00:19 +0300
commit6aefc5167a64e05580dcf1afc70efa496ed145ac (patch)
tree57032839fd8f5f748b273c679f3766c6911bbca5 /src/main.c
parente80d3758a37848cda7990e8eff68ed9df344afa4 (diff)
downloadcopyjit-6aefc5167a64e05580dcf1afc70efa496ed145ac.tar.gz
copyjit-6aefc5167a64e05580dcf1afc70efa496ed145ac.zip
add immediate loading
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 6 insertions, 6 deletions
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);