#include #include #include "do_jit.h" int main() { struct ejit_operand operands[1] = { EJIT_OPERAND_GPR(0, EJIT_TYPE(int64_t)) }; struct ejit_func *f = ejit_create_func(EJIT_TYPE(int64_t), 1, operands); ejit_rshi_u(f, EJIT_GPR(0), EJIT_GPR(0), 31); ejit_retr(f, EJIT_GPR(0)); 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); ejit_destroy_func(f); }