void _jit_retr_f(jit_state_t *_jit, jit_int32_t u) { if (JIT_FRET != u) jit_movr_f(JIT_FRET, u); else jit_live(JIT_FRET); jit_ret(); }
/* Generate a function that computes and returns the sum of its two double arguments (return an int) i.e., double foo(double x,double y) { return x + y;} */ floatFunc makeFloatFunc () { floatFunc retVal; int dbl1, dbl2; retVal = (floatFunc) jit_get_ip ().iptr; jit_prolog (2); dbl1 = jit_arg_f (); dbl2 = jit_arg_f (); jit_getarg_f (JIT_FPR0, dbl1); jit_getarg_f (JIT_FPR1, dbl2); jit_addr_f (JIT_FPR0, JIT_FPR0, JIT_FPR1); jit_movr_f (JIT_FPRET, JIT_FPR0); jit_ret (); jit_flush_code ((char *) retVal, jit_get_ip ().ptr); #ifdef LIGHTNING_DISASSEMBLE disassemble (stderr, (char *) retVal, jit_get_ip ().ptr); #endif return retVal; }
void _jit_retval_f(jit_state_t *_jit, jit_int32_t r0) { if (r0 != JIT_FRET) jit_movr_f(r0, JIT_FRET); }