carl [Mon, 18 Feb 2019 16:36:48 +0000 (00:36 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Initial support for CMake
+ Added support for sys_tmpdir for better portability.
carl [Mon, 18 Feb 2019 16:35:32 +0000 (00:35 +0800)]
* Initial support of CMake
carl [Mon, 18 Feb 2019 16:35:24 +0000 (00:35 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
carl [Mon, 18 Feb 2019 16:35:01 +0000 (00:35 +0800)]
* Add missing header file.
carl [Mon, 18 Feb 2019 16:34:44 +0000 (00:34 +0800)]
* Initial support of CMake
carl [Mon, 18 Feb 2019 16:34:24 +0000 (00:34 +0800)]
* Adapt to new sys_filesize prototype.
carl [Mon, 18 Feb 2019 16:34:03 +0000 (00:34 +0800)]
* Initial support of CMake
carl [Mon, 18 Feb 2019 16:33:54 +0000 (00:33 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h (TMPDIR is no longer hard coded)
carl [Mon, 18 Feb 2019 16:33:21 +0000 (00:33 +0800)]
* Initial support of CMake
+ Generation of header files is now made through a C program to make it more portable.
carl [Mon, 18 Feb 2019 16:32:48 +0000 (00:32 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
carl [Mon, 18 Feb 2019 16:32:17 +0000 (00:32 +0800)]
* Initial support of CMake
carl [Mon, 18 Feb 2019 16:31:58 +0000 (00:31 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
carl [Mon, 18 Feb 2019 16:31:29 +0000 (00:31 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
carl [Mon, 18 Feb 2019 16:30:47 +0000 (00:30 +0800)]
Better ANSI C compatibility and portability - part 1:
* Adapt to new sys_filesize prototype.
carl [Mon, 18 Feb 2019 16:30:35 +0000 (00:30 +0800)]
Better ANSI C compatibility and portability - part 1:
* Adapt to new sys_filesize prototype.
carl [Mon, 18 Feb 2019 16:30:01 +0000 (00:30 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
carl [Mon, 18 Feb 2019 16:29:42 +0000 (00:29 +0800)]
Better ANSI C compatibility and portability - part 1:
+ Addition of function prototypes.
+ Change function definitions to ANSI C style.
+ Convert to sed scripts some shell scripts for better portability.
+ Reduce usage of em_path.h
David Given [Mon, 18 Feb 2019 10:04:23 +0000 (11:04 +0100)]
Fix typo.
David Given [Sun, 17 Feb 2019 09:09:22 +0000 (10:09 +0100)]
Minor improvements to the way types are expanded (should avoid embarassing ands
with 0xff).
David Given [Sat, 16 Feb 2019 00:23:27 +0000 (01:23 +0100)]
Merge pull request #171 from davidgiven/dtrg-comparisons
i80: a few more minor fixes
David Given [Sat, 16 Feb 2019 00:18:31 +0000 (01:18 +0100)]
Add a few minor top optimisations.
David Given [Sat, 16 Feb 2019 00:18:21 +0000 (01:18 +0100)]
Fix typo where I was confusing sbi and sui, with hilarious results.
David Given [Fri, 15 Feb 2019 22:56:00 +0000 (23:56 +0100)]
Merge pull request #170 from davidgiven/dtrg-i169
Fix driver crash when using -R
David Given [Fri, 15 Feb 2019 22:40:42 +0000 (23:40 +0100)]
Fix memory corruption when using -R; the values being stored in the list
weren't freeable when they should have been.
David Given [Fri, 15 Feb 2019 22:24:10 +0000 (23:24 +0100)]
Reformat before editing.
David Given [Fri, 15 Feb 2019 22:12:12 +0000 (23:12 +0100)]
Merge pull request #168 from davidgiven/dtrg-i167
i80: fix large stack frames
David Given [Fri, 15 Feb 2019 22:03:01 +0000 (23:03 +0100)]
Loading large constants now computes the stack offset correctly.
David Given [Fri, 15 Feb 2019 22:01:33 +0000 (23:01 +0100)]
Generate the proper function prologues for big stack frames.
David Given [Fri, 15 Feb 2019 21:54:13 +0000 (22:54 +0100)]
Merge pull request #166 from davidgiven/dtrg-comparisons
i80: grabbag of optimisations
David Given [Fri, 15 Feb 2019 21:26:14 +0000 (22:26 +0100)]
Cleanup.
David Given [Fri, 15 Feb 2019 21:20:07 +0000 (22:20 +0100)]
Add rules for converting smallnconst2 and smallpconst2 to registers, to stop
the conversion from happening via the stack. Star Trek goes from 39450 to 39384
bytes.
David Given [Fri, 15 Feb 2019 20:38:17 +0000 (21:38 +0100)]
Using regpair instead of hl_or_de is not, in fact, safe until we've stopped
using bc.
David Given [Fri, 15 Feb 2019 20:30:27 +0000 (21:30 +0100)]
Fix nearly all the comparisons, a lot of which were broken. Using a rst for
unsigned comparisons is surprisingly not that useful due to marshalling
overhead; it's only four bytes to do inline (plus jc), or six for a constant.
Also add some useful top optimisations. Star Trek goes from 39890 to 39450
bytes.
David Given [Thu, 14 Feb 2019 23:38:39 +0000 (00:38 +0100)]
Call cmps rather than cmpu for bge... make cmps and cmpu rsts. Apply various
other tiny optimisations.
David Given [Thu, 14 Feb 2019 22:57:55 +0000 (23:57 +0100)]
Use nicely optimised helper tools to do signed comparisons of words. Star Trek
goes from 40452 to 39890 bytes.
David Given [Thu, 14 Feb 2019 22:29:41 +0000 (23:29 +0100)]
Merge pull request #165 from davidgiven/dtrg-b164
i80: fix bad code in inl using faddrn
David Given [Thu, 14 Feb 2019 22:21:47 +0000 (23:21 +0100)]
Fix bad helper tool invocation for inl with faddrn.
David Given [Thu, 14 Feb 2019 22:19:11 +0000 (23:19 +0100)]
Add failing test case.
David Given [Wed, 13 Feb 2019 23:13:41 +0000 (00:13 +0100)]
Merge pull request #163 from davidgiven/dtrg-regmoves
i80: fix pathological behaviour in asp
David Given [Wed, 13 Feb 2019 23:05:08 +0000 (00:05 +0100)]
Turns out that every time the compiler tried to do a stack retraction with asp,
it would flush registers onto the stack. This stops it doing this. Star Trek
goes from 40779 to 40452 bytes.
David Given [Wed, 13 Feb 2019 21:56:18 +0000 (22:56 +0100)]
Merge pull request #161 from davidgiven/dtrg-faststack
i80: use helper functions for stack access
David Given [Wed, 13 Feb 2019 21:46:00 +0000 (22:46 +0100)]
Merge from default.
David Given [Wed, 13 Feb 2019 21:45:22 +0000 (22:45 +0100)]
Instead of using parameterised rsts for stack access, add a huge swathe of
automatically built helper tools. Star Trek goes up from 40243 to 40779 bytes,
but should be a lot faster.
David Given [Wed, 13 Feb 2019 21:42:05 +0000 (22:42 +0100)]
Don't do weird things if files starting with a hyphen exist in the build
directory.
David Given [Wed, 13 Feb 2019 20:16:06 +0000 (21:16 +0100)]
Merge pull request #160 from davidgiven/dtrg-b159
i80, powerpc, mips: fix issue with logical operations and signed small constants
David Given [Wed, 13 Feb 2019 19:56:10 +0000 (20:56 +0100)]
Fix issue with logical operations and small signed constants which turned out
to affect multiple platforms.
David Given [Wed, 13 Feb 2019 19:10:38 +0000 (20:10 +0100)]
Update test case to provoke bug.
David Given [Tue, 12 Feb 2019 21:29:01 +0000 (22:29 +0100)]
Merge pull request #158 from davidgiven/dtrg-b157
i80: fix bad code in comparisons
David Given [Tue, 12 Feb 2019 21:19:07 +0000 (22:19 +0100)]
Fix bad code generation due to not correctly flushing the stack before
comparisons.
David Given [Tue, 12 Feb 2019 21:08:08 +0000 (22:08 +0100)]
Added a test case for #157.
David Given [Tue, 12 Feb 2019 20:51:46 +0000 (21:51 +0100)]
Merge pull request #154 from ccodere/buildfix
Bugfix of compilation on gcc 4.8
carl [Tue, 12 Feb 2019 16:17:45 +0000 (00:17 +0800)]
Fix compilation issue on C90 compilers (gcc 4.8 was failing to compile with default flags) - updated following comment.
David Given [Tue, 12 Feb 2019 10:57:37 +0000 (11:57 +0100)]
Replace the non-working Z80 style signed comparison sign adjustment with
something which actually works on the 8080. Sadly, Star Trek is up to
40243 bytes again.
David Given [Mon, 11 Feb 2019 20:35:16 +0000 (21:35 +0100)]
Merge pull request #156 from davidgiven/dtrg-arraysizes
i80: add 8085 instruction support
David Given [Mon, 11 Feb 2019 20:14:35 +0000 (21:14 +0100)]
Apply Alan Cox's patch to add the 8085 extended instructions to the i80
assembler.
David Given [Mon, 11 Feb 2019 20:09:52 +0000 (21:09 +0100)]
Merge pull request #155 from davidgiven/dtrg-arraysizes
i80: fix signed comparisons
David Given [Mon, 11 Feb 2019 19:46:06 +0000 (20:46 +0100)]
Signed comparisons now work correctly; sadly, Star Trek increases from 39656 to
39726 bytes. Note that the emulator doesn't set P/V correctly and all the tests
fail. Testing in z80ex works fine.
carl [Mon, 11 Feb 2019 16:46:09 +0000 (00:46 +0800)]
Fix compilation issue on C90 compilers (gcc 4.8 was failing to compile with default flags).
David Given [Sun, 10 Feb 2019 22:40:07 +0000 (23:40 +0100)]
Merge from default.
David Given [Sun, 10 Feb 2019 22:39:15 +0000 (23:39 +0100)]
Add tests for simple comparisons (which i80 fails).
David Given [Sun, 10 Feb 2019 18:45:00 +0000 (19:45 +0100)]
Merge pull request #153 from davidgiven/dtrg-i80
i80: more code generator improvements
David Given [Sun, 10 Feb 2019 18:40:48 +0000 (19:40 +0100)]
Improve subtractions, using dad and inline constants where possible. Shrinks
Star Trek from 39740 to 39656 bytes.
David Given [Sun, 10 Feb 2019 18:22:43 +0000 (19:22 +0100)]
Simplify simple comparisons and use inlie constants where possible. Reduces
Star Trek from 39771 to 39740 bytes.
David Given [Sun, 10 Feb 2019 17:57:20 +0000 (18:57 +0100)]
Use pop rather than inx;inx to retract the stack; consumes a register but
halves the number of calls. Reduces Star Trek from 39976 to 39771 bytes.
David Given [Sun, 10 Feb 2019 17:44:47 +0000 (18:44 +0100)]
Teach the i80 code generator how to do left shifts by using dad hl; prevents it
from calling out to .sli2 for simple shifts. Shrinks Star Trek from 40055 bytes
to 39976.
David Given [Sun, 10 Feb 2019 15:40:16 +0000 (16:40 +0100)]
Merge pull request #152 from davidgiven/dtrg-osx
Enable OSX builds again.
David Given [Sun, 10 Feb 2019 13:36:15 +0000 (14:36 +0100)]
Replace mkstemp() with the more modern and safer and simpler tmpfile().
David Given [Sun, 10 Feb 2019 13:32:17 +0000 (14:32 +0100)]
freopen() appears to be problematic on OSX; as it's only ever used to rewind
files, replace with rewind().
David Given [Sun, 10 Feb 2019 13:19:18 +0000 (14:19 +0100)]
Better error reporting.
David Given [Sun, 10 Feb 2019 13:09:52 +0000 (14:09 +0100)]
More common symbol removal.
David Given [Sun, 10 Feb 2019 13:03:55 +0000 (14:03 +0100)]
More common symbol fixing.
David Given [Sun, 10 Feb 2019 12:20:04 +0000 (13:20 +0100)]
Removed a whole bunch of old strcpy() prototypes in favour of <string.h>.
David Given [Sun, 10 Feb 2019 12:11:03 +0000 (13:11 +0100)]
Second try at removing common symbols.
David Given [Sun, 10 Feb 2019 11:57:22 +0000 (12:57 +0100)]
Change the way external symbols are defined to avoid COMMON symbols, which
don't work on OSX very well.
David Given [Sun, 10 Feb 2019 11:57:00 +0000 (12:57 +0100)]
Add stray header.
David Given [Sun, 10 Feb 2019 11:38:33 +0000 (12:38 +0100)]
Remember that we need to update the generated file in LLgen, as it's not
self-bootstrapping...
David Given [Sun, 10 Feb 2019 11:35:18 +0000 (12:35 +0100)]
We don't need depth 10 in the travis checkout.
David Given [Sun, 10 Feb 2019 11:28:42 +0000 (12:28 +0100)]
Don't prototype strcpy as it makes OSX sad.
David Given [Sun, 10 Feb 2019 11:22:59 +0000 (12:22 +0100)]
Merge from default.
David Given [Sat, 9 Feb 2019 23:45:09 +0000 (00:45 +0100)]
Add missing header.
David Given [Sat, 9 Feb 2019 16:43:19 +0000 (17:43 +0100)]
Merge pull request #150 from davidgiven/dtrg-windows
Don't run the floating point tests on i80.
David Given [Sat, 9 Feb 2019 13:24:31 +0000 (14:24 +0100)]
Don't run the floating point tests on i80.
David Given [Sat, 9 Feb 2019 13:15:38 +0000 (14:15 +0100)]
Merge pull request #148 from davidgiven/dtrg-windows
Make the ACK build on Windows again.
David Given [Sat, 9 Feb 2019 12:59:37 +0000 (13:59 +0100)]
Don't run the tests in Appveyor.
David Given [Sat, 9 Feb 2019 12:42:09 +0000 (13:42 +0100)]
More z80ex removal.
David Given [Sat, 9 Feb 2019 12:40:36 +0000 (13:40 +0100)]
Merge pull request #149 from davidgiven/dtrg-arraysizes
i80: more code size improvements.
David Given [Sat, 9 Feb 2019 12:30:29 +0000 (13:30 +0100)]
Remove stray z80ex reference.
David Given [Sat, 9 Feb 2019 12:29:41 +0000 (13:29 +0100)]
Add rst 3 to get the address of a frame variable; lots of rule overhaulage.
Reduces Star Trek from 41821 to 41055 bytes.
David Given [Sat, 9 Feb 2019 11:25:27 +0000 (12:25 +0100)]
Ugh, typo fix.
David Given [Sat, 9 Feb 2019 11:23:42 +0000 (12:23 +0100)]
Maybe the setup script is somewhere else?
David Given [Sat, 9 Feb 2019 11:17:57 +0000 (12:17 +0100)]
Try to install cygwin packages.
David Given [Sat, 9 Feb 2019 11:04:42 +0000 (12:04 +0100)]
Another try at an AppVeyor build script.
David Given [Fri, 8 Feb 2019 23:07:33 +0000 (00:07 +0100)]
Add experimental appveyor file.
David Given [Fri, 8 Feb 2019 23:02:41 +0000 (00:02 +0100)]
Rename all files called 'aux.*' to something else; Windows can't handle them.
David Given [Fri, 8 Feb 2019 22:19:08 +0000 (23:19 +0100)]
Merge pull request #147 from davidgiven/dtrg-arraysizes
i80: better and, or, xor, sign extension code.
David Given [Fri, 8 Feb 2019 22:16:57 +0000 (23:16 +0100)]
Make sign extension much less horrible.
David Given [Fri, 8 Feb 2019 21:38:07 +0000 (22:38 +0100)]
Add tests for simple and, or, and xor; drastically improve the i80 code
generation for these.
David Given [Fri, 8 Feb 2019 20:53:56 +0000 (21:53 +0100)]
Merge pull request #145 from davidgiven/dtrg-arraysizes
Experimentally use rst 1 to optimise frame variable loads.
David Given [Fri, 8 Feb 2019 20:43:52 +0000 (21:43 +0100)]
CP/M sbrk now handles overflow correctly.
David Given [Fri, 8 Feb 2019 20:35:14 +0000 (21:35 +0100)]
Somehow the implementation of rst 2 got lost, with hilarious results. Also fix
some register corruption issues (I hope).