Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Ahead warp factor one, Mr. Sulu.


devel / comp.lang.c / Re: harder problem i encountered

SubjectAuthor
* harder problem i encounteredfir
`* Re: harder problem i encounteredfir
 +- Re: harder problem i encounteredfir
 `- Re: harder problem i encounteredfir

1
harder problem i encountered

<1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21615&group=comp.lang.c#21615

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1012:b0:2e1:e7f3:5c89 with SMTP id d18-20020a05622a101200b002e1e7f35c89mr23206944qte.550.1651747078482;
Thu, 05 May 2022 03:37:58 -0700 (PDT)
X-Received: by 2002:a05:6214:27c9:b0:446:5771:397b with SMTP id
ge9-20020a05621427c900b004465771397bmr21086952qvb.75.1651747078140; Thu, 05
May 2022 03:37:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 5 May 2022 03:37:57 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.249; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.249
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com>
Subject: harder problem i encountered
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 05 May 2022 10:37:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 72
 by: fir - Thu, 5 May 2022 10:37 UTC

back then i wrote code which i found initially silly (it was taken
becouse i found some text on it (i mean compilng expressions with operators and parenthesis ) herdly readable and i wanted something quick

now when i run it i found it quite okay in some sense, what it is
it is a machine that treats expression as data it takes something like

(a*b+c*d)/e

as an input and reduce operator exchanging a*b into t1
and emiting "mov eax (a); mul eax (b); mov (t1) eax;"

(t1+c*d)/e //emit "mov eax (a); mul eax (b); mov (t1) eax;"
and so on
(t1+t2)/e //emit "mov eax (c); mul eax (d); mov (t2) eax;"
(t3)/e //emit "mov eax (t1); mul eax (t2); mov (t3) eax;"
t3/e
t4 //emit emit "mov eax (t3); mul eax (e); mov (t4) eax;"

and done (i may add any operators easily to this also)

yesterday i also added reduction for t[a] which puts t(N) and emits what
it need to emit

the code looks like that

void compile_expression_particule(chunks atoms)
{ temp_register = 1;
for(;;)
{
while( reduce_operator(atoms, '/'));
while( reduce_operator(atoms, '*'));
while( reduce_operator(atoms, '-'));
while( reduce_operator(atoms, '+'));
while( reduce_operator2(atoms, Chunk("<or>")));
while( reduce_operator2(atoms, Chunk("<and>")));
while( reduce_operator2(atoms, Chunk("<xor>")));
//.. may have more here

while( reduce_unefective_parentheses(atoms));
while( reduce_mellow_array_acces(atoms));

int live = CountStillexistingAtomsInExpression(atoms);

if(live==1) break;
}

it has some problem becouse it reducess all divisions until cann then reduces all multiplies until cann etc (problem is it not resolves div and mul in equal priority from left to right so the result is other than in c, but i find it as a problem i may resolve later)

worse problem i encountered is thet that i only used it in that form as above and it i get such expression

x = (a*b+c*d)/e

tle liftside i just take by if cut it to (a*b+c*d)/e and assign result to x
("mov eax (t_n); mov (x) t_n;")

problem is i need to get it more general able to reduce such things as
t[ (x*y+1*2)/f ] = (a*b+c*d)/e
and on this level of exhaustion i cannot focus enough...on some level of exhaustion tocus qualities drop down and also practical errors when
implementing rise up

does maybe someone who is less tired see what based on this code above should i add to be able to compile such more general form?

Re: harder problem i encountered

<e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21616&group=comp.lang.c#21616

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:1195:b0:2f3:b8bf:46ab with SMTP id m21-20020a05622a119500b002f3b8bf46abmr6544821qtk.190.1651761582902;
Thu, 05 May 2022 07:39:42 -0700 (PDT)
X-Received: by 2002:ad4:4b61:0:b0:455:e0bc:9ef7 with SMTP id
m1-20020ad44b61000000b00455e0bc9ef7mr22665585qvx.112.1651761582648; Thu, 05
May 2022 07:39:42 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 5 May 2022 07:39:42 -0700 (PDT)
In-Reply-To: <1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.150; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.150
References: <1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>
Subject: Re: harder problem i encountered
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 05 May 2022 14:39:42 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 89
 by: fir - Thu, 5 May 2022 14:39 UTC

czwartek, 5 maja 2022 o 12:38:05 UTC+2 fir napisał(a):
> back then i wrote code which i found initially silly (it was taken
> becouse i found some text on it (i mean compilng expressions with operators and parenthesis ) herdly readable and i wanted something quick
>
> now when i run it i found it quite okay in some sense, what it is
> it is a machine that treats expression as data it takes something like
>
> (a*b+c*d)/e
>
> as an input and reduce operator exchanging a*b into t1
> and emiting "mov eax (a); mul eax (b); mov (t1) eax;"
>
> (t1+c*d)/e //emit "mov eax (a); mul eax (b); mov (t1) eax;"
> and so on
> (t1+t2)/e //emit "mov eax (c); mul eax (d); mov (t2) eax;"
> (t3)/e //emit "mov eax (t1); mul eax (t2); mov (t3) eax;"
> t3/e
> t4 //emit emit "mov eax (t3); mul eax (e); mov (t4) eax;"
>
> and done (i may add any operators easily to this also)
>
> yesterday i also added reduction for t[a] which puts t(N) and emits what
> it need to emit
>
> the code looks like that
>
> void compile_expression_particule(chunks atoms)
> {
> temp_register = 1;
> for(;;)
> {
> while( reduce_operator(atoms, '/'));
> while( reduce_operator(atoms, '*'));
> while( reduce_operator(atoms, '-'));
> while( reduce_operator(atoms, '+'));
> while( reduce_operator2(atoms, Chunk("<or>")));
> while( reduce_operator2(atoms, Chunk("<and>")));
> while( reduce_operator2(atoms, Chunk("<xor>")));
> //.. may have more here
>
> while( reduce_unefective_parentheses(atoms));
> while( reduce_mellow_array_acces(atoms));
>
> int live = CountStillexistingAtomsInExpression(atoms);
>
> if(live==1) break;
> }
>
> it has some problem becouse it reducess all divisions until cann then reduces all multiplies until cann etc (problem is it not resolves div and mul in equal priority from left to right so the result is other than in c, but i find it as a problem i may resolve later)
>
> worse problem i encountered is thet that i only used it in that form as above and it i get such expression
>
> x = (a*b+c*d)/e
>
> tle liftside i just take by if cut it to (a*b+c*d)/e and assign result to x
> ("mov eax (t_n); mov (x) t_n;")
>
> problem is i need to get it more general able to reduce such things as
> t[ (x*y+1*2)/f ] = (a*b+c*d)/e
> and on this level of exhaustion i cannot focus enough...on some level of exhaustion tocus qualities drop down and also practical errors when
> implementing rise up
>
> does maybe someone who is less tired see what based on this code above should i add to be able to compile such more general form?

maybe lets think whay would happan if i would treat = as an normal operator to be reduced, maybe thats the way (obviously this pack of loops abowe as i said reduces things in wrong, almost random, order but as i said i dont wory for now for that)
generally when i reduce particule it yealds as i said to stream of t1 t2 t3 t4 t5... variables, what i return is generally hold in eax but in fact when i would need to save to that last t-somthing., i colud..though this probably has no sense
well if i would have a=2 it seems i should modify the sheme mov eax (left), op eax (right), mov (tN ) eax
into mov eax left, mov ebx (right), mov (eax) ebx
but what in case i get tab[i]=a.. i couldnt reduce tab[i] to tN value so maybe i should ad special reducing routine that treats tab[i]=x as a whole?
i get a bit weary and in taht state slements dont stick that well in my hed...its common case obviously..someone needs to force himself to rest it seems

Re: harder problem i encountered

<48703ec3-33cb-415f-a11e-4d1d945be67dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21617&group=comp.lang.c#21617

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:6214:20ab:b0:45a:cb44:7d44 with SMTP id 11-20020a05621420ab00b0045acb447d44mr293865qvd.63.1651786277763;
Thu, 05 May 2022 14:31:17 -0700 (PDT)
X-Received: by 2002:a05:620a:408e:b0:6a0:10bc:55dc with SMTP id
f14-20020a05620a408e00b006a010bc55dcmr241218qko.767.1651786277568; Thu, 05
May 2022 14:31:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!npeer.as286.net!npeer-ng0.as286.net!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Thu, 5 May 2022 14:31:17 -0700 (PDT)
In-Reply-To: <e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.249; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.249
References: <1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com> <e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48703ec3-33cb-415f-a11e-4d1d945be67dn@googlegroups.com>
Subject: Re: harder problem i encountered
From: profesor...@gmail.com (fir)
Injection-Date: Thu, 05 May 2022 21:31:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5807
 by: fir - Thu, 5 May 2022 21:31 UTC

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):
> > back then i wrote code which i found initially silly (it was taken
> > becouse i found some text on it (i mean compilng expressions with operators and parenthesis ) herdly readable and i wanted something quick
> >
> > now when i run it i found it quite okay in some sense, what it is
> > it is a machine that treats expression as data it takes something like
> >
> > (a*b+c*d)/e
> >
> > as an input and reduce operator exchanging a*b into t1
> > and emiting "mov eax (a); mul eax (b); mov (t1) eax;"
> >
> > (t1+c*d)/e //emit "mov eax (a); mul eax (b); mov (t1) eax;"
> > and so on
> > (t1+t2)/e //emit "mov eax (c); mul eax (d); mov (t2) eax;"
> > (t3)/e //emit "mov eax (t1); mul eax (t2); mov (t3) eax;"
> > t3/e
> > t4 //emit emit "mov eax (t3); mul eax (e); mov (t4) eax;"
> >
> > and done (i may add any operators easily to this also)
> >
> > yesterday i also added reduction for t[a] which puts t(N) and emits what
> > it need to emit
> >
> > the code looks like that
> >
> > void compile_expression_particule(chunks atoms)
> > {
> > temp_register = 1;
> > for(;;)
> > {
> > while( reduce_operator(atoms, '/'));
> > while( reduce_operator(atoms, '*'));
> > while( reduce_operator(atoms, '-'));
> > while( reduce_operator(atoms, '+'));
> > while( reduce_operator2(atoms, Chunk("<or>")));
> > while( reduce_operator2(atoms, Chunk("<and>")));
> > while( reduce_operator2(atoms, Chunk("<xor>")));
> > //.. may have more here
> >
> > while( reduce_unefective_parentheses(atoms));
> > while( reduce_mellow_array_acces(atoms));
> >
> > int live = CountStillexistingAtomsInExpression(atoms);
> >
> > if(live==1) break;
> > }
> >
> > it has some problem becouse it reducess all divisions until cann then reduces all multiplies until cann etc (problem is it not resolves div and mul in equal priority from left to right so the result is other than in c, but i find it as a problem i may resolve later)
> >
> > worse problem i encountered is thet that i only used it in that form as above and it i get such expression
> >
> > x = (a*b+c*d)/e
> >
> > tle liftside i just take by if cut it to (a*b+c*d)/e and assign result to x
> > ("mov eax (t_n); mov (x) t_n;")
> >
> > problem is i need to get it more general able to reduce such things as
> > t[ (x*y+1*2)/f ] = (a*b+c*d)/e
> > and on this level of exhaustion i cannot focus enough...on some level of exhaustion tocus qualities drop down and also practical errors when
> > implementing rise up
> >
> > does maybe someone who is less tired see what based on this code above should i add to be able to compile such more general form?
> maybe lets think whay would happan if i would treat = as an normal operator to be reduced, maybe thats the way (obviously this pack of loops abowe as i said reduces things in wrong, almost random, order but as i said i dont wory for now for that)
> generally when i reduce particule it yealds as i said to stream of t1 t2 t3 t4 t5... variables, what i return is generally hold in eax but in fact when i would need to save to that last t-somthing., i colud..though this probably has no sense
> well if i would have a=2 it seems i should modify the sheme mov eax (left), op eax (right), mov (tN ) eax
> into mov eax left, mov ebx (right), mov (eax) ebx
> but what in case i get tab[i]=a.. i couldnt reduce tab[i] to tN value so maybe i should ad special reducing routine that treats tab[i]=x as a whole?
> i get a bit weary and in taht state slements dont stick that well in my hed..its common case obviously..someone needs to force himself to rest it seems

the assign operator i added and it seem to work, the a[b]=c reduction i wrote but not even tested getting to weary... good scheme for work for me seem to be intense 2-3 weeks and then a longer break (asm i wrote in one such session in 2017 iirc later added sse mnemonics in shorter one in 2018 iirc) furia i began in one such session in 2019 now it was second in 2022.. so it maybe seems i need to break few months again...geel free to continue your talk

Re: harder problem i encountered

<0097c373-33c0-460b-90dd-a791e10364dfn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21619&group=comp.lang.c#21619

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a05:622a:40e:b0:2f3:bad4:ae29 with SMTP id n14-20020a05622a040e00b002f3bad4ae29mr6146370qtx.557.1651912407276;
Sat, 07 May 2022 01:33:27 -0700 (PDT)
X-Received: by 2002:a05:6214:27c9:b0:446:5771:397b with SMTP id
ge9-20020a05621427c900b004465771397bmr5667928qvb.75.1651912407106; Sat, 07
May 2022 01:33:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 7 May 2022 01:33:26 -0700 (PDT)
In-Reply-To: <e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.208; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.208
References: <1ba354bc-3bbb-423a-a613-efee327ea241n@googlegroups.com> <e7640eee-16d9-47e6-893c-2f285745e3ben@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0097c373-33c0-460b-90dd-a791e10364dfn@googlegroups.com>
Subject: Re: harder problem i encountered
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 07 May 2022 08:33:27 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: fir - Sat, 7 May 2022 08:33 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor