Commit Graph

201 Commits

Author SHA1 Message Date
drmortalwombat 4daecdc51a Optimize select statement 2022-10-03 18:56:17 +02:00
drmortalwombat bcc59a9afb Add intermediat code select operator 2022-07-02 14:53:00 +02:00
drmortalwombat 350403121d Move load temporary register moves out of loops 2022-06-26 15:15:59 +02:00
drmortalwombat 002c10ad13 Optimize array access and value propagation across simple loops 2022-06-21 20:57:58 +02:00
drmortalwombat beb8d8e6d7 Fix crash on error messages with unnamed objects 2022-06-06 22:06:57 +02:00
drmortalwombat 3351ee81cc Extend static stack allocation to zero page spilling 2022-05-22 13:22:36 +02:00
drmortalwombat 29bd0c8d2d Optimizations for global variables 2022-05-07 14:03:56 +02:00
drmortalwombat 7aec7f5c50 Fix crash compiling indexed memcpy size 2022-04-25 21:22:25 +02:00
drmortalwombat f619c5e0ab More verbose debug output 2022-04-25 07:57:31 +02:00
drmortalwombat 8f32b87b18 Fix call of function pointers in array 2022-04-13 16:29:36 +02:00
drmortalwombat 72264109e9 Add experimental zero page allocation for global variables 2022-04-06 19:16:44 +02:00
drmortalwombat 5a1ff68926 Fix binary and/or with boolean values, now raising a warning 2022-03-30 14:58:41 +02:00
drmortalwombat d2503aaf1f Constant folding address of global and static variables 2022-03-27 17:18:44 +02:00
drmortalwombat fc5c9f137a Add indexed const array initializer 2022-03-26 10:29:48 +01:00
drmortalwombat 4538f0295d Fix byte to long conversion 2022-03-20 21:33:58 +01:00
drmortalwombat 13f3ea57a3 Fix signed unsigned shift with mixed signed arguments 2022-03-19 19:46:40 +01:00
drmortalwombat a65c802485 Address promotion into struct copy inter instructions 2022-03-14 08:35:59 +01:00
drmortalwombat 6fe9a4f167 Fastcall optimization for 2nd and 3rd level calls 2022-03-10 16:35:35 +01:00
drmortalwombat b43edb2b4c Avoid inlining of native functions into byte code 2022-03-09 20:27:11 +01:00
drmortalwombat 6bd3ecb689 Fix over eager const expression inliner 2022-02-19 12:16:33 +01:00
drmortalwombat 1221649a3d Add check for __interrupt attribute on function pointers call from interrupt code 2022-02-15 09:49:46 +01:00
drmortalwombat fdb112a037 Add constant address calculation for struct members 2022-02-14 20:13:30 +01:00
drmortalwombat d4352ef043 Add __hwinterrupt function decoration 2022-02-06 10:28:09 +01:00
drmortalwombat 5147ec6bc9 Fix function pointers in struct consts 2022-02-05 16:52:54 +01:00
drmortalwombat 60165a7fc3 Add "*" symbol for current address in inline assembler 2022-01-29 13:33:57 +01:00
drmortalwombat dfe3d71f85 Make shore memcpy calls intrinsic 2022-01-27 23:08:57 +01:00
drmortalwombat 79a841a422 Mark vic registers as volatile 2022-01-27 16:38:47 +01:00
drmortalwombat 5c8b1c6daf Add __export, __native and __interrupt storage class specifiers 2022-01-26 21:48:19 +01:00
drmortalwombat cc927d778f Improve C const declaration compatibility 2022-01-21 14:42:49 +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 68f8628409 Optimize size of generated byte code 2022-01-09 19:00:02 +01:00
drmortalwombat 640007546f Add __assume builtin function 2022-01-08 15:51:17 +01:00
drmortalwombat 71c574478c More integer value range optimizations 2021-12-23 14:31:58 +01:00
drmortalwombat 6d716b9478 Optimize 32bit shifts 2021-12-18 22:21:39 +01:00
drmortalwombat a1fda2b957 Fix float parameter and return values 2021-12-09 21:38:36 +01:00
drmortalwombat cf9f38d4dc Fix stacked fastcall invokation 2021-12-09 12:11:36 +01:00
drmortalwombat 75ea2ee439 Add PETSCII string literals 2021-12-06 20:54:11 +01:00
drmortalwombat 5549096cf7 Limit binary and, or and xor of byte operands to byte operations 2021-11-29 22:07:35 +01:00
drmortalwombat 5cce611659 Fix native code inner loop detection 2021-11-08 08:45:43 +01:00
drmortalwombat 180da3de4a Fix array[] parameters in functions 2021-11-04 08:29:54 +01:00
drmortalwombat 099f3b8a26 Fixe unsigned byte signed const comparison 2021-11-02 17:18:24 +01:00
drmortalwombat 2cd7956736 Remove stores to global variables that are never read 2021-11-01 16:08:37 +01:00
drmortalwombat d3cba85efe Optimize global variable alias analysis 2021-11-01 12:42:03 +01:00
drmortalwombat 135d357dbc Strcpy as intrinsic 2021-10-31 19:14:07 +01:00
drmortalwombat b9cbf525e9 Optimize native code XY index register usage 2021-10-30 22:29:32 +02:00
drmortalwombat b64079bf28 Optimize some constant shifts 2021-10-27 21:01:39 +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 7927df6d41 Fix call/return 2021-10-20 23:03:37 +02:00
drmortalwombat 6481e119e4 Fix various errors triggered by fuzzing 2021-10-17 18:20:44 +02:00
drmortalwombat 3520d2a2bd Fix bugs found by llvm lint 2021-10-17 10:40:33 +02:00
drmortalwombat 194c7a2af4 Fix int + pointer operation 2021-10-16 23:07:28 +02:00
drmortalwombat 001e50ae08 Complete function struct return 2021-10-16 19:46:04 +02:00
drmortalwombat ed52725a01 Remove copies from struct function return 2021-10-16 18:17:54 +02:00
drmortalwombat 19a54432f6 Struct function return value 2021-10-16 16:45:08 +02:00
drmortalwombat 438a926b88 Code size optimization 2021-10-15 21:52:07 +02:00
drmortalwombat 9e7773a0f9 Add warning for constant out of bound array access 2021-10-14 18:15:04 +02:00
drmortalwombat b415d02907 Add binary tree evaluation for large switch statements 2021-10-14 17:52:18 +02:00
drmortalwombat e2e6f4ea01 Add command line options for optimization 2021-10-14 16:51:59 +02:00
drmortalwombat fc0f8e2442 Fix conditional operator with pointes and arrays 2021-10-14 13:15:10 +02:00
drmortalwombat 5372d49b50 Petscii translation in stdio and conio 2021-10-12 17:54:10 +02:00
drmortalwombat d493bddf8d Improve inline assembler parser 2021-10-10 20:51:21 +02:00
drmortalwombat 11af372509 More autoinline optimizations 2021-10-10 17:14:12 +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 4a822facaa Optimize inline expansion 2021-10-03 11:36:26 +02:00
drmortalwombat acc87d50fe Limit inline expansion depth 2021-10-02 22:39:36 +02:00
drmortalwombat bf825302aa Add function inline expansion 2021-10-02 22:04:42 +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 bc4aea064a Add missing mac include 2021-09-29 08:02:20 +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 f925833884 Move executable into bin folder for windows and linux 2021-09-25 18:20:32 +02:00
drmortalwombat fd10525780 Add makefile for linux 2021-09-24 16:17:20 +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 eebc39e53a Fix return type coercion, region based linker 2021-09-21 20:44:19 +02:00
drmortalwombat 1d64404b24 Change format of error messages 2021-09-21 14:55:11 +02:00
drmortalwombat 27d7baaac2 Using linker objects and sections 2021-09-20 22:36:16 +02:00
drmortalwombat 10bb751449 Fix struct over header boundaries 2021-09-19 20:00:36 +02:00
drmortalwombat c5d1e2351e Add support for assembler function as const initialiser 2021-09-19 17:24:48 +02:00
drmortalwombat fae377132f Fix assembler label low/high byte immediate 2021-09-19 16:08:38 +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 87ccd5e221 More autotest 2021-09-12 16:05:23 +02:00
drmortalwombat dac1fa70b3 Fix array const init by string literal 2021-09-12 14:42:02 +02:00
drmortalwombat 8031ad8dee Add union 2021-09-12 10:04:37 +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 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 14f6af66af Fixed array and structure initialisation of locals 2021-09-07 12:44:45 +02:00
drmortalwombat 16aa0ac315 Renamed non conforming member variables 2021-09-06 21:36:45 +02:00
drmortalwombat 7af458832b Initial commit 2021-09-06 18:34:52 +02:00