Commit Graph

1971 Commits

Author SHA1 Message Date
Neil Brown
ec9efd378f Corrected some warnings about unsigned constants in the C++ support headers 2009-01-26 18:55:07 +00:00
Neil Brown
e0e0b46052 Implemented SHIFTLEFT and SHIFTRIGHT 2009-01-26 18:11:15 +00:00
Neil Brown
8df1bc80f9 Implemented LONGDIV (passes the cgtests, but I'm not 100% confident in it) 2009-01-26 18:03:27 +00:00
Neil Brown
4a12999989 Implemented LONGPROD, in a slightly long-winded way 2009-01-26 17:57:45 +00:00
Neil Brown
df66042a99 Corrected a problem with LONGADD and implemented both LONGSUB and LONGDIFF 2009-01-26 15:46:37 +00:00
Neil Brown
0802d79d6c Fixed a few more of the intrinsic functions 2009-01-25 22:30:07 +00:00
Neil Brown
062b47bad9 Made some intrinsics stop when they are supposed to (and tested it from rangetest) and implemented a couple more 2009-01-25 22:06:30 +00:00
Neil Brown
588d24bfea Fixed a mistake with a missing type in a header 2009-01-25 22:06:01 +00:00
Neil Brown
ff61ebfa2b Implemented several of the floating point intrinsics (using cgtest19 and the occam 2.1 manual) 2009-01-25 21:31:58 +00:00
Neil Brown
65171e4492 Implemented the ROTATELEFT and ROTATERIGHT intrinsics 2009-01-25 21:31:41 +00:00
Neil Brown
0b2708b2ed Fixed a few small things related to generating intrinsic calls in the C and C++ backends 2009-01-25 20:43:39 +00:00
Neil Brown
c30db7b11e Added in C headers (dummy bodies) for all the intrinsic functions that I have so far defined in the Intrinsics module 2009-01-25 20:42:57 +00:00
Neil Brown
c19039e90e Added the definitions of most of the intrinsics from the occam 2.1 manual (but not yet the implementations) 2009-01-25 18:54:57 +00:00
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