home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch
- Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!spool.mu.edu!uwm.edu!rpi!utcsri!geac!itcyyz!yrloc!rbe
- From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
- Subject: Re: Control TO Data Dependence
- Message-ID: <1993Jan27.153136.11639@yrloc.ipsa.reuter.COM>
- Keywords: Control Dependence, Data Dependence, High-Level Synthesis
- Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
- Organization: I P Sharp Associates, Toronto
- References: <1993Jan23.003531.21573@cs.brown.edu>
- Distribution: Snake Island Research Inc
- Date: Wed, 27 Jan 93 15:31:36 GMT
- Lines: 49
-
- In article <1993Jan23.003531.21573@cs.brown.edu> lka@lems17lems.brown.edu (Lalit K. Agarwal) writes:
- >Has anyone played with converting CONTROL-DEPENDENCE to DATA-DEPENDENCE in
- >High-Level-Synthesis or come across any algorithm for doing it in the literature.?
- >All suggestions are highly welcome.
-
- This is common in APL and J. Both languages are array-oriented:
- 1 2 3 + 8 4 2
- 9 6 5
-
- so all primitives are defined on entire arrays, rather than on scalars.
- Given this, programs are shorter, cleaner, more elegant, and more likely to
- work if you describe algorithms in terms of array operations instead of loops.
- Thus, you'll see expressions like this:
-
- X + 55* (X<4) NB. Add 55 to those elements of X which are less than 4.
-
- This involves knowledge of simple arithmetic identities, but there are
- merge and selection capabilities which permit fancier stuff:
- t =. "this is my text string'
- b =. t=' '
- b
- 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0
- NB. The above locates blanks in t.
- NB. Now replaces blanks by '*'.
- t[b/i. #b] =. '*' NB. This is part APL, part J...
- NB. #b is the shape of b, i.e., 24
- NB. i. #b is the first #b integers.
- NB. b/i.#b removes from the list of #b integers those which are
- not corresponding to blanks.
- NB. t[...] =. '*' replaces the non-blank elements.
-
- This stuff is common in APL. Go read ACM SIGAPL Quote Quad conference
- proceedings for more examples, or come to APL93 in Toronto this August
- 15-19!
- {I'm the Tutorials Chair...}
-
- One last example: A model of a loom is 2.5 pages of BASIC (SEE P. Heiser,
- August 1981 or so BYTE article {from memory}). This compresses into
- about 12 characters of APL: Two indexing operations and one inner product.
- It also runs bags faster than BASIC. Even on one processor... 8^}
-
- Bob
-
-
- Robert Bernecky rbe@yrloc.ipsa.reuter.com bernecky@itrchq.itrc.on.ca
- Snake Island Research Inc (416) 368-6944 FAX: (416) 360-4694
- 18 Fifth Street, Ward's Island
- Toronto, Ontario M5J 2B9
- Canada
-