Commit Graph

2090 Commits

Author SHA1 Message Date
Neil Brown
594d7ef242 Tweaked various code in the common and checks directory to work with the new step count in the For replicator 2009-01-28 23:43:16 +00:00
Neil Brown
a68c871329 Added an expression to represent a STEP count to the For replicator constructor in the AST 2009-01-28 23:42:31 +00:00
Neil Brown
49ea4f053e Fixed the occam parser to allow comments after pragmas on the same line
One of the more recent cgtests has a comment after a pragma
2009-01-28 23:40:14 +00:00
Neil Brown
a4f0e85c72 Fixed a bug involving abbreviation of arrays of channels into arrays of channel-ends in the C++ backend
The array for the channel-ends was not being allocated storage, so the array (a pointer to some random location) was being written to and causing a seg-fault
2009-01-28 23:16:31 +00:00
Neil Brown
6ff8e3b163 Fixed a bug where records were being recorded with the wrong name type in the occam parser 2009-01-28 22:11:23 +00:00
Neil Brown
52459e7557 Turned on usage checking by default
I think the Tock usage checking is now sufficiently advanced (it only rejects one or two parts of the cgtest at the moment) to turn it on by default
2009-01-28 17:34:34 +00:00
Neil Brown
6e0b56c7f6 Added some preprocessor stuff to help stop Tock trampling over various defines 2009-01-27 17:04:18 +00:00
Neil Brown
d4f1ac2797 Added nearly all the remaining intrinsic functions (all the *TOSTRING and STRINGTO*, except for floating-point types) 2009-01-27 17:00:28 +00:00
Neil Brown
592ed1d4ef Added a line to fix an autoconf warning and added -lm to the link options (for the math libraries) 2009-01-27 16:59:35 +00:00
Neil Brown
f4f08e09aa Fixed the RAN/DRAN intrinsic 2009-01-27 13:50:42 +00:00
Neil Brown
9b1368ffe7 Implemented all but one (RAN) of the intrinsic functions in appendix N by mapping them directly to the C versions 2009-01-27 13:38:00 +00:00
Neil Brown
63d558df20 Fixed some GCC warnings resulting from not passing the printf format through to all the necessary support functions 2009-01-27 13:03:26 +00:00
Neil Brown
dbc75ef0b1 Added a pass that helps stop some GCC warnings about literals equivalent to INT_MIN and similar 2009-01-27 13:00:08 +00:00
Neil Brown
addcefdab2 Stopped GCC warning about unused variables
We detect real unused variables from the occam program ourselves, but we don't want GCC warnings for all the unused _sizes variables and so on
2009-01-27 12:56:32 +00:00
Neil Brown
d1e0ec07c4 Finished off the last of the floating point intrinsics (from appendices K and M)
cgtest19 now passes all its tests
2009-01-27 12:21:18 +00:00
Neil Brown
08f862685c Implemented several of the remaining floating-point intrinsics 2009-01-27 12:04:30 +00:00
Neil Brown
2fc545d09d Implemented REAL32OP and REAL64OP 2009-01-26 19:02:19 +00:00
Neil Brown
20e24b807f Cleared up some signed/unsigned warnings in the latest intrinsics 2009-01-26 19:01:56 +00:00
Neil Brown
41946716f0 Implemented ASHIFTRIGHT (straightforward) and ASHIFTLEFT (amazingly hard) and tested them 2009-01-26 18:57:50 +00:00
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