ack.git
5 years agoSpend the last rst on cheap fp loading; Star Trek goes to 39456 bytes. Bodge dtrg-bcectomy
David Given [Sun, 17 Feb 2019 19:40:51 +0000 (20:40 +0100)]
Spend the last rst on cheap fp loading; Star Trek goes to 39456 bytes.  Bodge
in some experimental 8085 support, to see if that helps; Star Trek goes to
39302 bytes.

5 years agoMerge from default.
David Given [Sun, 17 Feb 2019 19:08:15 +0000 (20:08 +0100)]
Merge from default.

5 years agoMinor improvements to the way types are expanded (should avoid embarassing ands
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).

5 years agoMerge pull request #171 from davidgiven/dtrg-comparisons
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

5 years agoAdd a few minor top optimisations.
David Given [Sat, 16 Feb 2019 00:18:31 +0000 (01:18 +0100)]
Add a few minor top optimisations.

5 years agoFix typo where I was confusing sbi and sui, with hilarious results.
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.

5 years agoNot-working version of the code generator which uses bc as a normal register;
David Given [Fri, 15 Feb 2019 23:55:51 +0000 (00:55 +0100)]
Not-working version of the code generator which uses bc as a normal register;
turns out this is actually *worse* than reserving bc for the stack frame. There
are code generation bugs but I'm not going to bother fixing them.

5 years agoMerge from default.
David Given [Fri, 15 Feb 2019 23:25:33 +0000 (00:25 +0100)]
Merge from default.

5 years agoMerge pull request #170 from davidgiven/dtrg-i169
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

5 years agoFix memory corruption when using -R; the values being stored in the list
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.

5 years agoReformat before editing.
David Given [Fri, 15 Feb 2019 22:24:10 +0000 (23:24 +0100)]
Reformat before editing.

5 years agoMerge pull request #168 from davidgiven/dtrg-i167
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

5 years agoLoading large constants now computes the stack offset correctly.
David Given [Fri, 15 Feb 2019 22:03:01 +0000 (23:03 +0100)]
Loading large constants now computes the stack offset correctly.

5 years agoGenerate the proper function prologues for big stack frames.
David Given [Fri, 15 Feb 2019 22:01:33 +0000 (23:01 +0100)]
Generate the proper function prologues for big stack frames.

5 years agoMerge pull request #166 from davidgiven/dtrg-comparisons
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

5 years agoCleanup.
David Given [Fri, 15 Feb 2019 21:26:14 +0000 (22:26 +0100)]
Cleanup.

5 years agoAdd rules for converting smallnconst2 and smallpconst2 to registers, to stop
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.

5 years agoUsing regpair instead of hl_or_de is not, in fact, safe until we've stopped
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.

5 years agoFix nearly all the comparisons, a lot of which were broken. Using a rst for
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.

5 years agoCall cmps rather than cmpu for bge... make cmps and cmpu rsts. Apply various
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.

5 years agoUse nicely optimised helper tools to do signed comparisons of words. Star Trek
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.

5 years agoMerge pull request #165 from davidgiven/dtrg-b164
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

5 years agoFix bad helper tool invocation for inl with faddrn.
David Given [Thu, 14 Feb 2019 22:21:47 +0000 (23:21 +0100)]
Fix bad helper tool invocation for inl with faddrn.

5 years agoAdd failing test case.
David Given [Thu, 14 Feb 2019 22:19:11 +0000 (23:19 +0100)]
Add failing test case.

5 years agoMerge pull request #163 from davidgiven/dtrg-regmoves
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

5 years agoTurns out that every time the compiler tried to do a stack retraction with 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.

5 years agoMerge pull request #161 from davidgiven/dtrg-faststack
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

5 years agoMerge from default.
David Given [Wed, 13 Feb 2019 21:46:00 +0000 (22:46 +0100)]
Merge from default.

5 years agoInstead of using parameterised rsts for stack access, add a huge swathe of
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.

5 years agoDon't do weird things if files starting with a hyphen exist in the build
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.

5 years agoMerge pull request #160 from davidgiven/dtrg-b159
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

5 years agoFix issue with logical operations and small signed constants which turned out
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.

5 years agoUpdate test case to provoke bug.
David Given [Wed, 13 Feb 2019 19:10:38 +0000 (20:10 +0100)]
Update test case to provoke bug.

5 years agoOops! Forgot to define bc_or_de, which meant anything which tried to use that
David Given [Tue, 12 Feb 2019 23:42:47 +0000 (00:42 +0100)]
Oops! Forgot to define bc_or_de, which meant anything which tried to use that
register class couldn't find a register. Star Trek shrinks from 40513 to 40485
bytes.

5 years agoGo through the code generator telling it it's allowed to use BC. Something's
David Given [Tue, 12 Feb 2019 23:40:20 +0000 (00:40 +0100)]
Go through the code generator telling it it's allowed to use BC. Something's
terribly wrong with register moves; Star Trek shrinks from 40539 to 40513
bytes.

5 years agoRework the code generator not to use BC for the frame pointer. Star Trek is up
David Given [Tue, 12 Feb 2019 22:49:54 +0000 (23:49 +0100)]
Rework the code generator not to use BC for the frame pointer. Star Trek is up
from 40243 to 40539 bytes.

5 years agoMerge pull request #158 from davidgiven/dtrg-b157
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

5 years agoFix bad code generation due to not correctly flushing the stack before
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.

5 years agoAdded a test case for #157.
David Given [Tue, 12 Feb 2019 21:08:08 +0000 (22:08 +0100)]
Added a test case for #157.

5 years agoMerge pull request #154 from ccodere/buildfix
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

5 years agoFix compilation issue on C90 compilers (gcc 4.8 was failing to compile with default...
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.

5 years agoReplace the non-working Z80 style signed comparison sign adjustment with
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.

5 years agoMerge pull request #156 from davidgiven/dtrg-arraysizes
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

5 years agoApply Alan Cox's patch to add the 8085 extended instructions to the i80
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.

5 years agoMerge pull request #155 from davidgiven/dtrg-arraysizes
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

5 years agoSigned comparisons now work correctly; sadly, Star Trek increases from 39656 to
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.

5 years agoFix compilation issue on C90 compilers (gcc 4.8 was failing to compile with default...
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).

5 years agoMerge from default.
David Given [Sun, 10 Feb 2019 22:40:07 +0000 (23:40 +0100)]
Merge from default.

5 years agoAdd tests for simple comparisons (which i80 fails).
David Given [Sun, 10 Feb 2019 22:39:15 +0000 (23:39 +0100)]
Add tests for simple comparisons (which i80 fails).

5 years agoMerge pull request #153 from davidgiven/dtrg-i80
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

5 years agoImprove subtractions, using dad and inline constants where possible. Shrinks
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.

5 years agoSimplify simple comparisons and use inlie constants where possible. Reduces
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.

5 years agoUse pop rather than inx;inx to retract the stack; consumes a register but
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.

5 years agoTeach the i80 code generator how to do left shifts by using dad hl; prevents it
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.

5 years agoMerge pull request #152 from davidgiven/dtrg-osx
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.

5 years agoReplace mkstemp() with the more modern and safer and simpler tmpfile().
David Given [Sun, 10 Feb 2019 13:36:15 +0000 (14:36 +0100)]
Replace mkstemp() with the more modern and safer and simpler tmpfile().

5 years agofreopen() appears to be problematic on OSX; as it's only ever used to rewind
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().

5 years agoBetter error reporting.
David Given [Sun, 10 Feb 2019 13:19:18 +0000 (14:19 +0100)]
Better error reporting.

5 years agoMore common symbol removal.
David Given [Sun, 10 Feb 2019 13:09:52 +0000 (14:09 +0100)]
More common symbol removal.

5 years agoMore common symbol fixing.
David Given [Sun, 10 Feb 2019 13:03:55 +0000 (14:03 +0100)]
More common symbol fixing.

5 years agoRemoved a whole bunch of old strcpy() prototypes in favour of <string.h>.
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>.

5 years agoSecond try at removing common symbols.
David Given [Sun, 10 Feb 2019 12:11:03 +0000 (13:11 +0100)]
Second try at removing common symbols.

5 years agoChange the way external symbols are defined to avoid COMMON symbols, which
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.

5 years agoAdd stray header.
David Given [Sun, 10 Feb 2019 11:57:00 +0000 (12:57 +0100)]
Add stray header.

5 years agoRemember that we need to update the generated file in LLgen, as it's not
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...

5 years agoWe don't need depth 10 in the travis checkout.
David Given [Sun, 10 Feb 2019 11:35:18 +0000 (12:35 +0100)]
We don't need depth 10 in the travis checkout.

5 years agoDon't prototype strcpy as it makes OSX sad.
David Given [Sun, 10 Feb 2019 11:28:42 +0000 (12:28 +0100)]
Don't prototype strcpy as it makes OSX sad.

5 years agoMerge from default.
David Given [Sun, 10 Feb 2019 11:22:59 +0000 (12:22 +0100)]
Merge from default.

5 years agoAdd missing header.
David Given [Sat, 9 Feb 2019 23:45:09 +0000 (00:45 +0100)]
Add missing header.

5 years agoMerge pull request #150 from davidgiven/dtrg-windows
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.

5 years agoDon'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.

5 years agoMerge pull request #148 from davidgiven/dtrg-windows
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.

5 years agoDon't run the tests in Appveyor.
David Given [Sat, 9 Feb 2019 12:59:37 +0000 (13:59 +0100)]
Don't run the tests in Appveyor.

5 years agoMore z80ex removal.
David Given [Sat, 9 Feb 2019 12:42:09 +0000 (13:42 +0100)]
More z80ex removal.

5 years agoMerge pull request #149 from davidgiven/dtrg-arraysizes
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.

5 years agoRemove stray z80ex reference.
David Given [Sat, 9 Feb 2019 12:30:29 +0000 (13:30 +0100)]
Remove stray z80ex reference.

5 years agoAdd rst 3 to get the address of a frame variable; lots of rule overhaulage.
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.

5 years agoUgh, typo fix.
David Given [Sat, 9 Feb 2019 11:25:27 +0000 (12:25 +0100)]
Ugh, typo fix.

5 years agoMaybe the setup script is somewhere else?
David Given [Sat, 9 Feb 2019 11:23:42 +0000 (12:23 +0100)]
Maybe the setup script is somewhere else?

5 years agoTry to install cygwin packages.
David Given [Sat, 9 Feb 2019 11:17:57 +0000 (12:17 +0100)]
Try to install cygwin packages.

5 years agoAnother try at an AppVeyor build script.
David Given [Sat, 9 Feb 2019 11:04:42 +0000 (12:04 +0100)]
Another try at an AppVeyor build script.

5 years agoAdd experimental appveyor file.
David Given [Fri, 8 Feb 2019 23:07:33 +0000 (00:07 +0100)]
Add experimental appveyor file.

5 years agoRename all files called 'aux.*' to something else; Windows can't handle them.
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.

5 years agoMerge pull request #147 from davidgiven/dtrg-arraysizes
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.

5 years agoMake sign extension much less horrible.
David Given [Fri, 8 Feb 2019 22:16:57 +0000 (23:16 +0100)]
Make sign extension much less horrible.

5 years agoAdd tests for simple and, or, and xor; drastically improve the i80 code
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.

5 years agoMerge pull request #145 from davidgiven/dtrg-arraysizes
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.

5 years agoCP/M sbrk now handles overflow correctly.
David Given [Fri, 8 Feb 2019 20:43:52 +0000 (21:43 +0100)]
CP/M sbrk now handles overflow correctly.

5 years agoSomehow the implementation of rst 2 got lost, with hilarious results. Also fix
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).

5 years agoAdd a 'disassemble' command to the CP/M emulator.
David Given [Fri, 8 Feb 2019 19:54:44 +0000 (20:54 +0100)]
Add a 'disassemble' command to the CP/M emulator.

5 years agoFix swapped bytes in probyte which was causing junk stack frames.
David Given [Fri, 8 Feb 2019 07:09:55 +0000 (08:09 +0100)]
Fix swapped bytes in probyte which was causing junk stack frames.

5 years agoMerge from default.
David Given [Thu, 7 Feb 2019 22:45:47 +0000 (23:45 +0100)]
Merge from default.

5 years agoMerge pull request #146 from davidgiven/dtrg-cpmemu
David Given [Thu, 7 Feb 2019 22:45:08 +0000 (23:45 +0100)]
Merge pull request #146 from davidgiven/dtrg-cpmemu

Add a CP/M i80 emulator, and enable the cpm tests

5 years agoBuild the CP/M tests (which got turned off accidentally). Add a disassembler to
David Given [Thu, 7 Feb 2019 22:36:45 +0000 (23:36 +0100)]
Build the CP/M tests (which got turned off accidentally). Add a disassembler to
the emulator debugger.

5 years agoAdd missing file.
David Given [Thu, 7 Feb 2019 22:01:10 +0000 (23:01 +0100)]
Add missing file.

5 years agoAdd the cpm emulator from Cowgol, modified to work with an 8080 emulator rather
David Given [Thu, 7 Feb 2019 21:39:57 +0000 (22:39 +0100)]
Add the cpm emulator from Cowgol, modified to work with an 8080 emulator rather
than libz80ex; enable tests for cpm.

5 years agoAdd rst 1 to store frame variables. Reduces Star Trek from 42339 to 41821
David Given [Thu, 7 Feb 2019 08:31:38 +0000 (09:31 +0100)]
Add rst 1 to store frame variables. Reduces Star Trek from 42339 to 41821
bytes.

5 years agoFix warnings.
David Given [Thu, 7 Feb 2019 08:09:31 +0000 (09:09 +0100)]
Fix warnings.

5 years agorst 1 now takes an eight-bit parameter, not a 16 bit one. Reduces Star Trek
David Given [Thu, 7 Feb 2019 07:45:20 +0000 (08:45 +0100)]
rst 1 now takes an eight-bit parameter, not a 16 bit one. Reduces Star Trek
again from 43205 to 42339 bytes.

5 years agoExperimentally use rst 1 to optimise frame variable loads. Reduces Star Trek
David Given [Wed, 6 Feb 2019 23:06:32 +0000 (00:06 +0100)]
Experimentally use rst 1 to optimise frame variable loads. Reduces Star Trek
from 43892 to 43205 bytes.