Commit graph

  • 9333b323a5 Make the MIPS boot code produce correct code. David Given 2018-09-18 23:39:04 +0200
  • d23d2dd1b3 Loads and stores (except longs, which are difficult) are now loaded with two instructions rather than three. David Given 2018-09-18 23:38:37 +0200
  • 52ee317878 Fixed some bad mcg ir code generation: only nodes which have been appendir'd may be used multiple times. David Given 2018-09-18 23:32:53 +0200
  • 692caa2b0a Add unsigned comparison rules. David Given 2018-09-18 00:19:40 +0200
  • f362d12dee Add extern declaration which I forget to check in. David Given 2018-09-17 23:59:49 +0200
  • fe177bd688 Add specialist rules for signed integer comparisons; much better code. David Given 2018-09-17 23:53:18 +0200
  • ec0891469f Array descriptor ranges are inclusive; adjust aar and the tests to check for this. All the tests except rotate build now! David Given 2018-09-17 19:34:38 +0100
  • f61500c51b Fix lar and sar, which were horribly, horribly broken. Add tests. David Given 2018-09-17 18:44:17 +0100
  • abb7e3e105 Fix aar; add test. David Given 2018-09-17 16:59:45 +0100
  • b665efca04 ACK loi 1 and sti 1 load and store unsigned bytes. I think. David Given 2018-09-17 15:03:44 +0100
  • c2dc1e184e rotate() now generates valid code. David Given 2018-09-17 13:13:39 +0100
  • 0202ac8700 Fix bls4. David Given 2018-09-17 12:53:27 +0100
  • 1e073e944a Added cms, and a test for it. David Given 2018-09-17 12:42:10 +0100
  • 0b65591972 Add hacky 64-bit comparisons (used by M2). David Given 2018-09-17 12:16:17 +0100
  • 15ae171aef Added a test for set. Fix mips set implementation. David Given 2018-09-17 11:56:15 +0100
  • 7efb749003 Set fixes; also add discrete tests for and, ior, xor. David Given 2018-09-14 14:13:35 +0100
  • 08b1e8d71b Make inn work; fix broken 64-bit loads and stores. David Given 2018-09-14 13:48:43 +0200
  • 5d0876a30b Implement a working .trp. David Given 2018-09-14 12:26:27 +0200
  • ba0849c87c Remove la; turns out that the assembler gets upset if you ask it to generate more than one fixup per instruction (I think). David Given 2018-09-14 11:30:15 +0200
  • ac33bdd031 Clang-format before editing. David Given 2018-09-14 09:28:35 +0200
  • c4e3d0903e Bugfix rck. David Given 2018-09-14 00:38:31 +0200
  • 8c0b2f8aee Fix csa and csb. David Given 2018-09-14 00:15:43 +0200
  • 9b0a1c1c10 Make work with clang. David Given 2018-09-14 00:04:25 +0200
  • 57338b1991 Fix an incorrect instruction, and incredibly broken li handling. David Given 2018-09-12 23:59:09 +0200
  • ecb3395aba Converting floats and doubles to integers now works, as much as these ever do on MIPS; turns out that it can't (or at least can't in qemu) reliably turn INT_MIN from a double to an int. David Given 2018-09-12 23:58:48 +0200
  • 642956fa2f mcg now uses dataf4 and dataf8 to emit floating point constants, and so doesn't need flt_arith any more. (And also generates them correctly on little-endian systems.) as now parses numbers properly, doesn't trash memory all over the place, and can handle negative numbers. David Given 2018-09-12 23:19:32 +0200
  • 8105281534 Make sure li works properly when loading fixed up values which end up as 0. Use lui rather than li to load high values. David Given 2018-09-12 22:28:40 +0200
  • a8df9721d3 Adding new tokens to the assembler isn't quite as easy as I thought: ensure that NUMBERF is stored properly in the temporary file. David Given 2018-09-12 22:27:39 +0200
  • 5264db860d Values are more useful shown in hex. David Given 2018-09-11 23:17:09 +0200
  • 8379969b6f Fix an unsubtle bug where subtractions were done backwards... David Given 2018-09-11 23:16:50 +0200
  • 8230ec42ac Fix a subtle thinko which was causing bits 2-3 of jump targets to be reset. David Given 2018-09-11 23:16:30 +0200
  • b81e060372 Add huge numbers of failing tests. David Given 2018-09-10 23:40:03 +0200
  • 0ce368324e Add the bitset helpers. We now have enough helpers for the tests to run (and massively fail). David Given 2018-09-10 23:37:28 +0200
  • 2f8fe3ce6e Do some cleanup; ha16[] and friends can now be used with li. David Given 2018-09-10 23:37:04 +0200
  • 3122946a6f Replaced some incorrect hi16s with ha16s. David Given 2018-09-10 23:21:54 +0200
  • 008737ed19 Added some more very untested helper functions. David Given 2018-09-10 23:20:52 +0200
  • a1747ac916 Add the .dataf4 and .dataf8 directives to the assembler --- manually converting floats and doubles to bytes is not fun. It might even work! David Given 2018-09-10 22:56:18 +0200
  • 53f7de794a Ansify. David Given 2018-09-10 22:55:05 +0200
  • 9733454d8e Clang-format before editing. David Given 2018-09-10 22:42:30 +0200
  • 976fa0efca Clang-format before editing. David Given 2018-09-10 22:37:04 +0200
  • 6275896a11 Clang-format before editing. David Given 2018-09-10 22:25:14 +0200
  • 185e910246 Lots more untested helper functions. David Given 2018-09-10 01:08:25 +0200
  • f8f6fa9fc1 Added some more incredibly untested helper functions. David Given 2018-09-10 00:21:16 +0200
  • ee328a0572 Merge from default. David Given 2018-09-09 18:58:07 +0200
  • 776e93221f Thinko fix. David Given 2018-09-09 18:57:44 +0200
  • c769fbec93 Use the correct ELF processor flags; align properly. David Given 2018-09-09 18:57:35 +0200
  • f3bc9ef92a Call proper Linux system calls proper-like. David Given 2018-09-09 18:57:12 +0200
  • bb15c03339 Remember to preserve input registers if we're going to be reading from them after writing to the output register. David Given 2018-09-09 18:53:49 +0200
  • 79fd34dac6 Call atexit handlers properly, avoiding a NPE and seg fault every time a program exits. David Given 2018-09-09 18:51:00 +0200
  • e88670dad4 Yikes! Turns out that FPU registers are only 32 bits wide, and doubles are stored in pairs, just like on the PowerPC! David Given 2018-09-09 18:25:00 +0200
  • ec46643124 Allow the ELF processor flags to be set. Generate MIPS ELF executables, not PowerPC ones. David Given 2018-09-09 14:29:34 +0200
  • 5dfef6f180 Rework relocations again: add RELO2HI and RELO2HISAD for the high two bytes of a word. David Given 2018-09-09 14:11:11 +0200
  • 95dd6f0141 Fix some niggling issues --- we have our first binary now! David Given 2018-09-09 12:24:22 +0200
  • b3b7c684c6 Simplify MIPS relocations. Add RELS2 (for generic high-word relocations). Add support for MIPS branch-and-jump relocations. David Given 2018-09-09 12:23:59 +0200
  • 0d8d98fd0f Warning fix. David Given 2018-09-09 12:22:59 +0200
  • d2a1d4dcda Added some very untested csa and csb implementations, based on the PowerPC ones. David Given 2018-09-08 23:12:57 +0200
  • 75308901bc Added hi[] and lo[] functions to the assembler; fix things enough that we now get to the point of failing to link programs. David Given 2018-09-08 22:42:06 +0200
  • 379c1a4a3c Rework floating point conversion. Bash enough of the table into workingness that the libraries build now. David Given 2018-09-08 22:06:38 +0200
  • d2c14ca44f Precisely one stack hreg gets allocated for each vreg/congruence group for eviction; this prevents us from having to worry about moving values from stack slot to stack slot, which is hard. David Given 2018-09-08 18:59:55 +0200
  • b7a1c96986 MIPS appears to hate converting unsigneds to floats and vice versa. David Given 2018-09-05 23:53:38 +0200
  • fc0b0ae178 (Slightly) better errors on phi congruence group mismatches. David Given 2018-09-05 23:53:08 +0200
  • 7fbce066f8 We attempt to compile the first library function; we fail. David Given 2018-09-05 00:13:01 +0200
  • 26fe3f7530 Added library skeletons. David Given 2018-09-05 00:07:07 +0200
  • 98afb42095 Added a boot.o based on the PowerPC one. David Given 2018-09-05 00:00:13 +0200
  • 26c0228b14 The examples all compile now (probably incorrectly, and the libc doesn't compile yet). David Given 2018-09-04 23:55:28 +0200
  • 9d80756253 Lots of assembler and rule bugfixing. David Given 2018-09-04 23:43:24 +0200
  • fe5ca5a85f Added li and la instructions. David Given 2018-09-03 22:47:41 +0200
  • 26f9b4ceae Add in floating point support to the code generator. David Given 2018-09-03 22:06:05 +0200
  • 83cf1be6a8 mcgg now checks that registers have at most one type attribute set. David Given 2018-09-03 22:03:57 +0200
  • f8e71d888b Add some painfully untested FPU instructions. David Given 2018-09-02 21:36:09 +0200
  • 1d6ecddcf4 The MIPS backend is still full of holes, and cut-and-pasted PowerPC code, but is beginning to look like an actual code generator. David Given 2018-09-02 18:57:25 +0200
  • a023fd8591 Better error reporting for unterminated strings. David Given 2018-09-02 18:55:44 +0200
  • 2eaca39322
    Merge pull request #120 from davidgiven/dtrg-no David Given 2018-09-02 13:15:11 +0200
  • b76352de99 Remove stray #include. David Given 2018-09-02 12:54:53 +0200
  • cb983fac44 Rip out the built-in preprocessor from cemcom.ansi, now it's no longer used. David Given 2018-09-02 12:50:50 +0200
  • 6931ffa5a4 Disable the built-in preprocessor in cemcom.ansi; the external preprocessor is always run. Fix a bug in block skipping in the preprocessor. David Given 2018-09-02 12:39:00 +0200
  • f8fc5bc3d8 Implement single-line C++-style comments. David Given 2018-09-02 12:14:59 +0200
  • 0e9736fdca Run through clang-format before editing. David Given 2018-09-02 12:04:33 +0200
  • 274ed3cb6a Run through clang-format before editing. David Given 2018-09-02 11:49:40 +0200
  • dd00b81080 Run files through clang-format before editing. David Given 2018-09-02 11:36:15 +0200
  • fa1ba55ad2 Convert CRLF into LF on read; this should avoid problems with parsing CRLF files. David Given 2018-09-02 11:30:20 +0200
  • 788f439a48 Run files through clang-format before editing. David Given 2018-09-02 11:16:06 +0200
  • 4741ed8e14 Add a completely non-tested table-based MIPS assembler. David Given 2018-09-01 19:35:31 +0200
  • bed39e1f4d Merge. David Given 2018-09-01 15:34:36 +0200
  • 1d9f9074d9 The default installation location should be /usr/local. David Given 2018-09-01 15:34:01 +0200
  • 7dc4c16521
    Merge pull request #112 from davidgiven/dtrg-te David Given 2018-09-01 11:49:28 +0200
  • 6f74f1caf3 Disable the msys32 build because it doesn't work (due to brk issues). David Given 2018-09-01 11:43:52 +0200
  • f09182eb37 Another typo fix. David Given 2018-09-01 11:34:29 +0200
  • 269484f64a Typo fix. David Given 2018-09-01 11:32:26 +0200
  • b57900c638 Experiment with a build matrix and msys32. David Given 2018-09-01 11:31:45 +0200
  • a7719a8fe6 Add bison and flex. David Given 2018-09-01 11:25:03 +0200
  • bc1a639697 No luck with ninja --- make should work? David Given 2018-09-01 11:23:39 +0200
  • e4ba155886 Update apt before installing. David Given 2018-09-01 11:19:16 +0200
  • 0a735d43e6 Typo fix. David Given 2018-09-01 11:18:25 +0200
  • e886186890 Cygwin setup is very slow, so put sh-on-windows first for testing. David Given 2018-09-01 11:17:50 +0200
  • d1a00f2f48 Let's try sh-on-windows as well. David Given 2018-09-01 11:12:14 +0200
  • 10785e9791 msys32 doesn't work; try Cygwin instead. David Given 2018-09-01 11:07:28 +0200
  • 2666268af7 Install ninja before building. David Given 2018-09-01 11:04:12 +0200
  • 5377c1cc82 Looks like sh-on-windows isn't working. David Given 2018-09-01 11:02:48 +0200
  • ccde733793 Add a drone.yml for tea-ci. David Given 2018-09-01 11:00:08 +0200