X-Git-Url: http://nitlanguage.org diff --git a/c_src/math._sep.c b/c_src/math._sep.c index ef2d180..e7482f7 100644 --- a/c_src/math._sep.c +++ b/c_src/math._sep.c @@ -1,100 +1,266 @@ /* This C file is generated by NIT to compile module math. */ #include "math._sep.h" -val_t math___Int___rand(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Int___rand, 19}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return TAG_Int(kernel_Int_Int_rand_0(UNTAG_Int( self))); -} -val_t math___Float___sqrt(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___sqrt, 23}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_sqrt_0(UNBOX_Float( self))); -} -val_t math___Float___cos(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___cos, 24}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_cos_0(UNBOX_Float( self))); -} -val_t math___Float___sin(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___sin, 25}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_sin_0(UNBOX_Float( self))); -} -val_t math___Float___tan(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___tan, 26}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_tan_0(UNBOX_Float( self))); -} -val_t math___Float___acos(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___acos, 27}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_acos_0(UNBOX_Float( self))); -} -val_t math___Float___asin(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___asin, 28}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_asin_0(UNBOX_Float( self))); -} -val_t math___Float___atan(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___atan, 29}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_atan_0(UNBOX_Float( self))); -} -val_t math___Float___pow(val_t self, val_t param0) { - struct trace_t trace = {NULL, LOCATE_math___Float___pow, 31}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_pow_1(UNBOX_Float( self), UNBOX_Float( param0))); -} -val_t math___Float___log(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___log, 32}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_log_0(UNBOX_Float( self))); -} -val_t math___Float___exp(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___exp, 33}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_exp_0(UNBOX_Float( self))); -} -val_t math___Float___rand(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Float___rand, 35}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Float_Float_rand_0(UNBOX_Float( self))); -} -val_t math___Object___atan2(val_t self, val_t param0, val_t param1) { - struct trace_t trace = {NULL, LOCATE_math___Object___atan2, 38}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Any_Any_atan2_2( self, UNBOX_Float( param0), UNBOX_Float( param1))); -} -val_t math___Object___pi(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Object___pi, 39}; - trace.prev = tracehead; tracehead = &trace; - tracehead = trace.prev; - return BOX_Float(kernel_Any_Any_pi_0( self)); -} -void math___Object___srand_from(val_t self, val_t param0) { - struct trace_t trace = {NULL, LOCATE_math___Object___srand_from, 40}; - trace.prev = tracehead; tracehead = &trace; - kernel_Any_Any_srand_from_1( self, UNTAG_Int( param0)); - tracehead = trace.prev; +val_t math___Int___rand(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 19; + fra.me.meth = LOCATE_math___Int___rand; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + REGB0 = p0; + /* ./../lib/standard//math.nit:19 */ + REGB0 = TAG_Int(kernel_Int_Int_rand_0(UNTAG_Int(REGB0))); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t math___Float___sqrt(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 23; + fra.me.meth = LOCATE_math___Float___sqrt; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:23 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_sqrt_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___cos(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 24; + fra.me.meth = LOCATE_math___Float___cos; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:24 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_cos_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___sin(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 25; + fra.me.meth = LOCATE_math___Float___sin; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:25 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_sin_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___tan(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 26; + fra.me.meth = LOCATE_math___Float___tan; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:26 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_tan_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___acos(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 27; + fra.me.meth = LOCATE_math___Float___acos; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:27 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_acos_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___asin(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 28; + fra.me.meth = LOCATE_math___Float___asin; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:28 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_asin_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___atan(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 29; + fra.me.meth = LOCATE_math___Float___atan; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:29 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_atan_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___pow(val_t p0, val_t p1){ + struct {struct stack_frame_t me; val_t MORE_REG[1];} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 31; + fra.me.meth = LOCATE_math___Float___pow; + fra.me.has_broke = 0; + fra.me.REG_size = 2; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + /* ./../lib/standard//math.nit:31 */ + fra.me.REG[1] = BOX_Float(kernel_Float_Float_pow_1(UNBOX_Float(fra.me.REG[0]), UNBOX_Float(fra.me.REG[1]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[1]; +} +val_t math___Float___log(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 32; + fra.me.meth = LOCATE_math___Float___log; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:32 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_log_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___exp(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 33; + fra.me.meth = LOCATE_math___Float___exp; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:33 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_exp_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Float___rand(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 35; + fra.me.meth = LOCATE_math___Float___rand; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:35 */ + fra.me.REG[0] = BOX_Float(kernel_Float_Float_rand_0(UNBOX_Float(fra.me.REG[0]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +val_t math___Object___atan2(val_t p0, val_t p1, val_t p2){ + struct {struct stack_frame_t me; val_t MORE_REG[2];} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 38; + fra.me.meth = LOCATE_math___Object___atan2; + fra.me.has_broke = 0; + fra.me.REG_size = 3; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[1] = NIT_NULL; + fra.me.REG[2] = NIT_NULL; + fra.me.REG[0] = p0; + fra.me.REG[1] = p1; + fra.me.REG[2] = p2; + /* ./../lib/standard//math.nit:38 */ + fra.me.REG[2] = BOX_Float(kernel_Any_Any_atan2_2(fra.me.REG[0], UNBOX_Float(fra.me.REG[1]), UNBOX_Float(fra.me.REG[2]))); + stack_frame_head = fra.me.prev; + return fra.me.REG[2]; +} +val_t math___Object___pi(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 39; + fra.me.meth = LOCATE_math___Object___pi; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:39 */ + fra.me.REG[0] = BOX_Float(kernel_Any_Any_pi_0(fra.me.REG[0])); + stack_frame_head = fra.me.prev; + return fra.me.REG[0]; +} +void math___Object___srand_from(val_t p0, val_t p1){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 40; + fra.me.meth = LOCATE_math___Object___srand_from; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + REGB0 = p1; + /* ./../lib/standard//math.nit:40 */ + kernel_Any_Any_srand_from_1(fra.me.REG[0], UNTAG_Int(REGB0)); + stack_frame_head = fra.me.prev; return; } -void math___Object___srand(val_t self) { - struct trace_t trace = {NULL, LOCATE_math___Object___srand, 41}; - trace.prev = tracehead; tracehead = &trace; - kernel_Any_Any_srand_0( self); - tracehead = trace.prev; +void math___Object___srand(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_math; + fra.me.line = 41; + fra.me.meth = LOCATE_math___Object___srand; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//math.nit:41 */ + kernel_Any_Any_srand_0(fra.me.REG[0]); + stack_frame_head = fra.me.prev; return; }