From bf993be4a04bc7279f7d49ae18f185e1dca36479 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 4 Aug 2023 21:28:39 +0300 Subject: move main.c to examples --- src/main.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/main.c (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c deleted file mode 100644 index de287f6..0000000 --- a/src/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* SPDX-License-Identifier: copyleft-next-0.3.1 */ - -#include -#include -#include - -#include "copyjit.h" - -int main() -{ - ctx_t ctx; - compile_start(&ctx); - - compile_fast_lix(&ctx, 0); // total in x - - compile_fast_liy(&ctx, 0); // iter in y - - void *top = compile_add(&ctx); // iter + total in a - compile_movxa(&ctx); // move total to x - - compile_incy(&ctx); // increment iter - compile_fast_lio(&ctx, 1000000000); // limit in o - compile_subyo(&ctx); - - 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); - - compile_finish(&ctx); - - printf("%lu\n", run(&ctx)); -} -- cgit v1.3