diff options
Diffstat (limited to 'tests')
148 files changed, 1424 insertions, 1181 deletions
diff --git a/tests/absr_d.c b/tests/absr_d.c index 20424a7..e999a1c 100644 --- a/tests/absr_d.c +++ b/tests/absr_d.c @@ -14,9 +14,9 @@ int main(int argc, char *argv[]) ejit_retr_d(f, EJIT_FPR(0)); ejit_select_compile_func(f, 0, 1, false, do_jit); - assert(erff1(f, EJIT_ARG(0.0, double)) == 0.0); - assert(erff1(f, EJIT_ARG(-0.0, double)) == 0.0); - assert(erff1(f, EJIT_ARG(0.5, double)) == 0.5); - assert(erff1(f, EJIT_ARG(-0.5, double)) == 0.5); + assert(erfd1(f, EJIT_ARG(0.0, double)) == 0.0); + assert(erfd1(f, EJIT_ARG(-0.0, double)) == 0.0); + assert(erfd1(f, EJIT_ARG(0.5, double)) == 0.5); + assert(erfd1(f, EJIT_ARG(-0.5, double)) == 0.5); ejit_destroy_func(f); } diff --git a/tests/absr_f.c b/tests/absr_f.c index 876d82c..ec3a5f1 100644 --- a/tests/absr_f.c +++ b/tests/absr_f.c @@ -14,9 +14,9 @@ int main(int argc, char *argv[]) ejit_retr_f(f, EJIT_FPR(0)); ejit_select_compile_func(f, 0, 1, false, do_jit); - assert(ejit_run_func_f_1(f, EJIT_ARG(0.0, float)) == 0.0); - assert(ejit_run_func_f_1(f, EJIT_ARG(-0.0, float)) == 0.0); - assert(ejit_run_func_f_1(f, EJIT_ARG(0.5, float)) == 0.5); - assert(ejit_run_func_f_1(f, EJIT_ARG(-0.5, float)) == 0.5); + assert(erff1(f, EJIT_ARG(0.0, float)) == 0.0); + assert(erff1(f, EJIT_ARG(-0.0, float)) == 0.0); + assert(erff1(f, EJIT_ARG(0.5, float)) == 0.5); + assert(erff1(f, EJIT_ARG(-0.5, float)) == 0.5); ejit_destroy_func(f); } diff --git a/tests/addi.c b/tests/addi.c index 90579eb..20eefdb 100644 --- a/tests/addi.c +++ b/tests/addi.c @@ -14,6 +14,6 @@ int main(int argc, char *argv[]) ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, EJIT_USE64(int), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(42, int)) == 111); + assert(erfi1(f, EJIT_ARG(42, int)) == 111); ejit_destroy_func(f); } diff --git a/tests/addr.c b/tests/addr.c index efdae30..0950483 100644 --- a/tests/addr.c +++ b/tests/addr.c @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(42, long), EJIT_ARG(69, long)) == 111); ejit_destroy_func(f); diff --git a/tests/addr_d.c b/tests/addr_d.c index 0a1cfa5..e58bf58 100644 --- a/tests/addr_d.c +++ b/tests/addr_d.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erff2(f, EJIT_ARG(42., double), EJIT_ARG(69., double)) == 111.); - assert(erff2(f, EJIT_ARG(42.5, double), + assert(erfd2(f, EJIT_ARG(42., double), EJIT_ARG(69., double)) == 111.); + assert(erfd2(f, EJIT_ARG(42.5, double), EJIT_ARG(69.5, double)) == 112.); ejit_destroy_func(f); } diff --git a/tests/andi.c b/tests/andi.c index a587aab..c8fa277 100644 --- a/tests/andi.c +++ b/tests/andi.c @@ -17,9 +17,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0x7fffffff, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(0x80000000, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(0x7fffffffffffffff, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(0x8000000000000000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0x7fffffff, long)) == 1); + assert(erfi1(f, EJIT_ARG(0x80000000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0x7fffffffffffffff, long)) == 1); + assert(erfi1(f, EJIT_ARG(0x8000000000000000, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/andr64.c b/tests/andr64.c index 3d56e39..aa87b4d 100644 --- a/tests/andr64.c +++ b/tests/andr64.c @@ -18,73 +18,73 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0x80000000, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(0x7fffffff, int64_t) )== 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0xffffffff, int64_t) ) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0x7fffffff, int64_t) ) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0xffffffff, int64_t) ) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t) + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t) + assert(erfl2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(1, int64_t) ) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == 1); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(1, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x8000000000000000, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0x8000000000000000, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t) ) == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); diff --git a/tests/beqi.c b/tests/beqi.c index 8ef5119..d35b705 100644 --- a/tests/beqi.c +++ b/tests/beqi.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG( 0, long)) == 1); + assert(erfi1(f, EJIT_ARG( 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/beqr.c b/tests/beqr.c index 938f1be..1fcadf4 100644 --- a/tests/beqr.c +++ b/tests/beqr.c @@ -22,12 +22,12 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/beqr_d.c b/tests/beqr_d.c index 62e4269..b7e401e 100644 --- a/tests/beqr_d.c +++ b/tests/beqr_d.c @@ -23,15 +23,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); - - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); + + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); ejit_destroy_func(f); } diff --git a/tests/beqr_f.c b/tests/beqr_f.c index 9444284..0d16ce9 100644 --- a/tests/beqr_f.c +++ b/tests/beqr_f.c @@ -23,29 +23,37 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(float), do_jit); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG( 0, float), + EJIT_ARG( 0, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(1, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG( 0, float), + EJIT_ARG( 1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG( 1, float), + EJIT_ARG( 0, float)) == 0); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(-1, float), + EJIT_ARG( 0, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(-1, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG( 0, float), + EJIT_ARG(-1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG( 1, float), + EJIT_ARG( 1, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG( 0, float), + EJIT_ARG( 0.0/0.0, float)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG( 0.0/0.0, float), + EJIT_ARG( 0, float)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgei.c b/tests/bgei.c index 1fb1c53..3baeae6 100644 --- a/tests/bgei.c +++ b/tests/bgei.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG(0, long)) == 1); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgei_u.c b/tests/bgei_u.c index 20ac961..f400b5f 100644 --- a/tests/bgei_u.c +++ b/tests/bgei_u.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 1); - assert(erf1(f, EJIT_ARG(1, long)) == 1); - assert(erf1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0, long)) == 1); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bger.c b/tests/bger.c index ae33f33..14fefac 100644 --- a/tests/bger.c +++ b/tests/bger.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bger_u.c b/tests/bger_u.c index 150a14c..97c8a18 100644 --- a/tests/bger_u.c +++ b/tests/bger_u.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgti.c b/tests/bgti.c index c6a3386..ac4d704 100644 --- a/tests/bgti.c +++ b/tests/bgti.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG( 0, long)) == 0); + assert(erfi1(f, EJIT_ARG( 1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgti_u.c b/tests/bgti_u.c index c0055d4..1112fec 100644 --- a/tests/bgti_u.c +++ b/tests/bgti_u.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG( 0, long)) == 0); + assert(erfi1(f, EJIT_ARG( 1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bgtr.c b/tests/bgtr.c index a0d0c85..d970416 100644 --- a/tests/bgtr.c +++ b/tests/bgtr.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bgtr_d.c b/tests/bgtr_d.c index 57e8d0e..02ae115 100644 --- a/tests/bgtr_d.c +++ b/tests/bgtr_d.c @@ -21,14 +21,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 1); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgtr_f.c b/tests/bgtr_f.c index d362d8a..5da3e02 100644 --- a/tests/bgtr_f.c +++ b/tests/bgtr_f.c @@ -21,26 +21,33 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(1, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG(1, float), + EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(-1, float), + EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(-1, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(-1, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(0.0/0.0, float)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0.0/0.0, float), + EJIT_ARG(0, float)) == 0); ejit_destroy_func(f); } diff --git a/tests/bgtr_u.c b/tests/bgtr_u.c index 77e07fe..d6e1e9d 100644 --- a/tests/bgtr_u.c +++ b/tests/bgtr_u.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/blei.c b/tests/blei.c index f4ab77a..3a80c94 100644 --- a/tests/blei.c +++ b/tests/blei.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG( 0, long)) == 1); + assert(erfi1(f, EJIT_ARG( 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/blei_u.c b/tests/blei_u.c index b078995..1658e36 100644 --- a/tests/blei_u.c +++ b/tests/blei_u.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 1); - assert(erf1(f, EJIT_ARG(1, long)) == 0); - assert(erf1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG( 0, long)) == 1); + assert(erfi1(f, EJIT_ARG( 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bler.c b/tests/bler.c index baaef41..bd7abf0 100644 --- a/tests/bler.c +++ b/tests/bler.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bler_d.c b/tests/bler_d.c index 3d3d1d7..f1dab79 100644 --- a/tests/bler_d.c +++ b/tests/bler_d.c @@ -21,14 +21,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 0); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 0, double)) == 1); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 1, double)) == 1); + assert(erfi2(f, EJIT_ARG( 1, double), EJIT_ARG( 0, double)) == 0); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG( 0, double)) == 1); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG(-1, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); ejit_destroy_func(f); } diff --git a/tests/bler_f.c b/tests/bler_f.c index 8ff0a0a..9cc6b26 100644 --- a/tests/bler_f.c +++ b/tests/bler_f.c @@ -21,26 +21,33 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(1, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(1, float), + EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float) - ) == 1); + assert(erfi2(f, + EJIT_ARG(-1, float), + EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(-1, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(-1, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0, float), + EJIT_ARG(0.0/0.0, float)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float) - ) == 0); + assert(erfi2(f, + EJIT_ARG(0.0/0.0, float), + EJIT_ARG(0, float)) == 0); ejit_destroy_func(f); } diff --git a/tests/bler_u.c b/tests/bler_u.c index 64698aa..5d11f5a 100644 --- a/tests/bler_u.c +++ b/tests/bler_u.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/blti.c b/tests/blti.c index af1a483..e102265 100644 --- a/tests/blti.c +++ b/tests/blti.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0, long)) == 0); + assert(erfi1(f, EJIT_ARG(1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/blti_u.c b/tests/blti_u.c index 91d3ba4..ea350b7 100644 --- a/tests/blti_u.c +++ b/tests/blti_u.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG( 0, long)) == 0); + assert(erfi1(f, EJIT_ARG( 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bltr.c b/tests/bltr.c index 595cdaa..1e85e26 100644 --- a/tests/bltr.c +++ b/tests/bltr.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bltr_d.c b/tests/bltr_d.c index 7d251be..848462b 100644 --- a/tests/bltr_d.c +++ b/tests/bltr_d.c @@ -21,14 +21,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 0); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 0, double)) == 0); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 1, double)) == 1); + assert(erfi2(f, EJIT_ARG( 1, double), EJIT_ARG( 0, double)) == 0); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG( 0, double)) == 1); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG(-1, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 0); ejit_destroy_func(f); } diff --git a/tests/bltr_f.c b/tests/bltr_f.c index 230a1bf..07ab86b 100644 --- a/tests/bltr_f.c +++ b/tests/bltr_f.c @@ -21,14 +21,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(-1, float)) == 0); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG( 0, float)) == 0); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG( 1, float)) == 1); + assert(erfi2(f, EJIT_ARG( 1, float), EJIT_ARG( 0, float)) == 0); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG( 0, float)) == 1); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG(-1, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float)) == 0); + assert(erfi2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float)) == 0); ejit_destroy_func(f); } diff --git a/tests/bltr_u.c b/tests/bltr_u.c index 9e7d0e6..dbbaf3b 100644 --- a/tests/bltr_u.c +++ b/tests/bltr_u.c @@ -21,11 +21,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bmci.c b/tests/bmci.c index 011cbd3..3b2d302 100644 --- a/tests/bmci.c +++ b/tests/bmci.c @@ -20,10 +20,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG( 2, long)) == 1); + assert(erfi1(f, EJIT_ARG( 0, long)) == 1); + assert(erfi1(f, EJIT_ARG( 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(-1, long)) == 0); + assert(erfi1(f, EJIT_ARG( 2, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bmcr.c b/tests/bmcr.c index aaa4038..9e5e71c 100644 --- a/tests/bmcr.c +++ b/tests/bmcr.c @@ -21,15 +21,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG(-1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(-1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bmsi.c b/tests/bmsi.c index 1ed54b4..92ae0e8 100644 --- a/tests/bmsi.c +++ b/tests/bmsi.c @@ -20,10 +20,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG( 2, long)) == 0); + assert(erfi1(f, EJIT_ARG( 0, long)) == 0); + assert(erfi1(f, EJIT_ARG( 1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG( 2, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bmsr.c b/tests/bmsr.c index 8523e92..6d613e9 100644 --- a/tests/bmsr.c +++ b/tests/bmsr.c @@ -21,15 +21,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG(-1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bnei.c b/tests/bnei.c index add6f74..449c8b7 100644 --- a/tests/bnei.c +++ b/tests/bnei.c @@ -21,9 +21,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_1(f, EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_1(f, EJIT_ARG(-1, long)) == 1); + assert(erfi1(f, EJIT_ARG( 0, long)) == 0); + assert(erfi1(f, EJIT_ARG( 1, long)) == 1); + assert(erfi1(f, EJIT_ARG(-1, long)) == 1); ejit_destroy_func(f); } diff --git a/tests/bner.c b/tests/bner.c index 51fb1b5..d5ceb80 100644 --- a/tests/bner.c +++ b/tests/bner.c @@ -22,12 +22,12 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 0, long)) == 0); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG( 1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG( 0, long)) == 1); + assert(erfi2(f, EJIT_ARG( 0, long), EJIT_ARG(-1, long)) == 1); + assert(erfi2(f, EJIT_ARG( 1, long), EJIT_ARG( 1, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/bner_d.c b/tests/bner_d.c index b4a2e46..d0e32a1 100644 --- a/tests/bner_d.c +++ b/tests/bner_d.c @@ -22,16 +22,16 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(-1, double)) == 1); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 0, double)) == 0); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG( 1, double)) == 1); + assert(erfi2(f, EJIT_ARG( 1, double), EJIT_ARG( 0, double)) == 1); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG( 0, double)) == 1); + assert(erfi2(f, EJIT_ARG( 0, double), EJIT_ARG(-1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(0, double), EJIT_ARG(0.0/0.0, double)) == 1); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0, double)) == 1); ejit_destroy_func(f); } diff --git a/tests/bner_f.c b/tests/bner_f.c index a48ef2c..5c38d92 100644 --- a/tests/bner_f.c +++ b/tests/bner_f.c @@ -23,14 +23,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(float), do_jit); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(-1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); - assert(erf2(f, EJIT_ARG(0, float), EJIT_ARG(0.0/0.0, float)) == 1); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0, float)) == 1); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG( 0, float)) == 0); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG( 1, float)) == 1); + assert(erfi2(f, EJIT_ARG( 1, float), EJIT_ARG( 0, float)) == 1); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG( 0, float)) == 1); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG(-1, float)) == 1); + assert(erfi2(f, EJIT_ARG( 1, float), EJIT_ARG( 1, float)) == 0); + assert(erfi2(f, EJIT_ARG( 0, float), EJIT_ARG( 0.0/0.0, float)) == 1); + assert(erfi2(f, EJIT_ARG( 0.0/0.0, float), EJIT_ARG(0, float)) == 1); ejit_destroy_func(f); } diff --git a/tests/callee_9.c b/tests/callee_9.c index 38d7595..5ef5938 100644 --- a/tests/callee_9.c +++ b/tests/callee_9.c @@ -31,22 +31,29 @@ int main(int argc, char *argv[]) }; struct ejit_func *f = ejit_create_func(EJIT_POINTER, 9, operands); - EJIT_STXI(f, int8_t, EJIT_GPR(1), EJIT_GPR(0), - offsetof(struct args, a)); // a - EJIT_STXI(f, int16_t, EJIT_GPR(2), EJIT_GPR(0), - offsetof(struct args, b)); // b - EJIT_STXI(f, int32_t, EJIT_GPR(3), EJIT_GPR(0), - offsetof(struct args, c)); // c - EJIT_STXI(f, long, EJIT_GPR(4), EJIT_GPR(0), - offsetof(struct args, d)); // d - EJIT_STXI(f, uint16_t, EJIT_GPR(5), EJIT_GPR(0), - offsetof(struct args, e)); // e - EJIT_STXI(f, float, EJIT_FPR(0), EJIT_GPR(0), - offsetof(struct args, f)); // f - EJIT_STXI(f, double, EJIT_FPR(1), EJIT_GPR(0), - offsetof(struct args, g)); // g - EJIT_STXI(f, float, EJIT_FPR(2), EJIT_GPR(0), - offsetof(struct args, h)); // h + EJIT_STXI(f, int8_t, + EJIT_GPR(1), EJIT_GPR(0), offsetof(struct args, a)); // a + + EJIT_STXI(f, int16_t, + EJIT_GPR(2), EJIT_GPR(0), offsetof(struct args, b)); // b + + EJIT_STXI(f, int32_t, + EJIT_GPR(3), EJIT_GPR(0), offsetof(struct args, c)); // c + + EJIT_STXI(f, long, + EJIT_GPR(4), EJIT_GPR(0), offsetof(struct args, d)); // d + + EJIT_STXI(f, uint16_t, + EJIT_GPR(5), EJIT_GPR(0), offsetof(struct args, e)); // e + + EJIT_STXI(f, float, + EJIT_FPR(0), EJIT_GPR(0), offsetof(struct args, f)); // f + + EJIT_STXI(f, double, + EJIT_FPR(1), EJIT_GPR(0), offsetof(struct args, g)); // g + + EJIT_STXI(f, float, + EJIT_FPR(2), EJIT_GPR(0), offsetof(struct args, h)); // h ejit_retr(f, EJIT_GPR(0)); @@ -66,7 +73,7 @@ int main(int argc, char *argv[]) EJIT_ARG(in.g, double), EJIT_ARG(in.h, float) }; - assert((void *)ejit_run_func(f, 8, args) == &out); + assert((void *)ejit_run_func_i(f, 9, args) == &out); assert(in.a == out.a); assert(in.b == out.b); assert(in.c == out.c); diff --git a/tests/comr.c b/tests/comr.c index a22dfc9..0067092 100644 --- a/tests/comr.c +++ b/tests/comr.c @@ -7,61 +7,45 @@ int main(int argc, char *argv[]) (void)argv; bool do_jit = argc > 1; struct ejit_operand operands[1] = { - EJIT_OPERAND_GPR(0, EJIT_TYPE(long)) + EJIT_OPERAND_GPR(0, EJIT_TYPE(int64_t)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 1, operands); ejit_comr(f, EJIT_GPR(0), EJIT_GPR(0)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert((int32_t)erf1(f, EJIT_ARG(0, long) - ) == (int32_t)0xffffffff); + assert((int32_t)erfl1(f, EJIT_ARG(0, int64_t)) == (int32_t)0xffffffff); + assert((int32_t)erfl1(f, EJIT_ARG(1, int64_t)) == (int32_t)0xfffffffe); + assert((int32_t)erfl1(f, EJIT_ARG(0xffffffff, int64_t)) == 0); + assert((int32_t)erfl1(f, EJIT_ARG(0x80000000, int64_t)) == 0x7fffffff); + assert((int32_t)erfl1(f, EJIT_ARG(0x7fffffff, int64_t)) == (int32_t)0x80000000); + assert((int32_t)erfl1(f, EJIT_ARG(0x80000001, int64_t)) == (int32_t)0x7ffffffe); + assert(erfl1(f, EJIT_ARG(0, int64_t)) == (int64_t)0xffffffffffffffff); + assert(erfl1(f, EJIT_ARG(1, int64_t)) == (int64_t)0xfffffffffffffffe); + assert(erfl1(f, EJIT_ARG(0xffffffff, int64_t)) + == (int64_t)0xffffffff00000000); - assert((int32_t)erf1(f, EJIT_ARG(1, long) - ) == (int32_t)0xfffffffe); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) + == (int64_t)0xffffffff7fffffff); - assert((int32_t)erf1(f, EJIT_ARG(0xffffffff, long) - ) == 0); + assert(erfl1(f, EJIT_ARG(0x7fffffff, int64_t)) + == (int64_t)0xffffffff80000000); - assert((int32_t)erf1(f, EJIT_ARG(0x80000000, long) - ) == 0x7fffffff); + assert(erfl1(f, EJIT_ARG(0x80000001, int64_t)) + == (int64_t)0xffffffff7ffffffe); - assert((int32_t)erf1(f, EJIT_ARG(0x7fffffff, long) - ) == (int32_t)0x80000000); + assert(erfl1(f, EJIT_ARG(0xffffffffffffffff, int64_t)) == 0); + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x7fffffffffffffff); - assert((int32_t)erf1(f, EJIT_ARG(0x80000001, long) - ) == (int32_t)0x7ffffffe); + assert(erfl1(f, EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0x8000000000000000); - assert(erf1(f, EJIT_ARG(0, long) - ) == (int64_t)0xffffffffffffffff); - - assert(erf1(f, EJIT_ARG(1, long) - ) == (int64_t)0xfffffffffffffffe); - - assert(erf1(f, EJIT_ARG(0xffffffff, long) - ) == (int64_t)0xffffffff00000000); - - assert(erf1(f, EJIT_ARG(0x80000000, long) - ) == (int64_t)0xffffffff7fffffff); - - assert(erf1(f, EJIT_ARG(0x7fffffff, long) - ) == (int64_t)0xffffffff80000000); - - assert(erf1(f, EJIT_ARG(0x80000001, long) - ) == (int64_t)0xffffffff7ffffffe); - - assert(erf1(f, EJIT_ARG(0xffffffffffffffff, long)) == 0); - assert(erf1(f, EJIT_ARG(0x8000000000000000, long) - ) == (int64_t)0x7fffffffffffffff); - - assert(erf1(f, EJIT_ARG(0x7fffffffffffffff, long) - ) == (int64_t)0x8000000000000000); - - assert(erf1(f, EJIT_ARG(0x8000000000000001, long) - ) == (int64_t)0x7ffffffffffffffe); + assert(erfl1(f, EJIT_ARG(0x8000000000000001, int64_t)) + == (int64_t)0x7ffffffffffffffe); ejit_destroy_func(f); } diff --git a/tests/divr64.c b/tests/divr64.c index 2bdb4a7..13ab0a3 100644 --- a/tests/divr64.c +++ b/tests/divr64.c @@ -17,135 +17,135 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t)) == 0x7fffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t)) == 0x80000000); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(2, int64_t)) == 0x3fffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0xffffffff, int64_t)) == 1); /* 32bit specific stuff, unsure how this should be handled on 64bit * systems - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(2, int64_t)) == 0xc0000000); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0xffffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0xffffffff, int64_t)) == 0x80000001); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); */ - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(2, int64_t)) == 0x40000000); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 1); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0xffffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 2); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(1, int64_t)) == 0x7fffffffffffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(1, int64_t)) == (int64_t)0x8000000000000000); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(2, int64_t)) == (int64_t)0x3fffffffffffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(2, int64_t)) == (int64_t)0xc000000000000000); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t) ) == (int64_t)0x8000000000000001); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t)) == 1); diff --git a/tests/divr_d.c b/tests/divr_d.c index c6c2998..f6c4bc1 100644 --- a/tests/divr_d.c +++ b/tests/divr_d.c @@ -17,9 +17,12 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erff2(f, EJIT_ARG(-0.5f, double), + assert(erfd2(f, + EJIT_ARG(-0.5f, double), EJIT_ARG(0.5f, double)) == -1.0f); - assert(erff2(f, EJIT_ARG(1.25f, double), + + assert(erfd2(f, + EJIT_ARG(1.25f, double), EJIT_ARG(0.5f, double)) == 2.5f); ejit_destroy_func(f); diff --git a/tests/divr_u64.c b/tests/divr_u64.c index 8753066..1a71785 100644 --- a/tests/divr_u64.c +++ b/tests/divr_u64.c @@ -7,90 +7,108 @@ int main(int argc, char *argv[]) (void)argv; bool do_jit = argc > 1; struct ejit_operand operands[2] = { - EJIT_OPERAND_GPR(0, EJIT_TYPE(long)), - EJIT_OPERAND_GPR(1, EJIT_TYPE(long)) + EJIT_OPERAND_GPR(0, EJIT_TYPE(uint64_t)), + EJIT_OPERAND_GPR(1, EJIT_TYPE(uint64_t)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 2, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(uint64_t), 2, operands); ejit_divr_u(f, EJIT_GPR(0), EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 2, 0, EJIT_USE64(uint64_t), do_jit); - assert(erf2(f, EJIT_ARG(0x7fffffff, long), EJIT_ARG(1, long) - ) == 0x7fffffff); + assert(erfl2(f, + EJIT_ARG(0x7fffffff, uint64_t), + EJIT_ARG(1, uint64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x80000000, long), EJIT_ARG(1, long) - ) == 0x80000000); - assert(erf2(f, EJIT_ARG(0x7fffffff, long), EJIT_ARG(2, long) - ) == 0x3fffffff); + assert(erfl2(f, + EJIT_ARG(0x80000000, uint64_t), + EJIT_ARG(1, uint64_t)) == 0x80000000); - assert(erf2(f, EJIT_ARG(0x80000000, long), EJIT_ARG(2, long) - ) == 0x40000000); + assert(erfl2(f, + EJIT_ARG(0x7fffffff, uint64_t), + EJIT_ARG(2, uint64_t)) == 0x3fffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, long), EJIT_ARG(0x80000000, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(0x80000000, uint64_t), + EJIT_ARG(2, uint64_t)) == 0x40000000); - assert(erf2(f, EJIT_ARG(0x80000000, long), EJIT_ARG(0x7fffffff, long) - ) == 1); + assert(erfl2(f, + EJIT_ARG(0x7fffffff, uint64_t), + EJIT_ARG(0x80000000, uint64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, long), EJIT_ARG(0xffffffff, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(0x80000000, uint64_t), + EJIT_ARG(0x7fffffff, uint64_t)) == 1); - assert(erf2(f, EJIT_ARG(0xffffffff, long), EJIT_ARG(0x7fffffff, long) - ) == 2); + assert(erfl2(f, + EJIT_ARG(0x7fffffff, uint64_t), + EJIT_ARG(0xffffffff, uint64_t)) == 0); - assert(erf2(f, EJIT_ARG(0xffffffff, long), EJIT_ARG(0xffffffff, long) - ) == 1); + assert(erfl2(f, + EJIT_ARG(0xffffffff, uint64_t), + EJIT_ARG(0x7fffffff, uint64_t)) == 2); - assert(erf2(f, EJIT_ARG(1, long), EJIT_ARG(0x7fffffff, long)) == 0); - assert(erf2(f, EJIT_ARG(1, long), EJIT_ARG(0x80000000, long)) == 0); - assert(erf2(f, EJIT_ARG(2, long), EJIT_ARG(0x7fffffff, long)) == 0); - assert(erf2(f, EJIT_ARG(2, long), EJIT_ARG(0x80000000, long)) == 0); - assert(erf2(f, EJIT_ARG(0, long), EJIT_ARG(0x7fffffff, long)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(1, long) - ) == 0x7fffffffffffffff); + assert(erfl2(f, + EJIT_ARG(0xffffffff, uint64_t), + EJIT_ARG(0xffffffff, uint64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x8000000000000000, long), EJIT_ARG(1, long) - ) == (int64_t)0x8000000000000000); + assert(erfl2(f, EJIT_ARG(1, uint64_t), EJIT_ARG(0x7fffffff, uint64_t)) == 0); + assert(erfl2(f, EJIT_ARG(1, uint64_t), EJIT_ARG(0x80000000, uint64_t)) == 0); + assert(erfl2(f, EJIT_ARG(2, uint64_t), EJIT_ARG(0x7fffffff, uint64_t)) == 0); + assert(erfl2(f, EJIT_ARG(2, uint64_t), EJIT_ARG(0x80000000, uint64_t)) == 0); + assert(erfl2(f, EJIT_ARG(0, uint64_t), EJIT_ARG(0x7fffffff, uint64_t)) == 0); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, uint64_t), + EJIT_ARG(1, uint64_t)) == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(2, long) - ) == 0x3fffffffffffffff); + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, uint64_t), + EJIT_ARG(1, uint64_t)) == (int64_t)0x8000000000000000); - assert(erf2(f, EJIT_ARG(0x8000000000000000, long), EJIT_ARG(2, long) - ) == 0x4000000000000000); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, uint64_t), + EJIT_ARG(2, uint64_t)) == 0x3fffffffffffffff); - assert(erf2(f, EJIT_ARG(1, long), EJIT_ARG(0x7fffffffffffffff, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, uint64_t), + EJIT_ARG(2, uint64_t)) == 0x4000000000000000); - assert(erf2(f, EJIT_ARG(1, long), EJIT_ARG(0x8000000000000000, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(1, uint64_t), + EJIT_ARG(0x7fffffffffffffff, uint64_t)) == 0); - assert(erf2(f, EJIT_ARG(2, long), EJIT_ARG(0x7fffffffffffffff, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(1, uint64_t), + EJIT_ARG(0x8000000000000000, uint64_t)) == 0); - assert(erf2(f, EJIT_ARG(2, long), EJIT_ARG(0x8000000000000000, long) - ) == 0); + assert(erfl2(f, + EJIT_ARG(2, uint64_t), + EJIT_ARG(0x7fffffffffffffff, uint64_t)) == 0); - assert(erf2(f, - EJIT_ARG(0x7fffffffffffffff, long), - EJIT_ARG(0x8000000000000000, long)) == 0); + assert(erfl2(f, + EJIT_ARG(2, uint64_t), + EJIT_ARG(0x8000000000000000, uint64_t)) == 0); - assert(erf2(f, - EJIT_ARG(0x8000000000000000, long), - EJIT_ARG(0x7fffffffffffffff, long)) == 1); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, uint64_t), + EJIT_ARG(0x8000000000000000, uint64_t)) == 0); - assert(erf2(f, - EJIT_ARG(0x7fffffffffffffff, long), - EJIT_ARG(0xffffffffffffffff, long)) == 0); + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, uint64_t), + EJIT_ARG(0x7fffffffffffffff, uint64_t)) == 1); - assert(erf2(f, - EJIT_ARG(0xffffffffffffffff, long), - EJIT_ARG(0x7fffffffffffffff, long)) == 2); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, uint64_t), + EJIT_ARG(0xffffffffffffffff, uint64_t)) == 0); - assert(erf2(f, - EJIT_ARG(0xffffffffffffffff, long), - EJIT_ARG(0xffffffffffffffff, long)) == 1); + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, uint64_t), + EJIT_ARG(0x7fffffffffffffff, uint64_t)) == 2); + + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, uint64_t), + EJIT_ARG(0xffffffffffffffff, uint64_t)) == 1); ejit_destroy_func(f); } diff --git a/tests/do_jit.h b/tests/do_jit.h index 5be682b..08e39c6 100644 --- a/tests/do_jit.h +++ b/tests/do_jit.h @@ -1,12 +1,48 @@ #ifndef DOJIT_H #define DOJIT_H -#define erf3 ejit_run_func_3 -#define erf2 ejit_run_func_2 -#define erf1 ejit_run_func_1 +static inline long erfi1(struct ejit_func *f, struct ejit_arg a0) +{ + return ejit_run_func_i(f, 1, &a0); +} -#define erff3 ejit_run_func_f_3 -#define erff2 ejit_run_func_f_2 -#define erff1 ejit_run_func_f_1 +static inline long erfi2(struct ejit_func *f, struct ejit_arg a0, struct ejit_arg a1) +{ + struct ejit_arg args[2] = {a0, a1}; + return ejit_run_func_i(f, 2, args); +} + +static inline int64_t erfl1(struct ejit_func *f, struct ejit_arg a0) +{ + return ejit_run_func_l(f, 1, &a0); +} + +static inline int64_t erfl2(struct ejit_func *f, struct ejit_arg a0, struct ejit_arg a1) +{ + struct ejit_arg args[2] = {a0, a1}; + return ejit_run_func_l(f, 2, args); +} + +static inline float erff1(struct ejit_func *f, struct ejit_arg a0) +{ + return ejit_run_func_f(f, 1, &a0); +} + +static inline float erff2(struct ejit_func *f, struct ejit_arg a0, struct ejit_arg a1) +{ + struct ejit_arg args[2] = {a0, a1}; + return ejit_run_func_f(f, 2, args); +} + +static inline double erfd1(struct ejit_func *f, struct ejit_arg a0) +{ + return ejit_run_func_d(f, 1, &a0); +} + +static inline double erfd2(struct ejit_func *f, struct ejit_arg a0, struct ejit_arg a1) +{ + struct ejit_arg args[2] = {a0, a1}; + return ejit_run_func_d(f, 2, args); +} #endif /* DOJIT_H */ diff --git a/tests/eqr.c b/tests/eqr.c index bda0908..d56ae61 100644 --- a/tests/eqr.c +++ b/tests/eqr.c @@ -7,26 +7,26 @@ int main(int argc, char *argv[]) (void)argv; bool do_jit = argc > 1; struct ejit_operand operands[2] = { - EJIT_OPERAND_GPR(0, EJIT_TYPE(long)), - EJIT_OPERAND_GPR(1, EJIT_TYPE(long)) + EJIT_OPERAND_GPR(0, EJIT_TYPE(int64_t)), + EJIT_OPERAND_GPR(1, EJIT_TYPE(int64_t)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 2, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 2, operands); ejit_eqr(f, EJIT_GPR(0), EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(1, int64_t)) == 1); + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0, int64_t)) == 0); - assert(ejit_run_func_2(f, - EJIT_ARG(0x7fffffffffffffff, long), - EJIT_ARG(0x7ffffffffffffff0, long)) == 0); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x7ffffffffffffff0, int64_t)) == 0); - assert(ejit_run_func_2(f, - EJIT_ARG(0x6fffffffffffffff, long), - EJIT_ARG(0x7fffffffffffffff, long)) == 0); + assert(erfl2(f, + EJIT_ARG(0x6fffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) == 0); ejit_destroy_func(f); } diff --git a/tests/eqr_d.c b/tests/eqr_d.c index aa4a000..555dedf 100644 --- a/tests/eqr_d.c +++ b/tests/eqr_d.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, double), + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, double), EJIT_ARG(0.0/0.0, double)) == 0); ejit_destroy_func(f); diff --git a/tests/eqr_f.c b/tests/eqr_f.c index 0faa2a7..95c9b0e 100644 --- a/tests/eqr_f.c +++ b/tests/eqr_f.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(0.0/0.0, float), + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 1); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); + assert(erfi2(f, EJIT_ARG(0.0/0.0, float), EJIT_ARG(0.0/0.0, float)) == 0); ejit_destroy_func(f); diff --git a/tests/escapei_10.c b/tests/escapei_10.c index 3ee1984..4b7673e 100644 --- a/tests/escapei_10.c +++ b/tests/escapei_10.c @@ -70,14 +70,14 @@ int main(int argc, char *argv[]) EJIT_OPERAND_GPR( 9, EJIT_INT32), EJIT_OPERAND_GPR(10, EJIT_INT32), }; - ejit_escapei(f, escape_func, 10, args); + ejit_escapei_i(f, escape_func, 10, args); ejit_retval(f, EJIT_GPR(0)); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 11, 0, false, do_jit); int32_t iargs[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; - assert(ejit_run_func_1(f, EJIT_ARG(iargs, void *)) == 42); + assert(erfi1(f, EJIT_ARG(iargs, void *)) == 42); ejit_destroy_func(f); } diff --git a/tests/escapei_double.c b/tests/escapei_double.c index 7eb9a27..8406490 100644 --- a/tests/escapei_double.c +++ b/tests/escapei_double.c @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) EJIT_OPERAND_GPR(0, EJIT_INT32), EJIT_OPERAND_FPR(0, EJIT_DOUBLE) }; - ejit_escapei_f(f, escape_func, 2, args); + ejit_escapei_d(f, escape_func, 2, args); ejit_retval_d(f, EJIT_FPR(0)); ejit_retr_d(f, EJIT_FPR(0)); @@ -41,7 +41,7 @@ int main(int argc, char *argv[]) double d = 22.0f; int32_t i = 20; - assert(erff2(f, EJIT_ARG(&i, void *), EJIT_ARG(&d, void *)) == 42.0f); + assert(erfd2(f, EJIT_ARG(&i, void *), EJIT_ARG(&d, void *)) == 42.0f); ejit_destroy_func(f); } diff --git a/tests/escapei_float.c b/tests/escapei_float.c index c1c0993..f0fd052 100644 --- a/tests/escapei_float.c +++ b/tests/escapei_float.c @@ -6,7 +6,7 @@ static float func(int32_t a, float b) { return b + a; } -static double escape_func(size_t argc, const struct ejit_arg args[argc]) +static float escape_func(size_t argc, const struct ejit_arg args[argc]) { assert(argc == 2); assert(args[0].type == EJIT_INT32); diff --git a/tests/extr_16.c b/tests/extr_16.c index 1d98e0f..412cba9 100644 --- a/tests/extr_16.c +++ b/tests/extr_16.c @@ -15,12 +15,12 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 0); - assert(erf1(f, EJIT_ARG(1, long)) == 1); - assert(erf1(f, EJIT_ARG(0xfff, long)) == 0xfff); - assert(erf1(f, EJIT_ARG(0xffff, long)) == -1); - assert(erf1(f, EJIT_ARG(0xfffff, long)) == -1); - assert(erf1(f, EJIT_ARG(0xf0000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0, long)) == 0); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0xfff, long)) == 0xfff); + assert(erfi1(f, EJIT_ARG(0xffff, long)) == -1); + assert(erfi1(f, EJIT_ARG(0xfffff, long)) == -1); + assert(erfi1(f, EJIT_ARG(0xf0000, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/extr_32.c b/tests/extr_32.c index 3ade35e..673e7aa 100644 --- a/tests/extr_32.c +++ b/tests/extr_32.c @@ -14,14 +14,15 @@ int main(int argc, char *argv[]) ejit_extr_32(f, EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); + /* true since extr_32 only exists on 64bit arches */ + ejit_select_compile_func(f, 2, 0, true, do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 0); - assert(erf1(f, EJIT_ARG(1, long)) == 1); - assert(erf1(f, EJIT_ARG(0xfffffff, long)) == 0xfffffff); - assert(erf1(f, EJIT_ARG(0xffffffff, long)) == -1); - assert(erf1(f, EJIT_ARG(0xfffffffff, long)) == -1); - assert(erf1(f, EJIT_ARG(0xf00000000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0, long)) == 0); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0xfffffff, long)) == 0xfffffff); + assert(erfi1(f, EJIT_ARG(0xffffffff, long)) == -1); + assert(erfi1(f, EJIT_ARG(0xfffffffff, long)) == -1); + assert(erfi1(f, EJIT_ARG(0xf00000000, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/extr_8.c b/tests/extr_8.c index 58b0e76..dd219be 100644 --- a/tests/extr_8.c +++ b/tests/extr_8.c @@ -16,11 +16,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(unsigned long), do_jit); - assert(erf1(f, EJIT_ARG(0, unsigned long)) == 0); - assert(erf1(f, EJIT_ARG(1, unsigned long)) == 1); - assert(erf1(f, EJIT_ARG(0xf, unsigned long)) == 0xf); - assert(erf1(f, EJIT_ARG(0xff, unsigned long)) == -1); - assert(erf1(f, EJIT_ARG(0xfff, unsigned long)) == -1); + assert(erfi1(f, EJIT_ARG(0, unsigned long)) == 0); + assert(erfi1(f, EJIT_ARG(1, unsigned long)) == 1); + assert(erfi1(f, EJIT_ARG(0xf, unsigned long)) == 0xf); + assert(erfi1(f, EJIT_ARG(0xff, unsigned long)) == -1); + assert(erfi1(f, EJIT_ARG(0xfff, unsigned long)) == -1); ejit_destroy_func(f); } diff --git a/tests/extr_d.c b/tests/extr_d.c index b8a3aa9..7b06b7c 100644 --- a/tests/extr_d.c +++ b/tests/extr_d.c @@ -16,9 +16,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, false, do_jit); - assert(erff1(f, EJIT_ARG(0, long)) == 0.0f); - assert(erff1(f, EJIT_ARG(1, long)) == 1.0f); - assert(erff1(f, EJIT_ARG(-100, long)) == -100.0f); + assert(erfd1(f, EJIT_ARG(0, long)) == 0.0f); + assert(erfd1(f, EJIT_ARG(1, long)) == 1.0f); + assert(erfd1(f, EJIT_ARG(-100, long)) == -100.0f); ejit_destroy_func(f); } diff --git a/tests/extr_u16.c b/tests/extr_u16.c index e2e000d..955d3c0 100644 --- a/tests/extr_u16.c +++ b/tests/extr_u16.c @@ -16,11 +16,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 0); - assert(erf1(f, EJIT_ARG(1, long)) == 1); - assert(erf1(f, EJIT_ARG(0xffff, long)) == 0xffff); - assert(erf1(f, EJIT_ARG(0xfffff, long)) == 0xffff); - assert(erf1(f, EJIT_ARG(0xf0000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0, long)) == 0); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0xffff, long)) == 0xffff); + assert(erfi1(f, EJIT_ARG(0xfffff, long)) == 0xffff); + assert(erfi1(f, EJIT_ARG(0xf0000, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/extr_u32.c b/tests/extr_u32.c index 478b220..ba4c391 100644 --- a/tests/extr_u32.c +++ b/tests/extr_u32.c @@ -14,13 +14,14 @@ int main(int argc, char *argv[]) ejit_extr_u32(f, EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); + /* true since extr_u32 only exists on 64bit arches */ + ejit_select_compile_func(f, 2, 0, true, do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 0); - assert(erf1(f, EJIT_ARG(1, long)) == 1); - assert(erf1(f, EJIT_ARG(0xffffffff, long)) == 0xffffffff); - assert(erf1(f, EJIT_ARG(0xfffffffff, long)) == 0xffffffff); - assert(erf1(f, EJIT_ARG(0xf00000000, long)) == 0); + assert(erfi1(f, EJIT_ARG(0, long)) == 0); + assert(erfi1(f, EJIT_ARG(1, long)) == 1); + assert(erfi1(f, EJIT_ARG(0xffffffff, long)) == (long)0xffffffff); + assert(erfi1(f, EJIT_ARG(0xfffffffff, long)) == (long)0xffffffff); + assert(erfi1(f, EJIT_ARG(0xf00000000, long)) == 0); ejit_destroy_func(f); } diff --git a/tests/extr_u8.c b/tests/extr_u8.c index 94785f3..8ba465a 100644 --- a/tests/extr_u8.c +++ b/tests/extr_u8.c @@ -16,11 +16,11 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(unsigned long), do_jit); - assert(erf1(f, EJIT_ARG(0, unsigned long)) == 0); - assert(erf1(f, EJIT_ARG(1, unsigned long)) == 1); - assert(erf1(f, EJIT_ARG(0xff, unsigned long)) == 0xff); - assert(erf1(f, EJIT_ARG(0xfff, unsigned long)) == 0xff); - assert(erf1(f, EJIT_ARG(0xf00, unsigned long)) == 0); + assert(erfi1(f, EJIT_ARG(0, unsigned long)) == 0); + assert(erfi1(f, EJIT_ARG(1, unsigned long)) == 1); + assert(erfi1(f, EJIT_ARG(0xff, unsigned long)) == 0xff); + assert(erfi1(f, EJIT_ARG(0xfff, unsigned long)) == 0xff); + assert(erfi1(f, EJIT_ARG(0xf00, unsigned long)) == 0); ejit_destroy_func(f); } diff --git a/tests/ger.c b/tests/ger.c index 8dc064d..457eada 100644 --- a/tests/ger.c +++ b/tests/ger.c @@ -18,14 +18,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); + assert(erfi2(f, EJIT_ARG(0, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x0fffffffffffffff, long), EJIT_ARG(0x0ffffffffffffff0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(0x6ffffffffffffff0, long)) == 1); ejit_destroy_func(f); diff --git a/tests/ger_u.c b/tests/ger_u.c index 3194758..4853ed9 100644 --- a/tests/ger_u.c +++ b/tests/ger_u.c @@ -18,17 +18,17 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 1); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(1, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x0fffffffffffffff, long), EJIT_ARG(0x0ffffffffffffff0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(0x6fffffffffffffff, long)) == 1); ejit_destroy_func(f); diff --git a/tests/gtr.c b/tests/gtr.c index 075e0ff..00112cd 100644 --- a/tests/gtr.c +++ b/tests/gtr.c @@ -18,14 +18,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x0fffffffffffffff, long), EJIT_ARG(0x0ffffffffffffff0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(0x6ffffffffffffff0, long)) == 1); ejit_destroy_func(f); diff --git a/tests/gtr_d.c b/tests/gtr_d.c index 35de463..92e103e 100644 --- a/tests/gtr_d.c +++ b/tests/gtr_d.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); ejit_destroy_func(f); } diff --git a/tests/gtr_f.c b/tests/gtr_f.c index e65ad35..cea05fd 100644 --- a/tests/gtr_f.c +++ b/tests/gtr_f.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 1); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 1); ejit_destroy_func(f); } diff --git a/tests/gtr_u.c b/tests/gtr_u.c index b1b039f..c02d284 100644 --- a/tests/gtr_u.c +++ b/tests/gtr_u.c @@ -18,16 +18,16 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(1, long)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(1, long)) == 1); + assert(erfi2(f, EJIT_ARG(-1, long), EJIT_ARG(0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x0fffffffffffffff, long), EJIT_ARG(0x0ffffffffffffff0, long)) == 1); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(0x6ffffffffffffff0, long)) == 1); ejit_destroy_func(f); diff --git a/tests/jmp0.c b/tests/jmp0.c index cdba901..4157c9f 100644 --- a/tests/jmp0.c +++ b/tests/jmp0.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(42, long)) == 42); - assert(erf1(f, EJIT_ARG(-1, long)) == -1); + assert(erfi1(f, EJIT_ARG(42, long)) == 42); + assert(erfi1(f, EJIT_ARG(-1, long)) == -1); ejit_destroy_func(f); } diff --git a/tests/jmp_table.c b/tests/jmp_table.c index 2c4ac84..948bb74 100644 --- a/tests/jmp_table.c +++ b/tests/jmp_table.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) } struct ejit_operand operands[1] = { - EJIT_OPERAND_GPR(0, EJIT_POINTER) + EJIT_OPERAND_GPR(0, EJIT_TYPE(long)) }; struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) #warning \ "Label rewriting is not currently working so this will fail the jit test" - ejit_ldxi_label(f, EJIT_GPR(1), EJIT_GPR(0), (int64_t)targets); + ejit_ldxi_label(f, EJIT_GPR(1), EJIT_GPR(0), (uintptr_t)targets); ejit_jmpr(f, EJIT_GPR(1)); struct ejit_reloc tails[NTARGETS]; @@ -53,11 +53,11 @@ int main(int argc, char *argv[]) for (int i = -2; i < ((int) NTARGETS) + 2; i++) { if (i < 0) { - assert(erf1(f, EJIT_ARG(i, long)) == 42); + assert(erfi1(f, EJIT_ARG(i, long)) == 42); } else if (i < NTARGETS) { - assert(erf1(f, EJIT_ARG(i, long)) == i * i); + assert(erfi1(f, EJIT_ARG(i, long)) == i * i); } else { - assert(erf1(f, EJIT_ARG(i, long)) == 42); + assert(erfi1(f, EJIT_ARG(i, long)) == 42); } } diff --git a/tests/jmpi_local.c b/tests/jmpi_local.c index c19a8ca..ca81c19 100644 --- a/tests/jmpi_local.c +++ b/tests/jmpi_local.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func(f, 0, NULL) == 1); + assert(ejit_run_func_i(f, 0, NULL) == 1); ejit_destroy_func(f); } diff --git a/tests/ldi_d.c b/tests/ldi_d.c index 949eaee..d94f485 100644 --- a/tests/ldi_d.c +++ b/tests/ldi_d.c @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 1, EJIT_USE64(double), do_jit); - assert(ejit_run_func_f(f, 0, NULL) == data); + assert(ejit_run_func_d(f, 0, NULL) == data); ejit_destroy_func(f); } diff --git a/tests/ldi_i16.c b/tests/ldi_i16.c index 7bbbc4d..db63b62 100644 --- a/tests/ldi_i16.c +++ b/tests/ldi_i16.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, false, do_jit); - assert(ejit_run_func(f, 0, NULL) == -1); + assert(ejit_run_func_i(f, 0, NULL) == -1); ejit_destroy_func(f); } diff --git a/tests/ldi_i32.c b/tests/ldi_i32.c index c8ecbc4..d898e44 100644 --- a/tests/ldi_i32.c +++ b/tests/ldi_i32.c @@ -10,12 +10,12 @@ int main(int argc, char *argv[]) struct ejit_func *f = ejit_create_func(EJIT_TYPE(unsigned long), 0, NULL); - ejit_ldi_u32(f, EJIT_GPR(0), data); + ejit_ldi_i32(f, EJIT_GPR(0), data); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, false, do_jit); - assert(ejit_run_func(f, 0, NULL) == data[0]); + assert(ejit_run_func_i(f, 0, NULL) == (int32_t)data[0]); ejit_destroy_func(f); } diff --git a/tests/ldi_i64.c b/tests/ldi_i64.c index 0815ad8..3f7c5df 100644 --- a/tests/ldi_i64.c +++ b/tests/ldi_i64.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, true, do_jit); - assert(ejit_run_func(f, 0, NULL) == -1); + assert(ejit_run_func_i(f, 0, NULL) == -1); ejit_destroy_func(f); } diff --git a/tests/ldi_i8.c b/tests/ldi_i8.c index 5225a7c..c2314e8 100644 --- a/tests/ldi_i8.c +++ b/tests/ldi_i8.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(unsigned long), do_jit); - assert(ejit_run_func(f, 0, NULL) == -1); + assert(ejit_run_func_i(f, 0, NULL) == -1); ejit_destroy_func(f); } diff --git a/tests/ldi_u16.c b/tests/ldi_u16.c index 1f30bd2..7e75e30 100644 --- a/tests/ldi_u16.c +++ b/tests/ldi_u16.c @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(unsigned long), do_jit); - assert(ejit_run_func(f, 0, NULL) == data[0]); + assert(ejit_run_func_i(f, 0, NULL) == data[0]); ejit_destroy_func(f); } diff --git a/tests/ldi_u32.c b/tests/ldi_u32.c new file mode 100644 index 0000000..17ad43d --- /dev/null +++ b/tests/ldi_u32.c @@ -0,0 +1,21 @@ +#include <ejit/ejit.h> +#include <assert.h> +#include "do_jit.h" + +int main(int argc, char *argv[]) +{ + (void)argv; + bool do_jit = argc > 1; + static uint32_t data[] = { 0xffffffff, 0x00000000, 0x42424242 }; + + struct ejit_func *f = ejit_create_func(EJIT_TYPE(unsigned long), 0, + NULL); + ejit_ldi_u32(f, EJIT_GPR(0), data); + ejit_retr(f, EJIT_GPR(0)); + + ejit_select_compile_func(f, 1, 0, true, do_jit); + + assert(ejit_run_func_i(f, 0, NULL) == (long)data[0]); + + ejit_destroy_func(f); +} diff --git a/tests/ldi_u64.c b/tests/ldi_u64.c index 8dfb110..0e6787e 100644 --- a/tests/ldi_u64.c +++ b/tests/ldi_u64.c @@ -8,14 +8,14 @@ int main(int argc, char *argv[]) bool do_jit = argc > 1; static uint64_t data[] = { 0x12345678ffffffff, 0x00000000, 0x42424242 }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(unsigned long), 0, + struct ejit_func *f = ejit_create_func(EJIT_TYPE(uint64_t), 0, NULL); ejit_ldi_u64(f, EJIT_GPR(0), data); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, true, do_jit); - assert(ejit_run_func(f, 0, NULL) == (int64_t)data[0]); + assert(ejit_run_func_l(f, 0, NULL) == (int64_t)data[0]); ejit_destroy_func(f); } diff --git a/tests/ldi_u8.c b/tests/ldi_u8.c index d84a3f5..c8829e1 100644 --- a/tests/ldi_u8.c +++ b/tests/ldi_u8.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(unsigned long), do_jit); - assert(ejit_run_func(f, 0, NULL) == 0xff); + assert(ejit_run_func_i(f, 0, NULL) == 0xff); ejit_destroy_func(f); } diff --git a/tests/ldxi_d.c b/tests/ldxi_d.c index 98474d2..99faa20 100644 --- a/tests/ldxi_d.c +++ b/tests/ldxi_d.c @@ -19,9 +19,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, EJIT_USE64(long), do_jit); - assert(erff1(f, EJIT_ARG(sizeof(double) * 0, long)) == data[0]); - assert(erff1(f, EJIT_ARG(sizeof(double) * 1, long)) == data[1]); - assert(erff1(f, EJIT_ARG(sizeof(double) * 2, long)) == data[2]); + assert(erfd1(f, EJIT_ARG(sizeof(double) * 0, long)) == data[0]); + assert(erfd1(f, EJIT_ARG(sizeof(double) * 1, long)) == data[1]); + assert(erfd1(f, EJIT_ARG(sizeof(double) * 2, long)) == data[2]); ejit_destroy_func(f); } diff --git a/tests/ldxi_i16.c b/tests/ldxi_i16.c index 8d308df..85aa6d6 100644 --- a/tests/ldxi_i16.c +++ b/tests/ldxi_i16.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 0, long)) == -1); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 1, long)) == 0); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 2, long)) == 0x4242); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 0, long)) == -1); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 2, long)) == 0x4242); ejit_destroy_func(f); } diff --git a/tests/ldxi_i32.c b/tests/ldxi_i32.c index e20aaf3..1fc7904 100644 --- a/tests/ldxi_i32.c +++ b/tests/ldxi_i32.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 0, long)) == -1); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 1, long)) == 0); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 2, long)) == 0x42424242); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 0, long)) == -1); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 2, long)) == 0x42424242); ejit_destroy_func(f); } diff --git a/tests/ldxi_i64.c b/tests/ldxi_i64.c index fd2266b..d9c78d1 100644 --- a/tests/ldxi_i64.c +++ b/tests/ldxi_i64.c @@ -12,16 +12,15 @@ int main(int argc, char *argv[]) EJIT_OPERAND_GPR(0, EJIT_TYPE(long)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 1, operands); ejit_ldxi_i64(f, EJIT_GPR(0), EJIT_GPR(0), (uintptr_t)data); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, true, do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 0, long)) == -1); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 1, long)) == 0); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 2, long) - ) == (int64_t)data[2]); + assert(erfl1(f, EJIT_ARG(sizeof(int64_t) * 0, long)) == -1); + assert(erfl1(f, EJIT_ARG(sizeof(int64_t) * 1, long)) == 0); + assert(erfl1(f, EJIT_ARG(sizeof(int64_t) * 2, long)) == (int64_t)data[2]); ejit_destroy_func(f); } diff --git a/tests/ldxi_i8.c b/tests/ldxi_i8.c index 5af614f..533d5ae 100644 --- a/tests/ldxi_i8.c +++ b/tests/ldxi_i8.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == -1); - assert(erf1(f, EJIT_ARG(1, long)) == 0); - assert(erf1(f, EJIT_ARG(2, long)) == 0x42); + assert(erfi1(f, EJIT_ARG(0, long)) == -1); + assert(erfi1(f, EJIT_ARG(1, long)) == 0); + assert(erfi1(f, EJIT_ARG(2, long)) == 0x42); ejit_destroy_func(f); } diff --git a/tests/ldxi_u16.c b/tests/ldxi_u16.c index 2eb68c3..5452037 100644 --- a/tests/ldxi_u16.c +++ b/tests/ldxi_u16.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 0, long)) == 0xffff); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 1, long)) == 0); - assert(erf1(f, EJIT_ARG(sizeof(int16_t) * 2, long)) == 0x4242); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 0, long)) == 0xffff); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(sizeof(int16_t) * 2, long)) == 0x4242); ejit_destroy_func(f); } diff --git a/tests/ldxi_u32.c b/tests/ldxi_u32.c index f70b23b..bb5f12f 100644 --- a/tests/ldxi_u32.c +++ b/tests/ldxi_u32.c @@ -16,11 +16,11 @@ int main(int argc, char *argv[]) ejit_ldxi_u32(f, EJIT_GPR(0), EJIT_GPR(0), (uintptr_t)data); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 1, 0, true, do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 0, long)) == 0xffffffff); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 1, long)) == 0); - assert(erf1(f, EJIT_ARG(sizeof(int32_t) * 2, long)) == 0x42424242); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 0, long)) == (long)0xffffffff); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 1, long)) == 0); + assert(erfi1(f, EJIT_ARG(sizeof(int32_t) * 2, long)) == 0x42424242); ejit_destroy_func(f); } diff --git a/tests/ldxi_u64.c b/tests/ldxi_u64.c index 1cc57fe..e440435 100644 --- a/tests/ldxi_u64.c +++ b/tests/ldxi_u64.c @@ -12,20 +12,20 @@ int main(int argc, char *argv[]) EJIT_OPERAND_GPR(0, EJIT_TYPE(long)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(uint64_t), 1, operands); ejit_ldxi_u64(f, EJIT_GPR(0), EJIT_GPR(0), (uintptr_t)data); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, true, do_jit); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 0, long) - ) == (int64_t)data[0]); + assert(erfl1(f,EJIT_ARG(sizeof(int64_t) * 0, long)) + == (int64_t)data[0]); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 1, long) - ) == 0); + assert(erfl1(f, EJIT_ARG(sizeof(int64_t) * 1, long)) + == 0); - assert(erf1(f, EJIT_ARG(sizeof(int64_t) * 2, long) - ) == (int64_t)data[2]); + assert(erfl1(f, EJIT_ARG(sizeof(int64_t) * 2, long)) + == (int64_t)data[2]); ejit_destroy_func(f); } diff --git a/tests/ldxi_u8.c b/tests/ldxi_u8.c index 9e0b491..2979706 100644 --- a/tests/ldxi_u8.c +++ b/tests/ldxi_u8.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(long), do_jit); - assert(erf1(f, EJIT_ARG(0, long)) == 0xff); - assert(erf1(f, EJIT_ARG(1, long)) == 0); - assert(erf1(f, EJIT_ARG(2, long)) == 0x42); + assert(erfi1(f, EJIT_ARG(0, long)) == 0xff); + assert(erfi1(f, EJIT_ARG(1, long)) == 0); + assert(erfi1(f, EJIT_ARG(2, long)) == 0x42); ejit_destroy_func(f); } diff --git a/tests/ldxr_d.c b/tests/ldxr_d.c index 993952a..b5d332a 100644 --- a/tests/ldxr_d.c +++ b/tests/ldxr_d.c @@ -19,15 +19,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 1, false, do_jit); - assert(erff2(f, + assert(erfd2(f, EJIT_ARG(data, void *), EJIT_ARG(0 * sizeof(double), unsigned)) == data[0]); - assert(erff2(f, + assert(erfd2(f, EJIT_ARG(data, void *), EJIT_ARG(1 * sizeof(double), unsigned)) == data[1]); - assert(erff2(f, + assert(erfd2(f, EJIT_ARG(data, void *), EJIT_ARG(2 * sizeof(double), unsigned)) == data[2]); diff --git a/tests/ldxr_i32.c b/tests/ldxr_i32.c index 982e0a3..5f5783a 100644 --- a/tests/ldxr_i32.c +++ b/tests/ldxr_i32.c @@ -19,9 +19,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, false, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(0, unsigned)) == -1); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(4, unsigned)) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(0, unsigned)) == -1); + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(4, unsigned)) == 0); + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(8, unsigned)) == 0x42424242); ejit_destroy_func(f); diff --git a/tests/ldxr_i64.c b/tests/ldxr_i64.c index 71b56a4..9551fce 100644 --- a/tests/ldxr_i64.c +++ b/tests/ldxr_i64.c @@ -13,15 +13,15 @@ int main(int argc, char *argv[]) EJIT_OPERAND_GPR(1, EJIT_TYPE(unsigned)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 2, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 2, operands); ejit_ldxr_i64(f, EJIT_GPR(0), EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 2, 0, true, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(0, unsigned)) == -1); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(8, unsigned)) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfl2(f, EJIT_ARG(data, void *), EJIT_ARG(0, unsigned)) == -1); + assert(erfl2(f, EJIT_ARG(data, void *), EJIT_ARG(8, unsigned)) == 0); + assert(erfl2(f, EJIT_ARG(data, void *), EJIT_ARG(16, unsigned)) == (int64_t)data[2]); ejit_destroy_func(f); diff --git a/tests/ldxr_i8.c b/tests/ldxr_i8.c index a17c9de..43c443a 100644 --- a/tests/ldxr_i8.c +++ b/tests/ldxr_i8.c @@ -19,15 +19,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, false, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 0, unsigned) ) == -1); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 1, unsigned) ) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 2, unsigned) ) == 0x42); diff --git a/tests/ldxr_u16.c b/tests/ldxr_u16.c index e8f517f..430635a 100644 --- a/tests/ldxr_u16.c +++ b/tests/ldxr_u16.c @@ -19,10 +19,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, false, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(0, unsigned)) == 0xffff); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(2, unsigned)) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(2, unsigned)) == 0); + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(4, unsigned)) == 0x4242); ejit_destroy_func(f); diff --git a/tests/ldxr_u32.c b/tests/ldxr_u32.c index d4d9489..7a42307 100644 --- a/tests/ldxr_u32.c +++ b/tests/ldxr_u32.c @@ -17,12 +17,12 @@ int main(int argc, char *argv[]) ejit_ldxr_u32(f, EJIT_GPR(0), EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, false, do_jit); + ejit_select_compile_func(f, 2, 0, true, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), - EJIT_ARG(0, unsigned)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(data, void *), EJIT_ARG(4, unsigned)) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), + EJIT_ARG(0, unsigned)) == (long)0xffffffff); + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(4, unsigned)) == 0); + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(8, unsigned)) == 0x42424242); ejit_destroy_func(f); diff --git a/tests/ldxr_u8.c b/tests/ldxr_u8.c index 0601d2d..6a13cdd 100644 --- a/tests/ldxr_u8.c +++ b/tests/ldxr_u8.c @@ -19,15 +19,15 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, false, do_jit); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 0, unsigned) ) == 0xff); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 1, unsigned) ) == 0); - assert(erf2(f, EJIT_ARG(data, void *), + assert(erfi2(f, EJIT_ARG(data, void *), EJIT_ARG(sizeof(int8_t) * 2, unsigned) ) == 0x42); diff --git a/tests/ler64.c b/tests/ler64.c index 0287f84..11c4810 100644 --- a/tests/ler64.c +++ b/tests/ler64.c @@ -18,16 +18,19 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(1, int64_t)) == 1); - assert(ejit_run_func_2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0, int64_t)) == 0); + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(1, int64_t)) == 1); - assert(ejit_run_func_2(f, + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0, int64_t)) == 0); + + assert(erfl2(f, EJIT_ARG(0x0fffffffffffffff, int64_t), EJIT_ARG(0x0ffffffffffffff0, int64_t)) == 0); - assert(ejit_run_func_2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0x6fffffffffffffff, int64_t)) == 0); ejit_destroy_func(f); diff --git a/tests/ler_d.c b/tests/ler_d.c index 81dbda0..05b59b8 100644 --- a/tests/ler_d.c +++ b/tests/ler_d.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(double), do_jit); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(-1, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(-1, double)) == 1); ejit_destroy_func(f); } diff --git a/tests/ler_f.c b/tests/ler_f.c index 82bd664..e7fb9af 100644 --- a/tests/ler_f.c +++ b/tests/ler_f.c @@ -18,9 +18,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(float), do_jit); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 1); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(-1, float)) == 1); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 1); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG(-1, float)) == 1); ejit_destroy_func(f); } diff --git a/tests/lshi.c b/tests/lshi.c index 9685f46..d9e5192 100644 --- a/tests/lshi.c +++ b/tests/lshi.c @@ -12,12 +12,12 @@ int main(int argc, char *argv[]) struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 1, operands); - ejit_lshi(f, EJIT_GPR(0), EJIT_GPR(0), 31); + ejit_lshi(f, EJIT_GPR(0), EJIT_GPR(0), 4); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, false, do_jit); - assert(erf1(f, EJIT_ARG(-0x7f, long)) == (int64_t)0xffffffc080000000); + assert(erfi1(f, EJIT_ARG(-0x7f, long)) == (-0x7f) * (1 << 4)); ejit_destroy_func(f); } diff --git a/tests/lshr64.c b/tests/lshr64.c index 0d9b3ce..9dd5571 100644 --- a/tests/lshr64.c +++ b/tests/lshr64.c @@ -18,127 +18,127 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7f, int64_t), EJIT_ARG(1, int64_t)) == 0xfe); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7fff, int64_t), EJIT_ARG(2, int64_t)) == 0x1fffc); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x81, int64_t), EJIT_ARG(16, int64_t)) == 0x810000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xff, int64_t), EJIT_ARG(15, int64_t)) == 0x7f8000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t)) == 0x7fffffff); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(8, int64_t)) == 0xffffffff00); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(3, int64_t)) == 0x3fffffff8); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7f, int64_t), EJIT_ARG(31, int64_t)) == (int64_t)0xffffffc080000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7fff, int64_t), EJIT_ARG(30, int64_t)) == (int64_t)0xffffe00040000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7fffffff, int64_t), EJIT_ARG(29, int64_t)) == (int64_t)0xf000000020000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x80000001, int64_t), EJIT_ARG(28, int64_t)) == (int64_t)0x800000010000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x8001, int64_t), EJIT_ARG(17, int64_t)) == 0x100020000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x80000001, int64_t), EJIT_ARG(18, int64_t)) == (int64_t)0x2000000040000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0xffff, int64_t), EJIT_ARG(24, int64_t)) == (int64_t)0xffffff0001000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7f, int64_t), EJIT_ARG(33, int64_t)) == 0xfe00000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7ffff, int64_t), EJIT_ARG(34, int64_t)) == 0x1ffffc00000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(35, int64_t)) == (int64_t)0xfffffff800000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7f, int64_t), EJIT_ARG(63, int64_t)) == (int64_t)0x8000000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7fff, int64_t), EJIT_ARG(62, int64_t)) == 0x4000000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7fffffff, int64_t), EJIT_ARG(61, int64_t)) == 0x2000000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x80000001, int64_t), EJIT_ARG(60, int64_t)) == 0x1000000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x81, int64_t), EJIT_ARG(48, int64_t)) == 0x81000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x8001, int64_t), EJIT_ARG(49, int64_t)) == 0x2000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x80000001, int64_t), EJIT_ARG(40, int64_t)) == 0x10000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xff, int64_t), EJIT_ARG(47, int64_t)) == 0x7f800000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xffff0001, int64_t), EJIT_ARG(56, int64_t)) == 0x100000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(40, int64_t)) == (int64_t)0xffffff0000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x7fffffffff, int64_t), EJIT_ARG(33, int64_t)) == (int64_t)0xfffffffe00000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(-0x7fffffffff, int64_t), EJIT_ARG(63, int64_t)) == (int64_t)0x8000000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0x8000000001, int64_t), EJIT_ARG(48, int64_t)) == 0x1000000000000); - assert(erf2(f, + assert(erfl2(f, EJIT_ARG(0xffffffffff, int64_t), EJIT_ARG(47, int64_t)) == (int64_t)0xffff800000000000); diff --git a/tests/ltr.c b/tests/ltr.c index bc32d03..9f6259b 100644 --- a/tests/ltr.c +++ b/tests/ltr.c @@ -18,14 +18,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); + assert(erfi2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 0); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x0fffffffffffffff, long), EJIT_ARG(0x0ffffffffffffff0, long)) == 0); - assert(ejit_run_func_2(f, + assert(erfi2(f, EJIT_ARG(0x7fffffffffffffff, long), EJIT_ARG(0x6fffffffffffffff, long)) == 0); ejit_destroy_func(f); diff --git a/tests/ltr_d.c b/tests/ltr_d.c index 600b820..f7f8149 100644 --- a/tests/ltr_d.c +++ b/tests/ltr_d.c @@ -18,10 +18,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); - assert(erf2(f, EJIT_ARG(-1, double), EJIT_ARG(-1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 0); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(-1, double), EJIT_ARG(-1, double)) == 0); ejit_destroy_func(f); } diff --git a/tests/ltr_f.c b/tests/ltr_f.c index 94dd657..0f34a2e 100644 --- a/tests/ltr_f.c +++ b/tests/ltr_f.c @@ -18,10 +18,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); - assert(erf2(f, EJIT_ARG(-1, float), EJIT_ARG(-1, float)) == 0); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 0); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG(0, float)) == 1); + assert(erfi2(f, EJIT_ARG(-1, float), EJIT_ARG(-1, float)) == 0); ejit_destroy_func(f); } diff --git a/tests/movi.c b/tests/movi.c index c7df5ec..ba1d28a 100644 --- a/tests/movi.c +++ b/tests/movi.c @@ -11,6 +11,6 @@ int main(int argc, char *argv[]) ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, EJIT_USE64(int), do_jit); - assert(ejit_run_func(f, 0, NULL) == 0xa500a500); + assert(ejit_run_func_i(f, 0, NULL) == (long)0xa500a500); ejit_destroy_func(f); } diff --git a/tests/movi_d.c b/tests/movi_d.c index 0b8e4f6..7fa412d 100644 --- a/tests/movi_d.c +++ b/tests/movi_d.c @@ -11,6 +11,6 @@ int main(int argc, char *argv[]) ejit_retr_d(f, EJIT_FPR(0)); ejit_select_compile_func(f, 0, 1, EJIT_USE64(double), do_jit); - assert(ejit_run_func_f(f, 0, NULL) == 3.14159f); + assert(ejit_run_func_d(f, 0, NULL) == 3.14159f); ejit_destroy_func(f); } diff --git a/tests/movr.c b/tests/movr.c index 3672f25..cfaaa65 100644 --- a/tests/movr.c +++ b/tests/movr.c @@ -14,6 +14,6 @@ int main(int argc, char *argv[]) ejit_retr(f, EJIT_GPR(1)); ejit_select_compile_func(f, 2, 0, EJIT_USE64(int), do_jit); - assert(ejit_run_func_1(f, EJIT_ARG(42, int)) == 42); + assert(erfi1(f, EJIT_ARG(42, int)) == 42); ejit_destroy_func(f); } diff --git a/tests/movr_d.c b/tests/movr_d.c index 1911ccf..b02585a 100644 --- a/tests/movr_d.c +++ b/tests/movr_d.c @@ -14,6 +14,6 @@ int main(int argc, char *argv[]) ejit_retr_d(f, EJIT_FPR(1)); ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(ejit_run_func_f_1(f, EJIT_ARG(42., double)) == 42.); + assert(erfd1(f, EJIT_ARG(42., double)) == 42.); ejit_destroy_func(f); } diff --git a/tests/movr_f.c b/tests/movr_f.c index 890ec9d..1add5a6 100644 --- a/tests/movr_f.c +++ b/tests/movr_f.c @@ -14,6 +14,6 @@ int main(int argc, char *argv[]) ejit_retr_f(f, EJIT_FPR(1)); ejit_select_compile_func(f, 0, 2, EJIT_USE64(float), do_jit); - assert(ejit_run_func_f_1(f, EJIT_ARG(42., float)) == 42.); + assert(erff1(f, EJIT_ARG(42., float)) == 42.); ejit_destroy_func(f); } diff --git a/tests/mulr64.c b/tests/mulr64.c index e1474a6..7233206 100644 --- a/tests/mulr64.c +++ b/tests/mulr64.c @@ -17,108 +17,137 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t) - ) == 0x80000000); - - assert(erf2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffff, int64_t) - ) == 0xfffffffe); - - assert(erf2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t) - ) == 0); - - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t) - ) == 0x80000000); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(2, int64_t) - ) == 0xfffffffe); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t) - ) == 0); - - assert(erf2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x80000000, int64_t) - ) == 0x100000000); - - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == 0x7fffffffffffffff); - - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(2, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0xfffffffffffffffe); - - assert(erf2(f, EJIT_ARG(2, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == 0); - - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(2, int64_t) - ) == (int64_t)0x100000000); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0x80000000, int64_t) - ) == (int64_t)0x3fffffff80000000); - - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == (int64_t)0x3fffffff80000000); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == (int64_t)0x7ffffffe80000001); - - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == (int64_t)0x7ffffffe80000001); - - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == (int64_t)0xfffffffe00000001); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(1, int64_t) - ) == (int64_t)0x7fffffffffffffff); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(1, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(2, int64_t) - ) == (int64_t)0xfffffffffffffffe); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(2, int64_t) - ) == 0); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == (int64_t)0x8000000000000001); - - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0x8000000000000001); - - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 1); + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x80000000, int64_t)) == 0x80000000); + + assert(erfl2(f, + EJIT_ARG(2, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) == 0xfffffffe); + + assert(erfl2(f, + EJIT_ARG(0, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) == 0); + + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(1, int64_t)) == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(1, int64_t)) == 0x80000000); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(2, int64_t)) == 0xfffffffe); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0, int64_t)) == 0); + + assert(erfl2(f, + EJIT_ARG(2, int64_t), + EJIT_ARG(0x80000000, int64_t)) == 0x100000000); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == 0x7fffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(2, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0xfffffffffffffffe); + + assert(erfl2(f, + EJIT_ARG(2, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == 0); + + assert(erfl2(f, + EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(2, int64_t)) + == (int64_t)0x100000000); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0x80000000, int64_t)) + == (int64_t)0x3fffffff80000000); + + assert(erfl2(f, + EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == (int64_t)0x3fffffff80000000); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == (int64_t)0x7ffffffe80000001); + + assert(erfl2(f, + EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == (int64_t)0x7ffffffe80000001); + + assert(erfl2(f, + EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == (int64_t)0xfffffffe00000001); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(1, int64_t)) + == (int64_t)0x7fffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(1, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(2, int64_t)) + == (int64_t)0xfffffffffffffffe); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(2, int64_t)) + == 0); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == (int64_t)0x8000000000000001); + + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0x8000000000000001); + + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 1); ejit_destroy_func(f); } diff --git a/tests/mulr_d.c b/tests/mulr_d.c index 0002c6b..a7d2d93 100644 --- a/tests/mulr_d.c +++ b/tests/mulr_d.c @@ -17,10 +17,13 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erff2(f, EJIT_ARG(-0.5f, double), - EJIT_ARG(0.50f, double)) == -0.25f); - assert(erff2(f, EJIT_ARG(0.25f, double), - EJIT_ARG(0.75f, double)) == 0.1875f); + assert(erfd2(f, + EJIT_ARG(-0.5f, double), + EJIT_ARG(0.50f, double)) == -0.25f); + + assert(erfd2(f, + EJIT_ARG(0.25f, double), + EJIT_ARG(0.75f, double)) == 0.1875f); ejit_destroy_func(f); } diff --git a/tests/negr.c b/tests/negr.c index 84241e8..4528897 100644 --- a/tests/negr.c +++ b/tests/negr.c @@ -16,25 +16,24 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0, int64_t)) == 0); - assert(erf1(f, EJIT_ARG(1, int64_t)) == (int64_t)0xffffffffffffffff); - assert(erf1(f, - EJIT_ARG(0xffffffff, - int64_t)) == (int64_t)0xffffffff00000001); - assert(erf1(f, - EJIT_ARG(0x80000000, - int64_t)) == (int64_t)0xffffffff80000000); - assert(erf1(f, - EJIT_ARG(0x7fffffff, - int64_t)) == (int64_t)0xffffffff80000001); - assert(erf1(f, - EJIT_ARG(0x80000001, - int64_t)) == (int64_t)0xffffffff7fffffff); - assert(erf1(f, EJIT_ARG(0xffffffffffffffff, int64_t)) == 1); - assert(erf1(f, EJIT_ARG(0x8000000000000000, int64_t)) + assert(erfl1(f, EJIT_ARG(0, int64_t)) == 0); + assert(erfl1(f, EJIT_ARG(1, int64_t)) == (int64_t)0xffffffffffffffff); + assert(erfl1(f, EJIT_ARG(0xffffffff, int64_t)) + == (int64_t)0xffffffff00000001); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) + == (int64_t)0xffffffff80000000); + + assert(erfl1(f, EJIT_ARG(0x7fffffff, int64_t)) + == (int64_t)0xffffffff80000001); + + assert(erfl1(f, EJIT_ARG(0x80000001, int64_t)) + == (int64_t)0xffffffff7fffffff); + + assert(erfl1(f, EJIT_ARG(0xffffffffffffffff, int64_t)) == 1); + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) == (int64_t)0x8000000000000000); - assert(erf1(f, EJIT_ARG(0x7fffffffffffffff, int64_t)) + assert(erfl1(f, EJIT_ARG(0x7fffffffffffffff, int64_t)) == (int64_t)0x8000000000000001); ejit_destroy_func(f); diff --git a/tests/negr_d.c b/tests/negr_d.c index b57dcea..8f12301 100644 --- a/tests/negr_d.c +++ b/tests/negr_d.c @@ -16,10 +16,10 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 1, EJIT_USE64(double), do_jit); - assert(erff1(f, EJIT_ARG(0.0f, double)) == -0.0f); - assert(erff1(f, EJIT_ARG(0.5f, double)) == -0.5f); - assert(erff1(f, EJIT_ARG(1.0f / 0.0f, double)) == -1.0f / 0.0f); - assert(erff1(f, EJIT_ARG(-1.25f, double)) == 1.25f); + assert(erfd1(f, EJIT_ARG(0.0f, double)) == -0.0f); + assert(erfd1(f, EJIT_ARG(0.5f, double)) == -0.5f); + assert(erfd1(f, EJIT_ARG(1.0f / 0.0f, double)) == -1.0f / 0.0f); + assert(erfd1(f, EJIT_ARG(-1.25f, double)) == 1.25f); ejit_destroy_func(f); } diff --git a/tests/ner.c b/tests/ner.c index 9432a56..3aa8540 100644 --- a/tests/ner.c +++ b/tests/ner.c @@ -7,26 +7,26 @@ int main(int argc, char *argv[]) (void)argv; bool do_jit = argc > 1; struct ejit_operand operands[2] = { - EJIT_OPERAND_GPR(0, EJIT_TYPE(long)), - EJIT_OPERAND_GPR(1, EJIT_TYPE(long)) + EJIT_OPERAND_GPR(0, EJIT_TYPE(int64_t)), + EJIT_OPERAND_GPR(1, EJIT_TYPE(int64_t)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(long), 2, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 2, operands); ejit_ner(f, EJIT_GPR(0), EJIT_GPR(0), EJIT_GPR(1)); ejit_retr(f, EJIT_GPR(0)); - ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); + ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(1, long)) == 0); - assert(ejit_run_func_2(f, EJIT_ARG(1, long), EJIT_ARG(0, long)) == 1); + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(1, int64_t)) == 0); + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0, int64_t)) == 1); - assert(ejit_run_func_2(f, - EJIT_ARG(0x7fffffffffffffff, long), - EJIT_ARG(0x7ffffffffffffff0, long)) == 1); + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x7ffffffffffffff0, int64_t)) == 1); - assert(ejit_run_func_2(f, - EJIT_ARG(0x6fffffffffffffff, long), - EJIT_ARG(0x7fffffffffffffff, long)) == 1); + assert(erfl2(f, + EJIT_ARG(0x6fffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) == 1); ejit_destroy_func(f); } diff --git a/tests/ner_d.c b/tests/ner_d.c index 52a2f51..73ca2a9 100644 --- a/tests/ner_d.c +++ b/tests/ner_d.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); - assert(erf2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(1, double)) == 0); + assert(erfi2(f, EJIT_ARG(1, double), EJIT_ARG(0, double)) == 1); ejit_destroy_func(f); } diff --git a/tests/ner_f.c b/tests/ner_f.c index fb60120..222dfc3 100644 --- a/tests/ner_f.c +++ b/tests/ner_f.c @@ -18,8 +18,8 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 2, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); - assert(erf2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 1); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(1, float)) == 0); + assert(erfi2(f, EJIT_ARG(1, float), EJIT_ARG(0, float)) == 1); ejit_destroy_func(f); } diff --git a/tests/ori64.c b/tests/ori64.c index 5175338..6418802 100644 --- a/tests/ori64.c +++ b/tests/ori64.c @@ -16,13 +16,13 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0x7fffffff, int64_t)) == 0x7fffffff); - assert(erf1(f, EJIT_ARG(0x80000000, int64_t)) == 0x80000001); - assert(erf1(f, EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == 0x7fffffffffffffff); + assert(erfl1(f, EJIT_ARG(0x7fffffff, int64_t)) == 0x7fffffff); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) == 0x80000001); + assert(erfl1(f, EJIT_ARG(0x7fffffffffffffff, int64_t)) + == 0x7fffffffffffffff); - assert(erf1(f, EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0x8000000000000001); + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x8000000000000001); ejit_destroy_func(f); } diff --git a/tests/orr64.c b/tests/orr64.c index f0337a9..f3af9ed 100644 --- a/tests/orr64.c +++ b/tests/orr64.c @@ -17,70 +17,70 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0x80000001); - assert(erf2(f, EJIT_ARG(0, int64_t), + assert(erfl2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t)) == 0x80000001); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0x80000000, int64_t)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0xffffffff, int64_t)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0xffffffff, int64_t)) == 0xffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(1, int64_t)) == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(1, int64_t)) == (int64_t)0x8000000000000001); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == (int64_t)0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x8000000000000000, int64_t) ) == (int64_t)0x8000000000000001); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0x8000000000000000, int64_t) ) == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), EJIT_ARG(0xffffffffffffffff, int64_t) ) == (int64_t)0xffffffffffffffff); diff --git a/tests/remr64.c b/tests/remr64.c index d2e7dc4..f354328 100644 --- a/tests/remr64.c +++ b/tests/remr64.c @@ -16,87 +16,96 @@ int main(int argc, char *argv[]) ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x80000000, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(0, int64_t), + + assert(erfl2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(2, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(2, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0x80000000, int64_t) - ) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0x80000000, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0xffffffff, int64_t) ) == 0); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(0x7fffffff, int64_t) ) == 1); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0xffffffff, int64_t) ) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), EJIT_ARG(0x7fffffff, int64_t) ) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(2, int64_t), + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(2, int64_t), + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(2, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(2, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == 0x7fffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 0); + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 0); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 0); + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 0); ejit_destroy_func(f); } diff --git a/tests/remr_u64.c b/tests/remr_u64.c index 4f458eb..4bae226 100644 --- a/tests/remr_u64.c +++ b/tests/remr_u64.c @@ -17,80 +17,96 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(0, int64_t), + assert(erfl2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(1, int64_t), + + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x80000000, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffff, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x80000000, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(2, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), EJIT_ARG(2, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0x80000000, int64_t) - ) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0x80000000, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 1); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == 0x7fffffff); + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 1); - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == 0); + assert(erfl2(f, EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == 0); - assert(erf2(f, EJIT_ARG(1, int64_t), + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(1, int64_t), + + assert(erfl2(f, EJIT_ARG(1, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x7fffffffffffffff, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(2, int64_t), + + assert(erfl2(f, EJIT_ARG(2, int64_t), EJIT_ARG(0x8000000000000000, int64_t)) == 2); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(1, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), EJIT_ARG(2, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), + + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), EJIT_ARG(2, int64_t)) == 0); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == 0x7fffffffffffffff); + + assert(erfl2(f, EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 0x7fffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 0x7fffffffffffffff); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == 1); - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 0); + assert(erfl2(f, EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 0); ejit_destroy_func(f); diff --git a/tests/rshi64.c b/tests/rshi64.c index 6a5e20a..c549313 100644 --- a/tests/rshi64.c +++ b/tests/rshi64.c @@ -16,9 +16,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0x80000000, int64_t)) == 1); - assert(erf1(f, EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0xffffffff00000000); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) == 1); + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0xffffffff00000000); ejit_destroy_func(f); } diff --git a/tests/rshi_u64.c b/tests/rshi_u64.c index 8398417..43ba3ce 100644 --- a/tests/rshi_u64.c +++ b/tests/rshi_u64.c @@ -16,8 +16,9 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0x80000000, int64_t)) == 1); - assert(erf1(f, EJIT_ARG(0x8000000000000000, int64_t)) == 0x100000000); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) == 1); + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) + == 0x100000000); ejit_destroy_func(f); } diff --git a/tests/rshr64.c b/tests/rshr64.c index bb235ee..066e260 100644 --- a/tests/rshr64.c +++ b/tests/rshr64.c @@ -18,100 +18,125 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(0xfe, int64_t), EJIT_ARG(1, int64_t)) == 0x7f); - assert(erf2(f, EJIT_ARG(0x1fffc, int64_t), + assert(erfl2(f, EJIT_ARG(0xfe, int64_t), EJIT_ARG(1, int64_t)) == 0x7f); + assert(erfl2(f, EJIT_ARG(0x1fffc, int64_t), EJIT_ARG(2, int64_t)) == 0x7fff); - assert(erf2(f, EJIT_ARG(0x40000000, int64_t), - EJIT_ARG(30, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x20000000, int64_t), - EJIT_ARG(29, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x10000000, int64_t), - EJIT_ARG(28, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x810000, int64_t), - EJIT_ARG(16, int64_t)) == 0x81); - assert(erf2(f, EJIT_ARG(0x20000, int64_t), EJIT_ARG(17, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x40000, int64_t), EJIT_ARG(18, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x7f8000, int64_t), - EJIT_ARG(15, int64_t)) == 0xff); - assert(erf2(f, EJIT_ARG(0x1000000, int64_t), - EJIT_ARG(24, int64_t)) == 1); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(0x3fffffff8, int64_t), EJIT_ARG(3, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(0xffffff00, int64_t), EJIT_ARG(8, int64_t) - ) == 0xffffff); - - assert(erf2(f, EJIT_ARG(0xfe00000000, int64_t), EJIT_ARG(33, int64_t) - ) == 0x7f); - - assert(erf2(f, EJIT_ARG(0x1ffffc00000000, int64_t), - EJIT_ARG(34, int64_t) - ) == 0x7ffff); - - assert(erf2(f, EJIT_ARG(0xfffffff800000000, int64_t), - EJIT_ARG(29, int64_t) - ) == (int64_t)0xffffffffffffffc0); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(63, int64_t) - ) == (int64_t)0xffffffffffffffff); - assert(erf2(f, EJIT_ARG(0x4000000000000000, int64_t), - EJIT_ARG(62, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x2000000000000000, int64_t), - EJIT_ARG(61, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x1000000000000000, int64_t), - EJIT_ARG(60, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0xffffffc080000000, int64_t), - EJIT_ARG(31, int64_t) - ) == (int64_t)0xffffffffffffff81); - - assert(erf2(f, EJIT_ARG(0x81000000000000, int64_t), - EJIT_ARG(48, int64_t) - ) == 0x81); - - assert(erf2(f, EJIT_ARG(0x2000000000000, int64_t), EJIT_ARG(49, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x10000000000, int64_t), EJIT_ARG(40, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x7f800000000000, int64_t), - EJIT_ARG(47, int64_t) - ) == 0xff); + assert(erfl2(f, EJIT_ARG(0x40000000, int64_t), + EJIT_ARG(30, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x100000000000000, int64_t), - EJIT_ARG(56, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x20000000, int64_t), + EJIT_ARG(29, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0xffffff0000000000, int64_t), - EJIT_ARG(40, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x10000000, int64_t), + EJIT_ARG(28, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0xfffffffe00000000, int64_t), - EJIT_ARG(33, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x810000, int64_t), + EJIT_ARG(16, int64_t)) == 0x81); - assert(erf2(f, EJIT_ARG(0x8000000000000001, int64_t), - EJIT_ARG(63, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x20000, int64_t), EJIT_ARG(17, int64_t)) == 1); + assert(erfl2(f, EJIT_ARG(0x40000, int64_t), EJIT_ARG(18, int64_t)) == 1); + assert(erfl2(f, EJIT_ARG(0x7f8000, int64_t), + EJIT_ARG(15, int64_t)) == 0xff); - assert(erf2(f, EJIT_ARG(0x1000000000000, int64_t), EJIT_ARG(48, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x1000000, int64_t), + EJIT_ARG(24, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0xffff800000000000, int64_t), - EJIT_ARG(47, int64_t) - ) == (int64_t)0xffffffffffffffff); + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), EJIT_ARG(0, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, EJIT_ARG(0x3fffffff8, int64_t), EJIT_ARG(3, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, EJIT_ARG(0xffffff00, int64_t), EJIT_ARG(8, int64_t)) + == 0xffffff); + + assert(erfl2(f, EJIT_ARG(0xfe00000000, int64_t), EJIT_ARG(33, int64_t)) + == 0x7f); + + assert(erfl2(f, + EJIT_ARG(0x1ffffc00000000, int64_t), + EJIT_ARG(34, int64_t)) == 0x7ffff); + + assert(erfl2(f, + EJIT_ARG(0xfffffff800000000, int64_t), + EJIT_ARG(29, int64_t)) + == (int64_t)0xffffffffffffffc0); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(63, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x4000000000000000, int64_t), + EJIT_ARG(62, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x2000000000000000, int64_t), + EJIT_ARG(61, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x1000000000000000, int64_t), + EJIT_ARG(60, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0xffffffc080000000, int64_t), + EJIT_ARG(31, int64_t)) + == (int64_t)0xffffffffffffff81); + + assert(erfl2(f, + EJIT_ARG(0x81000000000000, int64_t), + EJIT_ARG(48, int64_t)) + == 0x81); + + assert(erfl2(f, + EJIT_ARG(0x2000000000000, int64_t), + EJIT_ARG(49, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x10000000000, int64_t), + EJIT_ARG(40, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x7f800000000000, int64_t), + EJIT_ARG(47, int64_t)) + == 0xff); + + assert(erfl2(f, + EJIT_ARG(0x100000000000000, int64_t), + EJIT_ARG(56, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0xffffff0000000000, int64_t), + EJIT_ARG(40, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0xfffffffe00000000, int64_t), + EJIT_ARG(33, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000001, int64_t), + EJIT_ARG(63, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x1000000000000, int64_t), + EJIT_ARG(48, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0xffff800000000000, int64_t), + EJIT_ARG(47, int64_t)) + == (int64_t)0xffffffffffffffff); ejit_destroy_func(f); } diff --git a/tests/rshr_u64.c b/tests/rshr_u64.c index d308358..c3e1e77 100644 --- a/tests/rshr_u64.c +++ b/tests/rshr_u64.c @@ -17,99 +17,133 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(0xfe, int64_t), EJIT_ARG(1, int64_t)) == 0x7f); - assert(erf2(f, EJIT_ARG(0x1fffc, int64_t), + assert(erfl2(f, EJIT_ARG(0xfe, int64_t), EJIT_ARG(1, int64_t)) == 0x7f); + assert(erfl2(f, EJIT_ARG(0x1fffc, int64_t), EJIT_ARG(2, int64_t)) == 0x7fff); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), - EJIT_ARG(31, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x40000000, int64_t), - EJIT_ARG(30, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x20000000, int64_t), - EJIT_ARG(29, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x10000000, int64_t), - EJIT_ARG(28, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x810000, int64_t), - EJIT_ARG(16, int64_t)) == 0x81); - assert(erf2(f, EJIT_ARG(0x20000, int64_t), EJIT_ARG(17, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x40000, int64_t), EJIT_ARG(18, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x7f8000, int64_t), - EJIT_ARG(15, int64_t)) == 0xff); - assert(erf2(f, EJIT_ARG(0x1000000, int64_t), - EJIT_ARG(24, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0xffffff00, int64_t), - EJIT_ARG(8, int64_t)) == 0xffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x3fffffff8, int64_t), EJIT_ARG(3, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(0xffffffc080000000, int64_t), - EJIT_ARG(31, int64_t) - ) == 0x1ffffff81); - - assert(erf2(f, EJIT_ARG(0xfe00000000, int64_t), EJIT_ARG(33, int64_t) - ) == 0x7f); - - assert(erf2(f, EJIT_ARG(0x1ffffc00000000, int64_t), - EJIT_ARG(34, int64_t) - ) == 0x7ffff); - - assert(erf2(f, EJIT_ARG(0xfffffff800000000, int64_t), - EJIT_ARG(29, int64_t) - ) == 0x7ffffffc0); - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(63, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x4000000000000000, int64_t), - EJIT_ARG(62, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x2000000000000000, int64_t), - EJIT_ARG(61, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x1000000000000000, int64_t), - EJIT_ARG(60, int64_t) - ) == 1); - - assert(erf2(f, EJIT_ARG(0x81000000000000, int64_t), - EJIT_ARG(48, int64_t) - ) == 0x81); + assert(erfl2(f, EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(31, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x2000000000000, int64_t), EJIT_ARG(49, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x40000000, int64_t), + EJIT_ARG(30, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x10000000000, int64_t), EJIT_ARG(40, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x20000000, int64_t), + EJIT_ARG(29, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x7f800000000000, int64_t), - EJIT_ARG(47, int64_t) - ) == 0xff); + assert(erfl2(f, EJIT_ARG(0x10000000, int64_t), + EJIT_ARG(28, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x100000000000000, int64_t), - EJIT_ARG(56, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x810000, int64_t), + EJIT_ARG(16, int64_t)) == 0x81); - assert(erf2(f, EJIT_ARG(0xffffff0000000000, int64_t), - EJIT_ARG(40, int64_t) - ) == 0xffffff); + assert(erfl2(f, EJIT_ARG(0x20000, int64_t), EJIT_ARG(17, int64_t)) == 1); + assert(erfl2(f, EJIT_ARG(0x40000, int64_t), EJIT_ARG(18, int64_t)) == 1); + assert(erfl2(f, EJIT_ARG(0x7f8000, int64_t), + EJIT_ARG(15, int64_t)) == 0xff); - assert(erf2(f, EJIT_ARG(0xfffffffe00000000, int64_t), - EJIT_ARG(33, int64_t) - ) == 0x7fffffff); + assert(erfl2(f, EJIT_ARG(0x1000000, int64_t), + EJIT_ARG(24, int64_t)) == 1); - assert(erf2(f, EJIT_ARG(0x8000000000000001, int64_t), - EJIT_ARG(63, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0xffffff00, int64_t), + EJIT_ARG(8, int64_t)) == 0xffffff); - assert(erf2(f, EJIT_ARG(0x1000000000000, int64_t), EJIT_ARG(48, int64_t) - ) == 1); + assert(erfl2(f, EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0xffff800000000000, int64_t), - EJIT_ARG(47, int64_t) - ) == 0x1ffff); + assert(erfl2(f, + EJIT_ARG(0x3fffffff8, int64_t), + EJIT_ARG(3, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(0xffffffc080000000, int64_t), + EJIT_ARG(31, int64_t)) + == 0x1ffffff81); + + assert(erfl2(f, + EJIT_ARG(0xfe00000000, int64_t), + EJIT_ARG(33, int64_t)) + == 0x7f); + + assert(erfl2(f, + EJIT_ARG(0x1ffffc00000000, int64_t), + EJIT_ARG(34, int64_t)) + == 0x7ffff); + + assert(erfl2(f, + EJIT_ARG(0xfffffff800000000, int64_t), + EJIT_ARG(29, int64_t)) + == 0x7ffffffc0); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(63, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x4000000000000000, int64_t), + EJIT_ARG(62, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x2000000000000000, int64_t), + EJIT_ARG(61, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x1000000000000000, int64_t), + EJIT_ARG(60, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x81000000000000, int64_t), + EJIT_ARG(48, int64_t)) + == 0x81); + + assert(erfl2(f, + EJIT_ARG(0x2000000000000, int64_t), + EJIT_ARG(49, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x10000000000, int64_t), + EJIT_ARG(40, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x7f800000000000, int64_t), + EJIT_ARG(47, int64_t)) + == 0xff); + + assert(erfl2(f, + EJIT_ARG(0x100000000000000, int64_t), + EJIT_ARG(56, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0xffffff0000000000, int64_t), + EJIT_ARG(40, int64_t)) + == 0xffffff); + + assert(erfl2(f, + EJIT_ARG(0xfffffffe00000000, int64_t), + EJIT_ARG(33, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000001, int64_t), + EJIT_ARG(63, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0x1000000000000, int64_t), + EJIT_ARG(48, int64_t)) + == 1); + + assert(erfl2(f, + EJIT_ARG(0xffff800000000000, int64_t), + EJIT_ARG(47, int64_t)) + == 0x1ffff); ejit_destroy_func(f); } diff --git a/tests/sti_16.c b/tests/sti_16.c index 16a40d7..da78a01 100644 --- a/tests/sti_16.c +++ b/tests/sti_16.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x1212); assert(data[1] == 0x00); assert(data[2] == 0x3434); - erf1(f, EJIT_ARG(-1, int16_t)); + erfi1(f, EJIT_ARG(-1, int16_t)); assert(data[0] == 0x1212); assert(data[1] == 0xffff); assert(data[2] == 0x3434); diff --git a/tests/sti_32.c b/tests/sti_32.c index b748025..667bfd7 100644 --- a/tests/sti_32.c +++ b/tests/sti_32.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x12121212); assert(data[1] == 0x00); assert(data[2] == 0x34343434); - erf1(f, EJIT_ARG(-1, int32_t)); + erfi1(f, EJIT_ARG(-1, int32_t)); assert(data[0] == 0x12121212); assert(data[1] == 0xffffffff); assert(data[2] == 0x34343434); diff --git a/tests/sti_64.c b/tests/sti_64.c index 81d5c3f..6bb53f8 100644 --- a/tests/sti_64.c +++ b/tests/sti_64.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x1212121212121212); assert(data[1] == 0x00); assert(data[2] == 0x3434343434343434); - erf1(f, EJIT_ARG(-1, int64_t)); + erfi1(f, EJIT_ARG(-1, int64_t)); assert(data[0] == 0x1212121212121212); assert(data[1] == 0xffffffffffffffff); assert(data[2] == 0x3434343434343434); diff --git a/tests/sti_8.c b/tests/sti_8.c index d59ccec..d6459a3 100644 --- a/tests/sti_8.c +++ b/tests/sti_8.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x12); assert(data[1] == 0x00); assert(data[2] == 0x34); - erf1(f, EJIT_ARG(-1, int8_t)); + erfi1(f, EJIT_ARG(-1, int8_t)); assert(data[0] == 0x12); assert(data[1] == 0xff); assert(data[2] == 0x34); diff --git a/tests/sti_d.c b/tests/sti_d.c index 637fc80..1701b70 100644 --- a/tests/sti_d.c +++ b/tests/sti_d.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == -1.0); assert(data[1] == 0.0); assert(data[2] == 0.5); - erf1(f, EJIT_ARG(42.5, double)); + erfi1(f, EJIT_ARG(42.5, double)); assert(data[0] == -1.0); assert(data[1] == 42.5); assert(data[2] == 0.5); diff --git a/tests/sti_f.c b/tests/sti_f.c index dede763..9122a71 100644 --- a/tests/sti_f.c +++ b/tests/sti_f.c @@ -21,7 +21,7 @@ int main(int argc, char *argv[]) assert(data[0] == -1.0); assert(data[1] == 0.0); assert(data[2] == 0.5); - erf1(f, EJIT_ARG(42.5, float)); + erfi1(f, EJIT_ARG(42.5, float)); assert(data[0] == -1.0); assert(data[1] == 42.5); assert(data[2] == 0.5); diff --git a/tests/stxi_16.c b/tests/stxi_16.c index 9f98137..d836bbe 100644 --- a/tests/stxi_16.c +++ b/tests/stxi_16.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x1212); assert(data[1] == 0); assert(data[2] == 0x3434); - erf2(f, EJIT_ARG(sizeof(int16_t), int), EJIT_ARG(-1, int16_t)); + erfi2(f, EJIT_ARG(sizeof(int16_t), int), EJIT_ARG(-1, int16_t)); assert(data[0] == 0x1212); assert(data[1] == 0xffff); assert(data[2] == 0x3434); diff --git a/tests/stxi_32.c b/tests/stxi_32.c index 3f3b8f4..ef02583 100644 --- a/tests/stxi_32.c +++ b/tests/stxi_32.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x12121212); assert(data[1] == 0x00); assert(data[2] == 0x34343434); - erf2(f, EJIT_ARG(sizeof(int32_t), int), EJIT_ARG(-1, int32_t)); + erfi2(f, EJIT_ARG(sizeof(int32_t), int), EJIT_ARG(-1, int32_t)); assert(data[0] == 0x12121212); assert(data[1] == 0xffffffff); assert(data[2] == 0x34343434); diff --git a/tests/stxi_64.c b/tests/stxi_64.c index f371aa8..226b40b 100644 --- a/tests/stxi_64.c +++ b/tests/stxi_64.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x1212121212121212); assert(data[1] == 0x00); assert(data[2] == 0x3434343434343434); - erf2(f, EJIT_ARG(sizeof(int64_t), int), EJIT_ARG(-1, int64_t)); + erfi2(f, EJIT_ARG(sizeof(int64_t), int), EJIT_ARG(-1, int64_t)); assert(data[0] == 0x1212121212121212); assert(data[1] == 0xffffffffffffffff); assert(data[2] == 0x3434343434343434); diff --git a/tests/stxi_8.c b/tests/stxi_8.c index 59ec4c7..4a461f7 100644 --- a/tests/stxi_8.c +++ b/tests/stxi_8.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == 0x12); assert(data[1] == 0x00); assert(data[2] == 0x34); - erf2(f, EJIT_ARG(sizeof(int8_t), int), EJIT_ARG(-1, int8_t)); + erfi2(f, EJIT_ARG(sizeof(int8_t), int), EJIT_ARG(-1, int8_t)); assert(data[0] == 0x12); assert(data[1] == 0xff); assert(data[2] == 0x34); diff --git a/tests/stxi_d.c b/tests/stxi_d.c index 128dbb7..48e7b91 100644 --- a/tests/stxi_d.c +++ b/tests/stxi_d.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == -1.0f); assert(data[1] == 0.0f); assert(data[2] == 0.5f); - erf2(f, EJIT_ARG(sizeof(double), int), EJIT_ARG(42.5, double)); + erfi2(f, EJIT_ARG(sizeof(double), int), EJIT_ARG(42.5, double)); assert(data[0] == -1.0f); assert(data[1] == 42.5); assert(data[2] == 0.5f); diff --git a/tests/stxi_f.c b/tests/stxi_f.c index 4c218ed..1d371d1 100644 --- a/tests/stxi_f.c +++ b/tests/stxi_f.c @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) assert(data[0] == -1.0); assert(data[1] == 0.0); assert(data[2] == 0.5); - erf2(f, EJIT_ARG(sizeof(float), int), EJIT_ARG(42.5, float)); + erfi2(f, EJIT_ARG(sizeof(float), int), EJIT_ARG(42.5, float)); assert(data[0] == -1.0); assert(data[1] == 42.5); assert(data[2] == 0.5); diff --git a/tests/stxr_16.c b/tests/stxr_16.c index 901f084..e7365af 100644 --- a/tests/stxr_16.c +++ b/tests/stxr_16.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(int16_t), int), EJIT_ARG(-1, int16_t) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == 0x1212); assert(data[1] == 0xffff); assert(data[2] == 0x3434); diff --git a/tests/stxr_32.c b/tests/stxr_32.c index c6cde83..28d8b67 100644 --- a/tests/stxr_32.c +++ b/tests/stxr_32.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(int32_t), int), EJIT_ARG(-1, int32_t) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == 0x12121212); assert(data[1] == 0xffffffff); assert(data[2] == 0x34343434); diff --git a/tests/stxr_64.c b/tests/stxr_64.c index d4e2035..b4da373 100644 --- a/tests/stxr_64.c +++ b/tests/stxr_64.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(int64_t), int), EJIT_ARG(-1, int64_t) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == 0x1212121212121212); assert(data[1] == 0xffffffffffffffff); assert(data[2] == 0x3434343434343434); diff --git a/tests/stxr_8.c b/tests/stxr_8.c index da40eee..6e2e557 100644 --- a/tests/stxr_8.c +++ b/tests/stxr_8.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(int8_t), int), EJIT_ARG(-1, int8_t) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == 0x12); assert(data[1] == 0xff); assert(data[2] == 0x34); diff --git a/tests/stxr_d.c b/tests/stxr_d.c index 7a07332..288b1e9 100644 --- a/tests/stxr_d.c +++ b/tests/stxr_d.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(double), int), EJIT_ARG(42.5, double) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == -1.0); assert(data[1] == 42.5); assert(data[2] == 0.5); diff --git a/tests/stxr_f.c b/tests/stxr_f.c index 3e68060..c165563 100644 --- a/tests/stxr_f.c +++ b/tests/stxr_f.c @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) EJIT_ARG(sizeof(float), int), EJIT_ARG(42.5, float) }; - ejit_run_func(f, 3, args); + ejit_run_func_i(f, 3, args); assert(data[0] == -1.0); assert(data[1] == 42.5); assert(data[2] == 0.5); diff --git a/tests/subr.c b/tests/subr.c index 57f5459..f45dbf6 100644 --- a/tests/subr.c +++ b/tests/subr.c @@ -17,7 +17,7 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(long), do_jit); - assert(erf2(f, EJIT_ARG(42, long), EJIT_ARG(69, long)) == -27); + assert(erfi2(f, EJIT_ARG(42, long), EJIT_ARG(69, long)) == -27); ejit_destroy_func(f); } diff --git a/tests/subr_d.c b/tests/subr_d.c index ef2c431..ef8e659 100644 --- a/tests/subr_d.c +++ b/tests/subr_d.c @@ -17,11 +17,13 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 0, 2, EJIT_USE64(double), do_jit); - assert(erff2(f, EJIT_ARG(42., double), EJIT_ARG(69., double) - ) == -27.); + assert(erfd2(f, + EJIT_ARG(42., double), + EJIT_ARG(69., double)) == -27.); - assert(erff2(f, EJIT_ARG(42.5, double), EJIT_ARG(69., double) - ) == -26.5); + assert(erfd2(f, + EJIT_ARG(42.5, double), + EJIT_ARG(69., double)) == -26.5); ejit_destroy_func(f); } diff --git a/tests/truncr_d_32.c b/tests/truncr_d_32.c index d028319..bc4c8fc 100644 --- a/tests/truncr_d_32.c +++ b/tests/truncr_d_32.c @@ -16,14 +16,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, EJIT_TYPE(int32_t), do_jit); - assert(erf1(f, EJIT_ARG(0.0, double)) == 0); - assert(erf1(f, EJIT_ARG(-0.0, double)) == 0); - assert(erf1(f, EJIT_ARG(0.5, double)) == 0); - assert(erf1(f, EJIT_ARG(-0.5, double)) == 0); - assert(erf1(f, EJIT_ARG(1.5, double)) == 1); - assert(erf1(f, EJIT_ARG(-1.5, double)) == -1); - assert(erf1(f, EJIT_ARG(2.5, double)) == 2); - assert(erf1(f, EJIT_ARG(-2.5, double)) == -2); + assert(erfi1(f, EJIT_ARG(0.0, double)) == 0); + assert(erfi1(f, EJIT_ARG(-0.0, double)) == 0); + assert(erfi1(f, EJIT_ARG(0.5, double)) == 0); + assert(erfi1(f, EJIT_ARG(-0.5, double)) == 0); + assert(erfi1(f, EJIT_ARG(1.5, double)) == 1); + assert(erfi1(f, EJIT_ARG(-1.5, double)) == -1); + assert(erfi1(f, EJIT_ARG(2.5, double)) == 2); + assert(erfi1(f, EJIT_ARG(-2.5, double)) == -2); ejit_destroy_func(f); } diff --git a/tests/truncr_d_64.c b/tests/truncr_d_64.c index d75aba5..8c688e1 100644 --- a/tests/truncr_d_64.c +++ b/tests/truncr_d_64.c @@ -16,14 +16,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, EJIT_TYPE(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0.0, double)) == 0); - assert(erf1(f, EJIT_ARG(-0.0, double)) == 0); - assert(erf1(f, EJIT_ARG(0.5, double)) == 0); - assert(erf1(f, EJIT_ARG(-0.5, double)) == 0); - assert(erf1(f, EJIT_ARG(1.5, double)) == 1); - assert(erf1(f, EJIT_ARG(-1.5, double)) == -1); - assert(erf1(f, EJIT_ARG(2.5, double)) == 2); - assert(erf1(f, EJIT_ARG(-2.5, double)) == -2); + assert(erfl1(f, EJIT_ARG(0.0, double)) == 0); + assert(erfl1(f, EJIT_ARG(-0.0, double)) == 0); + assert(erfl1(f, EJIT_ARG(0.5, double)) == 0); + assert(erfl1(f, EJIT_ARG(-0.5, double)) == 0); + assert(erfl1(f, EJIT_ARG(1.5, double)) == 1); + assert(erfl1(f, EJIT_ARG(-1.5, double)) == -1); + assert(erfl1(f, EJIT_ARG(2.5, double)) == 2); + assert(erfl1(f, EJIT_ARG(-2.5, double)) == -2); ejit_destroy_func(f); } diff --git a/tests/truncr_f_32.c b/tests/truncr_f_32.c index 1de700f..70061b8 100644 --- a/tests/truncr_f_32.c +++ b/tests/truncr_f_32.c @@ -16,14 +16,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, EJIT_TYPE(int32_t), do_jit); - assert(erf1(f, EJIT_ARG(0.0, float)) == 0); - assert(erf1(f, EJIT_ARG(-0.0, float)) == 0); - assert(erf1(f, EJIT_ARG(0.5, float)) == 0); - assert(erf1(f, EJIT_ARG(-0.5, float)) == 0); - assert(erf1(f, EJIT_ARG(1.5, float)) == 1); - assert(erf1(f, EJIT_ARG(-1.5, float)) == -1); - assert(erf1(f, EJIT_ARG(2.5, float)) == 2); - assert(erf1(f, EJIT_ARG(-2.5, float)) == -2); + assert(erfi1(f, EJIT_ARG(0.0, float)) == 0); + assert(erfi1(f, EJIT_ARG(-0.0, float)) == 0); + assert(erfi1(f, EJIT_ARG(0.5, float)) == 0); + assert(erfi1(f, EJIT_ARG(-0.5, float)) == 0); + assert(erfi1(f, EJIT_ARG(1.5, float)) == 1); + assert(erfi1(f, EJIT_ARG(-1.5, float)) == -1); + assert(erfi1(f, EJIT_ARG(2.5, float)) == 2); + assert(erfi1(f, EJIT_ARG(-2.5, float)) == -2); ejit_destroy_func(f); } diff --git a/tests/truncr_f_64.c b/tests/truncr_f_64.c index 994bb16..a309ed3 100644 --- a/tests/truncr_f_64.c +++ b/tests/truncr_f_64.c @@ -16,14 +16,14 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 1, 1, EJIT_TYPE(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0.0, float)) == 0); - assert(erf1(f, EJIT_ARG(-0.0, float)) == 0); - assert(erf1(f, EJIT_ARG(0.5, float)) == 0); - assert(erf1(f, EJIT_ARG(-0.5, float)) == 0); - assert(erf1(f, EJIT_ARG(1.5, float)) == 1); - assert(erf1(f, EJIT_ARG(-1.5, float)) == -1); - assert(erf1(f, EJIT_ARG(2.5, float)) == 2); - assert(erf1(f, EJIT_ARG(-2.5, float)) == -2); + assert(erfl1(f, EJIT_ARG(0.0, float)) == 0); + assert(erfl1(f, EJIT_ARG(-0.0, float)) == 0); + assert(erfl1(f, EJIT_ARG(0.5, float)) == 0); + assert(erfl1(f, EJIT_ARG(-0.5, float)) == 0); + assert(erfl1(f, EJIT_ARG(1.5, float)) == 1); + assert(erfl1(f, EJIT_ARG(-1.5, float)) == -1); + assert(erfl1(f, EJIT_ARG(2.5, float)) == 2); + assert(erfl1(f, EJIT_ARG(-2.5, float)) == -2); ejit_destroy_func(f); } diff --git a/tests/xori64.c b/tests/xori64.c index e7fe810..4535f33 100644 --- a/tests/xori64.c +++ b/tests/xori64.c @@ -9,20 +9,20 @@ int main(int argc, char *argv[]) struct ejit_operand operands[1] = { EJIT_OPERAND_GPR(0, EJIT_TYPE(int64_t)) }; - struct ejit_func *f = ejit_create_func(EJIT_TYPE(int), 1, operands); + struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 1, operands); ejit_xori(f, EJIT_GPR(0), EJIT_GPR(0), 1); ejit_retr(f, EJIT_GPR(0)); ejit_select_compile_func(f, 1, 0, EJIT_USE64(int64_t), do_jit); - assert(erf1(f, EJIT_ARG(0x7fffffff, int64_t)) == 0x7ffffffe); - assert(erf1(f, EJIT_ARG(0x80000000, int64_t)) == 0x80000001); - assert(erf1(f, - EJIT_ARG(0x7fffffffffffffff, - int64_t)) == 0x7ffffffffffffffe); - assert(erf1(f, EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0x8000000000000001); + assert(erfl1(f, EJIT_ARG(0x7fffffff, int64_t)) == 0x7ffffffe); + assert(erfl1(f, EJIT_ARG(0x80000000, int64_t)) == 0x80000001); + assert(erfl1(f, EJIT_ARG(0x7fffffffffffffff, int64_t)) + == 0x7ffffffffffffffe); + + assert(erfl1(f, EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x8000000000000001); ejit_destroy_func(f); } diff --git a/tests/xorr64.c b/tests/xorr64.c index 11ab249..59a317c 100644 --- a/tests/xorr64.c +++ b/tests/xorr64.c @@ -17,75 +17,105 @@ int main(int argc, char *argv[]) ejit_select_compile_func(f, 2, 0, EJIT_USE64(int64_t), do_jit); - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x7fffffff, int64_t)) == 0x7ffffffe); - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x80000000, int64_t)) == 0x80000001); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(1, int64_t)) == 0x7ffffffe); - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), - EJIT_ARG(1, int64_t)) == 0x80000001); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0, int64_t)) == 0x7fffffff); - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0x80000000, int64_t) - ) == 0xffffffff); - - assert(erf2(f, EJIT_ARG(0x80000000, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == 0xffffffff); - - assert(erf2(f, EJIT_ARG(0x7fffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == 0x80000000); - - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0x7fffffff, int64_t) - ) == 0x80000000); - - assert(erf2(f, EJIT_ARG(0xffffffff, int64_t), - EJIT_ARG(0xffffffff, int64_t) - ) == 0); - - assert(erf2(f, EJIT_ARG(0, int64_t), EJIT_ARG(0x7fffffff, int64_t) - ) == 0x7fffffff); - - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == 0x7ffffffffffffffe); - - assert(erf2(f, EJIT_ARG(1, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0x8000000000000001); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(1, int64_t) - ) == (int64_t)0x8000000000000001); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(1, int64_t) - ) == (int64_t)0x7ffffffffffffffe); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0x8000000000000000, int64_t) - ) == (int64_t)0xffffffffffffffff); - - assert(erf2(f, EJIT_ARG(0x8000000000000000, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0xffffffffffffffff); - - assert(erf2(f, EJIT_ARG(0x7fffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0x7fffffffffffffff, int64_t) - ) == (int64_t)0x8000000000000000); - - assert(erf2(f, EJIT_ARG(0xffffffffffffffff, int64_t), - EJIT_ARG(0xffffffffffffffff, int64_t) - ) == 0); - + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 0x7ffffffe); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x80000000, int64_t)) + == 0x80000001); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(1, int64_t)) + == 0x7ffffffe); + + assert(erfl2(f, + EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(1, int64_t)) + == 0x80000001); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0x80000000, int64_t)) + == 0xffffffff); + + assert(erfl2(f, + EJIT_ARG(0x80000000, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 0xffffffff); + + assert(erfl2(f, + EJIT_ARG(0x7fffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == 0x80000000); + + assert(erfl2(f, + EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 0x80000000); + + assert(erfl2(f, + EJIT_ARG(0xffffffff, int64_t), + EJIT_ARG(0xffffffff, int64_t)) + == 0); + + assert(erfl2(f, + EJIT_ARG(0, int64_t), + EJIT_ARG(0x7fffffff, int64_t)) + == 0x7fffffff); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == 0x7ffffffffffffffe); + + assert(erfl2(f, + EJIT_ARG(1, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0x8000000000000001); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(1, int64_t)) + == (int64_t)0x8000000000000001); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(1, int64_t)) + == (int64_t)0x7ffffffffffffffe); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0x8000000000000000, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x8000000000000000, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0xffffffffffffffff); + + assert(erfl2(f, + EJIT_ARG(0x7fffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0x7fffffffffffffff, int64_t)) + == (int64_t)0x8000000000000000); + + assert(erfl2(f, + EJIT_ARG(0xffffffffffffffff, int64_t), + EJIT_ARG(0xffffffffffffffff, int64_t)) + == 0); ejit_destroy_func(f); } |