Commit Graph

241 Commits

Author SHA1 Message Date
Károly Balogh
358f8eb85d m68k: do not internalerror on localsize < 0. this condition is handled elsewhere in the compiler properly, so we just let it through
git-svn-id: trunk@36612 -
2017-06-29 00:11:19 +00:00
Károly Balogh
02ed753fab m68k: yet another attempt to fix small struct alignments on stack
git-svn-id: trunk@36605 -
2017-06-27 02:36:55 +00:00
Károly Balogh
8a8753eb79 m68k: reenabled some safety checks and removed obsolete TODO comment
git-svn-id: trunk@36604 -
2017-06-26 19:45:11 +00:00
Károly Balogh
d5e1b391f9 m68k: when calling g_concatcopy for para copy, still only copy cgpara.intsize amount of bytes
git-svn-id: trunk@36603 -
2017-06-26 19:40:13 +00:00
Károly Balogh
22ae3cd186 m68k: revert the r36568 and the followup fix attempts altogether, as they broke Amiga support entirely. there will be a cleanup before another fixing attempt
git-svn-id: trunk@36598 -
2017-06-26 16:02:26 +00:00
Károly Balogh
b481129f4e m68k: for cdecls with the SVR4 ABI return results both in A0 and D0
git-svn-id: trunk@36588 -
2017-06-23 19:21:20 +00:00
Károly Balogh
8ed84afdd4 m68k: try to fix some breakages caused by r36568
git-svn-id: trunk@36569 -
2017-06-22 02:11:42 +00:00
Károly Balogh
23f4304881 m68k: hopefully fix passing of smaller-than-alignment sized records/structs for stdcall/cdecl
git-svn-id: trunk@36568 -
2017-06-22 01:14:02 +00:00
Károly Balogh
e0cbd48785 m68k: always check the V flag after MUL/DIV overflows, because MUL/DIV never sets the C flag. note that this fix is full 68k only. on CF, MUL doesn't set any of V or C flags
git-svn-id: trunk@36496 -
2017-06-12 23:56:05 +00:00
Károly Balogh
6ca8b1374b m68k: quickfix the 68000 builds of the compiler after r36344
git-svn-id: trunk@36346 -
2017-05-26 18:26:58 +00:00
Károly Balogh
829b2fc3b3 m68k: enable 68020 codepaths to all CPUs supporting '020 features
git-svn-id: trunk@36335 -
2017-05-25 20:54:18 +00:00
Károly Balogh
aa87e911d7 m68k: fixed some copypaste error in a disabled debug string. no functional changes.
git-svn-id: trunk@36329 -
2017-05-25 15:12:28 +00:00
Károly Balogh
7ed9b9f188 m68k: instead of the FPU, use CPU instructions to copy cgparas to stack
git-svn-id: trunk@36289 -
2017-05-21 21:09:47 +00:00
Károly Balogh
94b684daee m68k: reworked flags2reg, so it generates shorter code for the most common case.
git-svn-id: trunk@36233 -
2017-05-16 23:15:05 +00:00
Károly Balogh
ca1ec0435d m68k: fixed the signedness of conditional jumps while creating the jump list for case statements
git-svn-id: trunk@36210 -
2017-05-14 22:27:09 +00:00
Károly Balogh
6d795df166 m68k: removed silly debug writeln accidentally left in r35671
git-svn-id: trunk@35673 -
2017-03-28 11:57:17 +00:00
Károly Balogh
21468861d4 m68k: handle more reg_ref and ref_reg operations more flexibly on the cg level. these OPs should get utilized better with some of the upcoming inline nodes
git-svn-id: trunk@35671 -
2017-03-28 09:57:14 +00:00
Károly Balogh
2e9d0543df m68k: do not generate copy loops for single byte copies on a plain '000
git-svn-id: trunk@35281 -
2017-01-13 15:41:21 +00:00
Károly Balogh
74c1f2aec9 m68k: cosmetics (less C-ism)
git-svn-id: trunk@35001 -
2016-11-27 20:31:11 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
Károly Balogh
57e6cef18b m68k: enabled the mul to shift+sub/add optimizations for 68000
git-svn-id: trunk@34762 -
2016-10-23 23:46:32 +00:00
Károly Balogh
4620d9b22c m68k: when loading from a reference with zero extend, clear the register first, then load, instead of clearing with AND later, because this is faster on slow 68ks and also shorter
git-svn-id: trunk@34761 -
2016-10-23 23:16:03 +00:00
Károly Balogh
def4df9791 m68k: fixed a bug, where during during unaligned stores, the base address was preinitalized to a temp address register from the wrong reference, causing havoc
git-svn-id: trunk@34584 -
2016-10-01 14:43:47 +00:00
Károly Balogh
ed13f4d0d1 m68k: add a function to optimize const MUL cases to sequences of shifts + ADD/SUB. mainly for '000 and other low end 68ks with slow/limited MUL capabilities. inactive for now, as it wasn't that extensively tested
git-svn-id: trunk@34560 -
2016-09-25 19:46:00 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Károly Balogh
2eeb078f3e m68k: removed obsolete and wrong comment. the '881 extended type is actually 12 bytes during load/store, not 10, which means longword alignment is fine. no functional changes.
git-svn-id: trunk@33910 -
2016-06-05 07:11:23 +00:00
Károly Balogh
a561ffe836 m68k: fixed initial offset adjustment for the unaligned store
git-svn-id: trunk@33860 -
2016-05-31 00:47:57 +00:00
Károly Balogh
2d6736e40e m68k: fixed unaligned stores' predecrement addressing. also removed an unnecessary sign-extension of the tmpreg for 16bit stores
git-svn-id: trunk@33853 -
2016-05-29 18:25:33 +00:00
Károly Balogh
62e0eab89b m68k: also handle large register save/restore offsets on 68000
git-svn-id: trunk@33808 -
2016-05-26 00:04:55 +00:00
Károly Balogh
0dd5beb064 m68k: more unaligned access support in the base cg, also enabled the code
git-svn-id: trunk@33807 -
2016-05-26 00:03:25 +00:00
Károly Balogh
5acd04d284 m68k: some experimental code for the unaligned access support on plain 68000. work in progress, inactive code for now
git-svn-id: trunk@33744 -
2016-05-22 00:32:41 +00:00
Károly Balogh
786aecabeb m68k: improved a_op_reg_ref, to support more operations. implemented a_op_ref_reg
git-svn-id: trunk@33739 -
2016-05-21 16:41:13 +00:00
Károly Balogh
3b4822d320 m68k: utilize MVS and MVZ instructions to load values from references with zero/sign extend when they're available
git-svn-id: trunk@33656 -
2016-05-05 23:55:50 +00:00
Károly Balogh
2e9ed396b4 m68k: convert non-int paraloc sizes to int in a_load_ref_cgpara, fixes build breaks with softfpu since r33651
git-svn-id: trunk@33653 -
2016-05-05 02:33:54 +00:00
Károly Balogh
1e6e5a1874 m68k: implemented a_load64_reg_ref and a_load64_ref_reg. avoids duplicated reference simplifications in the generated code during 64bit load/store
git-svn-id: trunk@33652 -
2016-05-05 00:58:21 +00:00
Károly Balogh
2b250a1b0a m68k: use a_load_ref_ref in a_load_ref_cgpara instead of a custom loading code which does the same. causes no changes in generated code
git-svn-id: trunk@33651 -
2016-05-05 00:55:52 +00:00
Károly Balogh
88e14dc456 m68k: only extend the dest reg to tosize during reg-reg moves. this removes a large amount of unnecessary sign and zero extensions from the generated code. this was attempted before, but thanks to other fixes it no longer causes testsuite regressions
git-svn-id: trunk@33648 -
2016-05-04 09:52:27 +00:00
Károly Balogh
92b2cf917d m68k: when saving/restoring FPU registers, use the right FPU register size on ColdFire to calculate the stored size
git-svn-id: trunk@33614 -
2016-05-02 14:18:30 +00:00
Károly Balogh
aa8b45904e m68k: use the existing g_call infrastructur to handle the register allocation in the helpers
git-svn-id: trunk@33589 -
2016-05-01 10:42:52 +00:00
Károly Balogh
0b7464e4cd m68k: fix large const loading to address registers
git-svn-id: trunk@33588 -
2016-05-01 10:41:40 +00:00
Károly Balogh
f48747adf5 m68k: reworked cg.g_concatcopy. generates shorter and faster code in most cases now.
git-svn-id: trunk@33575 -
2016-04-30 00:15:34 +00:00
Károly Balogh
4287f81b92 m68k: support and use float TResFlags in the rest of the CG. ColdFire FPU now works, and FSxx is no longer generated which is software supported on '060, and doesn't exist on CF. if we still want to support it later, we can add it to cg.g_flags2reg
git-svn-id: trunk@33558 -
2016-04-25 23:40:44 +00:00
Károly Balogh
9d2dad2463 m68k: added cpu type cfv4e, which is the only ColdFire with FPU, and GNU AS needs this to actually allow CF FPU code
git-svn-id: trunk@33556 -
2016-04-25 22:04:05 +00:00
Károly Balogh
bd564b8933 m68k: some code to support the ColdFire v4e FPU. not functional yet.
git-svn-id: trunk@33533 -
2016-04-18 03:25:32 +00:00
Károly Balogh
4e964c2ed7 m68k: rewrote fixref and a_load_ref_ref, fixing a bunch of problems on ColdFire, unifying and simplifying the code a lot, and hopefully not killing anything in the process
git-svn-id: trunk@33446 -
2016-04-08 03:27:19 +00:00
Károly Balogh
1e0763e251 m68k: use a_load_const_ref in a_load_const_cgpara to utilize the recently added optimized small const loading here too. this change alone shaves off ~80KB from the compiled FP IDE size...
git-svn-id: trunk@32841 -
2016-01-03 23:48:06 +00:00
Károly Balogh
185ee93312 m68k: if we're loading small (8 bit signed) values into long references, move them through a register (usually with MOVEQ). this is two bytes shorter and also faster on most 68k CPUs
git-svn-id: trunk@32837 -
2016-01-03 18:32:27 +00:00
Károly Balogh
c82328e3fd m68k: implemented tcg68k.check_register_size for future use. use R_SUBNONE for FPU registers, because R_SUBWHOLE will change. use isregoverlap in a_load_reg_reg
git-svn-id: trunk@32658 -
2015-12-13 19:18:39 +00:00
Károly Balogh
3c0dca44d3 m68k: fixed a copypaste fail in tcg68k.g_restore_registers, which affected FPU register restoring
git-svn-id: trunk@32651 -
2015-12-13 13:15:51 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00