Neil Brown
0189ba3793
Began implementing the occam intrinsics (some of them, at least) in the C support header
2009-01-23 19:20:26 +00:00
Neil Brown
7337978dcf
Added many more intrinsics to the list of occam intrinsics
2009-01-23 19:19:36 +00:00
Neil Brown
1410e80fb1
Added support for intrinsic functions with multiple return values
...
Previously, such a function was an IntrinsicFunctionCall inside one expression of an ExpressionList, which the type-checker rejected. I've had to add a new constructor to ExpressionList, and I've quickly hacked together the line in the C backend to make it work -- but it does seem to work.
2009-01-23 18:58:52 +00:00
Neil Brown
91f004a197
Realised that with channel-ends for C++CSP, I want to use AltChanin everywhere, not Chanin
2009-01-23 18:10:51 +00:00
Neil Brown
fab6850041
Added code to infer the directions of undirected channel formals, where possible
...
Fixes #24
I still need to do a little more, however, to pass my more elaborate examples in the test file.
2009-01-23 15:59:02 +00:00
Neil Brown
c7931bf800
Added more tests ready for channel-end inference
2009-01-23 14:47:59 +00:00
Neil Brown
c2aaf2fcf7
Provided more helpful errors in the test harness when something is wrong
2009-01-23 14:42:46 +00:00
Neil Brown
d184721979
Added yet more tests for channel-ends
2009-01-21 00:00:31 +00:00
Neil Brown
16d8468b08
Added more channel end tests, involving abbreviations before use
2009-01-20 23:50:02 +00:00
Neil Brown
1adca155dd
Added a file full of tests for inferring direction specifiers in PROC formals
2009-01-20 23:43:42 +00:00
Neil Brown
d806931fbf
Revamped the TestHarness framework to allow multiple substitutions in a test prologue
2009-01-20 23:43:07 +00:00
Neil Brown
c8a8370636
Remove the comment about needing to add overflow checking
...
Fixes #24
In that, it is the last patch in a series that fixed the lack of overflow checking in all the integer operations.
2009-01-23 14:28:44 +00:00
Neil Brown
7457d894f8
Tweaked the C and C++ backends to take the replacement for Int from the TypeSizes module rather than calculate it locally
2009-01-23 15:52:28 +00:00
Neil Brown
9145c993ea
Fixed the constant folding to use a type for Int based on the compilation target rather than just assuming Int32
...
However, it is possible that there will still be a problem if the C and C++ compiler have different int sizes, because the constant folding has to know the type at compile time, and thus we have to arbitrarily choose to use the C version. In future, we could perhaps swap all Ints for the appropriate substiution (e.g. Int64) at run-time, based on the flags and prior knowledge about C/C++ int sizes
2009-01-23 15:50:06 +00:00
Neil Brown
2a8ee9a420
Fixed a bug in the constant folding, where anything divided by -1 was being evaluated to zero
2009-01-23 15:48:39 +00:00
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