diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-27 13:00:19 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-27 13:00:19 +0300 |
| commit | 6aefc5167a64e05580dcf1afc70efa496ed145ac (patch) | |
| tree | 57032839fd8f5f748b273c679f3766c6911bbca5 /src/main.c | |
| parent | e80d3758a37848cda7990e8eff68ed9df344afa4 (diff) | |
| download | copyjit-6aefc5167a64e05580dcf1afc70efa496ed145ac.tar.gz copyjit-6aefc5167a64e05580dcf1afc70efa496ed145ac.zip | |
add immediate loading
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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); |
