Commit Graph

738 Commits

Author SHA1 Message Date
drmortalwombat cc927d778f Improve C const declaration compatibility 2022-01-21 14:42:49 +01:00
drmortalwombat 8b4eff3ee1 More constant folding and value propagation 2022-01-20 17:43:08 +01:00
drmortalwombat 76322c005d Fix errors introduced with strength reduction 2022-01-20 13:39:55 +01:00
drmortalwombat de562fccb6 Add carry optimizations 2022-01-15 18:09:48 +01:00
drmortalwombat de920f2418 Optimize global variable usage 2022-01-14 17:53:30 +01:00
drmortalwombat c72ca3547b Fix longjump and kernalio end of file handling 2022-01-13 10:37:44 +01:00
drmortalwombat d9946e12b9 Optimize byte size right shift 2022-01-12 15:54:50 +01:00
drmortalwombat ed37f360eb New multicolor bitmap library 2022-01-11 18:27:13 +01:00
drmortalwombat 55affa4de9 Add auto inline of functions that trivially compute to a constat with constant arguments 2022-01-10 20:05:51 +01:00
drmortalwombat 640007546f Add __assume builtin function 2022-01-08 15:51:17 +01:00
drmortalwombat 085fba137f optimize aligned address arithmetic 2022-01-06 16:26:19 +01:00
drmortalwombat d2511b558c Reoder eight bit adds 2022-01-05 20:06:25 +01:00
drmortalwombat d4a9308627 More inter code value forwarding 2022-01-05 16:38:56 +01:00
drmortalwombat 2b7c7300d7 Integer value range optimizations 2022-01-04 22:26:44 +01:00
drmortalwombat 639a33f9eb Simple loop invariant optimization for native code 2022-01-04 14:07:56 +01:00
drmortalwombat 78615c0725 Optimize cross block single evaluation 2022-01-04 11:44:01 +01:00
drmortalwombat 60ca42e759 Inner loop invariant optimization for non single block intermediate loops 2022-01-03 14:36:31 +01:00
drmortalwombat d621ab32cd Optimize space in linker when using aligned objects 2022-01-02 15:08:47 +01:00
drmortalwombat 272b7b08df Optimize more short multiplies in native code 2022-01-02 12:44:37 +01:00
drmortalwombat 7e66836e07 More samples 2021-12-30 15:41:06 +01:00
drmortalwombat 1fcc39acd5 Add sprite multiplexer 2021-12-29 20:07:13 +01:00
drmortalwombat 80fea25916 More samples 2021-12-28 13:13:05 +01:00
drmortalwombat 57c72b1788 Reduce y register pressure if x available 2021-12-27 10:49:18 +01:00
drmortalwombat 24cc6e20c8 Fix compiler getting stuck on optimizing infinite loop 2021-12-25 12:30:24 +01:00
drmortalwombat 9bd3d3391a Fix lost zero page register on y address shortcut 2021-12-24 16:54:03 +01:00
drmortalwombat 0dd6a0655c Optimize call to 8 by16 mul 2021-12-23 20:27:45 +01:00
drmortalwombat 71c574478c More integer value range optimizations 2021-12-23 14:31:58 +01:00
drmortalwombat 6b7dc15d30 Optimize short float arrays 2021-12-22 15:36:12 +01:00
drmortalwombat 183864208f More integer value range optimizations 2021-12-22 12:58:17 +01:00
drmortalwombat 05a6c71698 Value range annotation for intermediate code 2021-12-22 07:46:06 +01:00
drmortalwombat b9c477976a Strength reduction for simple native code loops with y register 2021-12-20 20:44:10 +01:00
drmortalwombat 893b6f2294 Optimize long divide for short divisor 2021-12-19 22:18:05 +01:00
drmortalwombat 4a9c662cc9 Optimize float native code size 2021-12-19 16:53:12 +01:00
drmortalwombat 6d716b9478 Optimize 32bit shifts 2021-12-18 22:21:39 +01:00
drmortalwombat 178a5e23a8 Some optimizations for on the fly asm code generation 2021-12-14 14:31:18 +01:00
drmortalwombat 4cf62a67ff Optimize jmp to rts 2021-12-12 20:34:33 +01:00
drmortalwombat fefa2e7d9a Optimize jump to rts and simple loop invariants in native code generator 2021-12-11 23:04:38 +01:00
drmortalwombat f7a5c94229 Optimize frame enter/leave code in native compiler 2021-12-11 12:52:35 +01:00
drmortalwombat a1fda2b957 Fix float parameter and return values 2021-12-09 21:38:36 +01:00
drmortalwombat 1ac0c2f46a Fix duplicat check for loop head in native code generator 2021-12-08 14:04:32 +01:00
drmortalwombat 18ab7ce079 Fix broken left shift optimization due to branch in basic block 2021-12-06 22:56:03 +01:00
drmortalwombat 695d4cf914 Minor byte code optimization for absolute arrays 2021-12-04 15:26:05 +01:00
drmortalwombat 973e13b776 Optimize absolute array addressing 2021-12-03 22:49:14 +01:00
drmortalwombat e4d24f1aa4 Some native code optimizations 2021-12-02 18:41:59 +01:00
drmortalwombat a66b3873cd Native code optimizations for global arrays 2021-12-01 23:00:57 +01:00
drmortalwombat 0b9163afbe Optimize native code branch placement 2021-12-01 20:26:28 +01:00
drmortalwombat 7e07f083a6 Fix native code jmp offsets for inline assembly 2021-12-01 08:40:36 +01:00
drmortalwombat 15c65f69aa Change runtime assembler generator use value and return instead of reference 2021-11-29 18:37:15 +01:00
drmortalwombat a6fa114a5b Add runtime assembler functions to c64 library 2021-11-29 17:43:03 +01:00
drmortalwombat 2003f2f4fd Fixed N flag thrashing due to cross block value forwarding 2021-11-27 23:33:03 +01:00
drmortalwombat 730fb7513e Fix y register thrashing in peephole optimizer 2021-11-27 15:51:17 +01:00
drmortalwombat d02b438a1a Optimize code size 2021-11-27 11:17:15 +01:00
drmortalwombat 84648fbd88 Optimizing some pointer arithmetic 2021-11-23 21:53:23 +01:00
drmortalwombat 4017cc386b Add charwin library and matching code generator optimizations 2021-11-18 14:57:43 +01:00
drmortalwombat cd77372350 Remove superfluous rts from inline assembler blocks that end with a jmp 2021-11-16 20:54:10 +01:00
drmortalwombat 2ed784ea17 Optimize signed range comparison 2021-11-13 15:05:53 +01:00
drmortalwombat cb5f5f421f Optimize single conditional path value evaluation 2021-11-09 22:24:29 +01:00
drmortalwombat 7dddcc772b Some peephole optimizing for native compiler 2021-11-08 20:18:40 +01:00
drmortalwombat 5cce611659 Fix native code inner loop detection 2021-11-08 08:45:43 +01:00
drmortalwombat 931c4d875a Reduce register copy for native code fast calls 2021-11-07 17:16:01 +01:00
drmortalwombat d99940a98e Update to version 1.1.45 2021-11-06 20:12:28 +01:00
drmortalwombat f50eb7cd19 Optimizing byte code generator 2021-11-06 17:57:24 +01:00
drmortalwombat a8ed15d67b Optimize inline pointer parameters 2021-11-05 08:46:59 +01:00
drmortalwombat a3d8c94620 Push XY register usage in shift to later optimization stage 2021-11-03 19:39:28 +01:00
drmortalwombat f862f4e084 Constant folding of pointer plus integer 2021-11-03 07:52:12 +01:00
drmortalwombat f16edb1c57 Optimize signed byte comparisons 2021-11-01 22:33:02 +01:00
drmortalwombat 40f82ba6ec Fix byte table access 2021-11-01 21:22:02 +01:00
drmortalwombat 214ebd93f2 Bump version to 1.1.44 2021-10-31 20:39:28 +01:00
drmortalwombat a52c869099 Avoid needles store to temps before function call 2021-10-31 19:37:54 +01:00
drmortalwombat 135d357dbc Strcpy as intrinsic 2021-10-31 19:14:07 +01:00
drmortalwombat 7e340cc816 Optimize static and global variable usage 2021-10-31 16:22:11 +01:00
drmortalwombat b9cbf525e9 Optimize native code XY index register usage 2021-10-30 22:29:32 +02:00
drmortalwombat 640477f88d Add peephole size optimizations 2021-10-30 10:42:41 +02:00
drmortalwombat b64079bf28 Optimize some constant shifts 2021-10-27 21:01:39 +02:00
drmortalwombat 8ab8b3c2a1 Fix negative array indices 2021-10-26 14:44:25 +02:00
drmortalwombat 342634d5e4 Fix datatflow tracking in shift optimization 2021-10-25 21:53:55 +02:00
drmortalwombat 1074c29092 Fix register spilling optimization 2021-10-24 22:27:08 +02:00
drmortalwombat 480270f4c9 Fix array to pointer cast 2021-10-24 14:58:06 +02:00
drmortalwombat 42e4f483c1 Reduce register spilling on function entry/exit 2021-10-23 22:22:49 +02:00
drmortalwombat e057e24918 Added stddef.h 2021-10-23 16:51:27 +02:00
drmortalwombat 55b79ecfce Fix struct scoping 2021-10-23 11:56:30 +02:00
drmortalwombat 33433403b1 Fix optimizer errors 2021-10-23 00:33:09 +02:00
drmortalwombat 5010043fc4 Optimize struct member access 2021-10-17 11:54:15 +02:00
drmortalwombat 3520d2a2bd Fix bugs found by llvm lint 2021-10-17 10:40:33 +02:00
drmortalwombat 1a30d044c8 Some peephole optimizations for native code 2021-10-14 21:22:03 +02:00
drmortalwombat e2e6f4ea01 Add command line options for optimization 2021-10-14 16:51:59 +02:00
drmortalwombat 3c891fb61e Fix 16 bit pointer offsets in native code 2021-10-13 22:19:27 +02:00
drmortalwombat 11af372509 More autoinline optimizations 2021-10-10 17:14:12 +02:00
drmortalwombat 32b715382c Add fascall for byte code 2021-10-08 17:41:11 +02:00
drmortalwombat 60489bb79e Refactor inter instrction operator handling 2021-10-08 09:07:01 +02:00
drmortalwombat e7231e27e0 Prepare fastcall 2021-10-07 15:14:23 +02:00
drmortalwombat fb4ae26afb Prepare access to local variables in inline assembler 2021-10-07 10:42:18 +02:00
drmortalwombat 15743d3115 Refactor temp handling in inter code 2021-10-06 17:30:41 +02:00
drmortalwombat 330e022a43 Exclude bss segment from prg file 2021-10-05 18:24:03 +02:00
drmortalwombat 542cb66693 Fixes to get dhrystone.c to compile and run 2021-10-03 20:35:50 +02:00
drmortalwombat acc87d50fe Limit inline expansion depth 2021-10-02 22:39:36 +02:00
drmortalwombat a0df4e7867 Optimize stack frame for simple functions 2021-10-02 20:56:01 +02:00
drmortalwombat 30becb541e Add long integer support in native and byte code 2021-10-02 17:22:18 +02:00
drmortalwombat 3d9302c90c Support for long integer with byte code 2021-10-02 10:06:13 +02:00
drmortalwombat 0c9992f549 Native code optimizations 2021-10-01 15:54:07 +02:00
drmortalwombat 02305e8bc5 Optimize global arrays and const comparisons 2021-09-30 20:00:47 +02:00
drmortalwombat 9dfbe405a5 Avoid frame pointer in native code if simple stack frame 2021-09-29 19:48:57 +02:00
drmortalwombat 4aa82d539b Optimize pointer increment dereference combos 2021-09-29 17:34:38 +02:00
drmortalwombat ef5cb81a18 Optimized int shifts ge eight 2021-09-29 16:31:17 +02:00
drmortalwombat e713dc5940 Direct embedding of inline assembler in native code 2021-09-28 18:35:23 +02:00
drmortalwombat c4a5dafb69 More simple loop optimisations 2021-09-28 16:24:44 +02:00
drmortalwombat 9eb5412848 Merge changes for Mac build 2021-09-27 13:38:45 +02:00
drmortalwombat bffef3e9dd Basic block tail merging 2021-09-26 13:14:56 +02:00
drmortalwombat 2fc414ed6b Byte forwardiong optimisation in native mode 2021-09-25 23:08:45 +02:00
drmortalwombat 1dd63ac708 Fix byte size inc/dec error 2021-09-25 22:50:16 +02:00
drmortalwombat 8e9b0fe54c Add simple native loop optimisation 2021-09-25 21:57:33 +02:00
drmortalwombat fd10525780 Add makefile for linux 2021-09-24 16:17:20 +02:00
drmortalwombat 5c3ff47690 Indirect address, y optimisation for short loops 2021-09-23 17:14:02 +02:00
drmortalwombat 4ca77ba41a Byte operand sizes fixes and optimizations 2021-09-22 22:49:52 +02:00
drmortalwombat 2cd9a55880 Fix various bugs related to byte size operands 2021-09-22 15:46:20 +02:00
drmortalwombat 603b62b9d3 Optimize native comparison against zero 2021-09-21 22:44:00 +02:00
drmortalwombat eebc39e53a Fix return type coercion, region based linker 2021-09-21 20:44:19 +02:00
drmortalwombat d9c565d898 Fix local variables with linker sections 2021-09-21 08:41:49 +02:00
drmortalwombat 27d7baaac2 Using linker objects and sections 2021-09-20 22:36:16 +02:00
drmortalwombat 78886f11f7 Native code peephole optimisation for commutative instructions 2021-09-20 13:02:38 +02:00
drmortalwombat c5d1e2351e Add support for assembler function as const initialiser 2021-09-19 17:24:48 +02:00
drmortalwombat 1d761886b5 Refactor intermediate instructions from value to pointer type 2021-09-15 12:01:14 +02:00
drmortalwombat 37828f2baf More byte and long preparations 2021-09-14 21:38:24 +02:00
drmortalwombat e2e20581a6 Prepare byte level optimisations 2021-09-14 16:34:48 +02:00
drmortalwombat 97bd5aa988 Merge address calc into load 2021-09-13 17:43:31 +02:00
drmortalwombat 8de4bef436 Improved value forwarding across conditiona branches 2021-09-12 22:32:31 +02:00
drmortalwombat bb4680845e Fix float x+x optimisation 2021-09-12 15:18:07 +02:00
drmortalwombat ebdd6f0d7d Add fixed offset to pointer base mem access 2021-09-12 14:17:21 +02:00
drmortalwombat 82d499fdae Native code compiler is functional same level as byte code
Runs all the autotests now in byte code and native code
2021-09-11 22:21:57 +02:00
drmortalwombat 897de02adf Fix unnamed parameters in function prototype 2021-09-11 16:05:31 +02:00
drmortalwombat 93b6aca8a3 More native code generator 2021-09-11 15:01:32 +02:00
drmortalwombat 07f797e577 Formatting options in printf 2021-09-10 16:13:47 +02:00
drmortalwombat fd1626bf16 Byte level dataflow analysis of native code 2021-09-09 23:13:03 +02:00
drmortalwombat f08d847a64 More native code optimisations 2021-09-09 20:23:59 +02:00
drmortalwombat 3442ee507a Fix floating point native code generation 2021-09-09 09:42:02 +02:00
drmortalwombat fcedf69aff More native code compiler additions 2021-09-08 22:04:01 +02:00
drmortalwombat 056df56eef First shot native code generator
Implements basic load, store compare and add/sub/shift for native compiled functions
2021-09-07 22:35:11 +02:00
drmortalwombat 722347609d Fix array of array of char init with strings 2021-09-07 13:37:56 +02:00