From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 29 Apr 2013 14:57:42 -0400 To: 9fans@9fans.net Message-ID: <55d863d12c769379ce2cbf372d2f5160@coraid.com> In-Reply-To: <5ba07285c54fa7e0fde7a02e3a09bdbc@rei2.9hal> References: <5ba07285c54fa7e0fde7a02e3a09bdbc@rei2.9hal> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] 5l bug Topicbox-Message-UUID: 4b2a47b2-ead8-11e9-9d60-3106f5b1d025 On Mon Apr 29 14:55:02 EDT 2013, cinap_lenrek@gmx.de wrote: > following up, theres my naive fix for this. instead of > emiting conditional division instruction by 5c... dont and > keep the branch. does this make any sense? > > term% hg diff -r 1777 peep.c > diff -r 5eeb36d3ddd0 sys/src/cmd/5c/peep.c > --- a/sys/src/cmd/5c/peep.c Mon Jul 30 19:11:16 2012 +0200 > +++ b/sys/src/cmd/5c/peep.c Mon Apr 29 20:51:12 2013 +0200 > @@ -1354,6 +1354,15 @@ > j->end = r->s2; > return Branch; > } > + switch(r->prog->as){ > + case ADIV: > + case ADIVU: > + case AMOD: > + case AMODU: > + /* emulated by 5l, doesnt handle conditionals */ > + j->end = r->s1; > + return Toolong; > + } > if (modifiescpsr(r->prog)) { > j->end = r->s1; > return Setcond; it's possible to do in the linker, but without trying this, it looks reasonable to me. what does the resulting asm look like? - erik