Commit Graph

2343 Commits

Author SHA1 Message Date
Neil Brown
15a4a59bcf Stopped the pass that removes unused variables removing unused replicators 2009-01-23 14:24:44 +00:00
Neil Brown
732080557c Made the configure script check if certain GCC flags are supported before using them 2009-01-23 14:16:39 +00:00
Neil Brown
e71af91e48 Added unsigned tests to rangetest 2009-01-23 13:44:51 +00:00
Neil Brown
084fcad1fe Changed multiply back to the very simplest implementation 2009-01-23 13:36:09 +00:00
Neil Brown
ecf840fe9f Had a go at implementing checked-multiply differently, but the results worked out slower 2009-01-23 12:44:37 +00:00
Neil Brown
b7e296943a Made the commutative range-test also check if the values were correct (seemed easy enough) 2009-01-23 12:43:42 +00:00
Neil Brown
e001d9173c Defeated the GCC optimiser, to get a decent estimate of how slow multiplication is 2009-01-22 16:52:00 +00:00
Neil Brown
72a8824940 Had a go at implementing multiply overflow checking (with a single division, and pre-checks)
I also added an occam testcase to help time the different between * and TIMES.  But gcc optimises out the loop with TIMES under -O2, and with -O0 there is a factor of four difference.
2009-01-22 16:51:54 +00:00
Neil Brown
c9fa0f774c Added all the multiplication tests like the others (currently failing) 2009-01-22 13:18:58 +00:00
Neil Brown
e690f1c36d Added shift tests and simplified calling the ranged tests a little 2009-01-22 13:07:16 +00:00
Neil Brown
b08d48bd43 Added more remainder tests, and fixed our implementation of remainder to pass the tests 2009-01-22 12:58:53 +00:00
Neil Brown
226f8b4ac4 Added checks for division and remainder, and discovered some failing remainder tests 2009-01-22 12:49:47 +00:00
Neil Brown
98136367e0 Added tests for the occam support negation functions 2009-01-22 12:28:00 +00:00
Neil Brown
ef387ec748 Simplified the range test code 2009-01-22 11:59:40 +00:00
Neil Brown
5d404478f2 Added tests for occam's subtraction 2009-01-22 11:57:11 +00:00
Neil Brown
890b922f2b Combined the tests for addition in occam into a macro 2009-01-22 11:46:54 +00:00
Neil Brown
0d2ea4c920 Updated the code in light of the feedback from the GCC bug 2009-01-22 11:41:43 +00:00
Neil Brown
fdeab43b3c Added range checking for addition, subtraction, negation and division in the occam support headers 2009-01-22 11:26:06 +00:00
Neil Brown
1b51eb5d63 Added a C file of tests ready for the occam overflow checking 2009-01-22 11:25:50 +00:00
Neil Brown
8a559c4d07 Fixed the make clean rule to work when there isn't anything to clean (not totally confident it's portable though) 2009-01-21 17:37:32 +00:00
Neil Brown
1f4796e07f Fixed all the tests to reflect the new channel-end system, such that they all pass again
This is the last patch (for now) of the set implementing the new channel-end system
2009-01-20 17:41:44 +00:00
Neil Brown
492091030d Fixed the C and C++ backends to work with the new channel-end system 2009-01-20 17:41:25 +00:00
Neil Brown
8bae96f34e Took care of directed arrays in the passes that generate _sizes arrays 2009-01-20 17:38:18 +00:00
Neil Brown
cc70438c1b Added a pass to remove unneeded directions, i.e. c! where c is already an output end 2009-01-20 17:36:40 +00:00
Neil Brown
c6959ac854 Stopped removeDirections operating on the C++ backend, where we actually want to keep the directions 2009-01-20 17:36:02 +00:00
Neil Brown
0b75720e2e Fixed the TLP mechanisms to work with the new channel-end system 2009-01-20 17:35:31 +00:00
Neil Brown
766cb09dcf Changed pullUp to pull up channel arrays that have direction specifiers applied to the whole array
For example, a call like foo(6, cs!) will have cs! pulled up, iff cs was of type CHAN X.  If cs was of type CHAN! X, nothing is done (and the needless direction will be removed later on).
2009-01-20 17:33:24 +00:00
Neil Brown
a416f7dac9 Fixed the occam type-checker to work with the new channel-ends, adding direction specifiers where necessary
In actual parameters (checking against the formal type), abbreviations (checking against the inferred/specified destination type), and inputs (including inside ALTs) and outputs, direction specifiers are automatically added where needed.  With all the other changes, this seems to compile all the occam 2 cgtests, and cgtest87 (which tests directions) as well as Adam's tests so I'm fairly confident that it was the right thing to do.
2009-01-20 17:30:17 +00:00
Neil Brown
4d692c8897 Fixed the occam and Rain parsers to work with the new channel-ends
For now, I have fixed the occam parser so that it allows 1 or more direction specifiers after channel names.  So c?? is valid, and should end up being equivalent to c?, but this may need altering later.
2009-01-20 17:28:57 +00:00
Neil Brown
de80ab467e Fixed the common Types module to work with the new channel-ends 2009-01-20 17:27:37 +00:00
Neil Brown
336c5abe3c Fixed the ShowCode module to work with the new channel-ends 2009-01-20 17:27:10 +00:00
Neil Brown
541f7c1421 Turned the Chan type into a Chan type for full channels and a ChanEnd type for the directed ends
This is the first patch in the series of many that implement this change throughout Tock.

Fixes #70.
2009-01-20 17:25:19 +00:00
Neil Brown
2137be190b Added a PassMaker function for use when something should only be used with occam and the CCSP backend 2009-01-20 17:24:01 +00:00
Neil Brown
8487af3b4c Added some functions to the C++ support header to aid turning an array of channels into an array of channel-ends 2009-01-20 17:23:10 +00:00
Neil Brown
ee856a0d39 Made the usage checking check if a name was marked by a SHARED pragma before issuing an error 2009-01-19 15:11:42 +00:00
Neil Brown
8a36f6e96f Added support for parsing pragmas, for now just handling the SHARED pragma 2009-01-19 15:11:09 +00:00
Neil Brown
f612b99a49 Added a map of name attributes (ready for things like PRAGMA SHARED) to the CompState
This should possibly (and could in future) be combined into NameDef and the main csNames map
2009-01-19 15:10:05 +00:00
Neil Brown
d3fc6a1a90 Made the size of INT vary between 16-,32- and 64-bit platforms
Fixes #37.  The change itself was very easy, but the main problem was to then go and change everything in GenerateCTest that had been written using A.Int as a test type.
2009-01-18 20:10:19 +00:00
Neil Brown
24f646f5b8 Changed if statements so that they generate a simpler if when no specs are involved
Fixes #16.  If there are no Spec or ProcThen items in an if, a much simpler if (without gotos or similar) is generated.
2009-01-18 19:33:01 +00:00
Neil Brown
949c88bb75 Added support for the canonicalisation of simple Expressions
This seems to have fixed a couple more normal tests, and goes towards fixing the randomly failing quickcheck test (but that test is not fixed, yet)
2009-01-18 00:20:14 +00:00
Neil Brown
536d0b19a6 Fixed all the failing C++CSP tests for input and output so that they now pass 2009-01-17 22:20:52 +00:00
Neil Brown
8174e86366 Made the usage checking on PARs for plain variables ignore the variables declared inside the branches of that PAR 2009-01-17 19:05:31 +00:00
Neil Brown
d9cfa9135d Made sure that timer variables are always considered read-only when passed around
This fixes a usage checking problem in cgtest08 where the variable would be considered written-to in parallel because it was passed twice in parallel (and not marked as a VAL abbrev)
2009-01-17 16:25:08 +00:00
Neil Brown
6f22d8a573 Stopped the pulling up of fully-resolved array expressions where one of the subscripts is a slice
This was causing a problem in the C/C++ backends, where the slice function call was having _sizes appended to it.  So now we pull up anything that results in an array, or is a slice.
2009-01-15 22:44:11 +00:00
Neil Brown
dd57fdccbd Made a small change to sort multiplied expressions into order during flattening in the usage checking
This makes sure that y*x and x*y are both flattened into x*y, but doesn't yet solve the problem of (x*y)*z vs (y*z)*x
2009-01-15 22:18:27 +00:00
Neil Brown
f7e05c2714 Made sure that the usage checking on plain variables checks anything that doesn't have a replicator in it
This means that things like a[0][0] are once again covered by the plain variable check, which means that some more tests now pass.
2009-01-15 21:37:28 +00:00
Neil Brown
9d1dfb7f5f Stopped arrays being pulled up when all the indices have been supplied 2009-01-15 21:36:05 +00:00
Neil Brown
9105a95508 Added the debug printing of the usage checking problems to be solved 2009-01-15 21:03:04 +00:00
Neil Brown
e6d9a88e14 Changed the CSM constraint on the various messages to CSMR 2009-01-15 21:00:27 +00:00
Neil Brown
0a98db5295 Changed pshow on CompState (which caused errors) to plain show, by adding a Show instance to CompState 2009-01-15 20:59:37 +00:00