czwartek, 5 maja 2022 o 16:39:49 UTC+2 fir napisał(a):
> czwartek, 5 maja 2022 o 12:38:05 UTC+2 fir napisał(a):
in fact this topic is a mess, i stopped coding for 2 days becouse of this cognitive drop down
but i feel like im bori9ng so maybe yet will try to mend it a bit
i wonder if i turn this into
again:
ReduceMulsAndDivs1Pass(); //like a*b*(c+d) -> t1*(c+d)
ReduceAddsAndSubbs1Pass(); // like t1*(c+d) -> t1*(t2)
int pr = ReduceUneffectiveParenthesis // t1*t2
if(pr) goto again:
will be generall it is not ships something
i need to add yet this assign reduction, array acces and array assign, how?
array accec (i mean reduction for read) i could do when ready ,
say
frame_bitmap[4*(mouse_x+frame_size_x*mouse_y)]*b*(c+d)
after that loop will be
frame_bitmap[4*(mouse_x+t1)]*b*(c+d)
frame_bitmap[4*(t2)]*b*(t3)
frame_bitmap[4*t2]*b*t3
frame_bitmap[t4]*t5 //cant go
so reduce array acces
i see some problem
becouse if i would have
frame_bitmap[t4]*t5+6 the code will add sum before i would be able to reduce multiply
doeas this mean this method is wrong, can be easy repaired and i need do domething other
this is found final nested parenthesis and firstly reduce them with the assumption there is no more parenthesis in it? seems so