Article View: comp.lsi
Article #1187meg fix
From: frazier
Date: Wed, 16 Nov 1988 22:25
Date: Wed, 16 Nov 1988 22:25
68 lines
2895 bytes
2895 bytes
Hello, Folks.
I have cured the problem I posted about earlier.
Meg was generating endot code which our version of endot
could not handle. Specifically, it was generating code
of the form
if in1 _ in2 _ in3 _ in4 and 1 _ 0 _ 0 _ 1 eql 0 _ 0 _ 0 _ 1 (
where underscore (_) is a macro for concat. The above code concats the
inputs in question, masks them with a bit string and then compares them
to another bit string. Endot has two problems with this. First, the
eql was taking precidence over the and, and both the eql and the and were
(I think) taking precidence over the concat. So I added parentheses.
The second problem was that the comparison was not working. I believe
this had something to do with endot acting funny with leading 1's, but
anyway, the problem goes away when leading 0's are added, so I added
zero extensions to the code. Now the above string looks like
if ((in1 _ in2 _ in3 _ in4 ext 5) and (1 _ 0 _ 0 _ 1 ext 5)) eql
(0 _ 0 _ 0 _ 1 ext 5) (
I have included here a diff between the original endot and my altered
version. Please let me know if there is a problem with this code - I
am using it, after all!
88c88,94
< int NoStates, i, FieldWidth;
---
> int NoStates, i, FieldWidth,
> /*
> The variable NoInputs added by Greg Frazier (11/16/88) in
> order to 0-extend the concatenated bits, which endot was
> having problems with...
> */
> NoInputs;
130a137,141
> /*
> change: added counting the number of inputs here for zero extension:
> Greg Frazier 11/16/88
> */
> NoInputs = 0;
132c143,144
< bit != (struct IdList *) 0; bit = bit->next )
---
> bit != (struct IdList *) 0; bit = bit->next ) {
> NoInputs++;
133a146
> }
245c258,262
< printf( "if %s\n\t\tand ", v->name );
---
> /* The parentheses and zero-extension added by Greg Frazier
> (11/16/88) because endot could not handle the grouping
> or the comparison w/out the zero-extension
> */
> printf( "if ((%s ext %d)\n\t\tand (", v->name, NoInputs+1 );
251c268
< printf( "eql " );
---
> printf( "ext %d)) eql\n\t\t\t(", NoInputs+1 );
258c275
< printf( " (\n" );
---
> printf( " ext %d)(\n", NoInputs+1 );
Greg Frazier
--------------------------------------------------------------------
Greg Frazier o Internet: frazier@CS.UCLA.EDU
CS dept., UCLA /\ UUCP: ...!{ucbvax,rutgers}!ucla-cs!frazier
----^/----
/
Technical Details
Message-ID:
<17999@shemp.CS.UCLA.EDU>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!ucla-cs!frazierShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!ucla-cs!frazier From: frazier@oahu.cs.ucla.edu Newsgroups: comp.lsi Subject: meg fix Message-ID: <17999@shemp.CS.UCLA.EDU> Date: 16 Nov 88 22:25:59 GMT Sender: news@CS.UCLA.EDU Reply-To: frazier@CS.UCLA.EDU (Greg Frazier) Organization: UCLA Computer Science Department Lines: 68