Commit Graph

249 Commits

Author SHA1 Message Date
Károly Balogh
ab4f34e3ff * Merging recent m68k FPU fixes from trunk: r42829, r48413, r48414, r48522, r48523, r48524
git-svn-id: branches/fixes_3_2@48666 -
2021-02-13 13:01:21 +00:00
pierre
030e93414c Merge commit r43165
------------------------------------------------------------------------
r43165 | pierre | 2019-10-10 21:57:07 +0000 (Thu, 10 Oct 2019) | 1 line

 Fix m68k errors with -CriotR option
------------------------------------------------------------------------
--- Merging r43165 into '.':
U    compiler/m68k/cgcpu.pas
U    compiler/m68k/ra68kmot.pas
--- Recording mergeinfo for merge of r43165 into '.':
 U   .

git-svn-id: branches/fixes_3_2@43516 -
2019-11-20 09:49:22 +00:00
Jonas Maebe
3ac703506c * rest of the previous accidental partial commit
git-svn-id: branches/fixes_3_2@41250 -
2019-02-07 19:56:21 +00:00
pierre
92cd9502ef Merge of revisions 40277
40307
40309
40314
40319
40322
40324
40326
40377
40378 from trunk to fixes_3_2
------------------------------------------------------------------------
r40277 | pierre | 2018-11-08 20:18:30 +0000 (Thu, 08 Nov 2018) | 1 line

 Implement mark_write override for tinilinenode
------------------------------------------------------------------------
--- Merging r40277 into '.':
U    compiler/ninl.pas
--- Recording mergeinfo for merge of r40277 into '.':
 U   .
------------------------------------------------------------------------
r40307 | pierre | 2018-11-13 15:10:21 +0000 (Tue, 13 Nov 2018) | 6 lines

  + Introduce PPC_SUFFIXES, new make variable that lists all ppc suffixes
    for all different CPUs supported.
  * Use PPC_SUFFIXES in execlean and CPU_clean targets.
  * Also delete CPU/bin subbirectory.


------------------------------------------------------------------------
--- Merging r40307 into '.':
U    compiler/Makefile
U    compiler/Makefile.fpc
--- Recording mergeinfo for merge of r40307 into '.':
 G   .
------------------------------------------------------------------------
r40309 | pierre | 2018-11-13 15:51:32 +0000 (Tue, 13 Nov 2018) | 1 line

 Try to avoid expectloc not set after first pass error for call node
------------------------------------------------------------------------
--- Merging r40309 into '.':
U    compiler/ncal.pas
--- Recording mergeinfo for merge of r40309 into '.':
 G   .
------------------------------------------------------------------------
r40314 | pierre | 2018-11-14 13:13:19 +0000 (Wed, 14 Nov 2018) | 4 lines

  * Change first parameter type of function is_continuous_maks to aword type.
    Add typecasts where needed to allow for successful compilation of arm-linux target
    with -CriotR options when building the compiler.

------------------------------------------------------------------------
--- Merging r40314 into '.':
U    compiler/arm/cpubase.pas
U    compiler/arm/cgcpu.pas
--- Recording mergeinfo for merge of r40314 into '.':
 G   .
------------------------------------------------------------------------
r40319 | pierre | 2018-11-15 16:58:40 +0000 (Thu, 15 Nov 2018) | 1 line

 Disable range check in m68k:tiscv32 and riscv64 cgcpu units
------------------------------------------------------------------------
--- Merging r40319 into '.':
   C compiler/riscv64
U    compiler/m68k/cgcpu.pas
   C compiler/riscv32
--- Recording mergeinfo for merge of r40319 into '.':
 G   .
Summary of conflicts:
  Tree conflicts: 2
------------------------------------------------------------------------
r40322 | pierre | 2018-11-15 22:01:25 +0000 (Thu, 15 Nov 2018) | 1 line

 Also disable range checking in arm/aoptcpu unit
------------------------------------------------------------------------
--- Merging r40322 into '.':
U    compiler/arm/aoptcpu.pas
--- Recording mergeinfo for merge of r40322 into '.':
 G   .
------------------------------------------------------------------------
r40324 | pierre | 2018-11-16 10:27:42 +0000 (Fri, 16 Nov 2018) | 4 lines

  * Disable range check for m68k/aoptcpu unit
  * Add missing change of var parameter p to next instruction
    in TryToOptimizeMove method after instruction removal.

------------------------------------------------------------------------
--- Merging r40324 into '.':
U    compiler/m68k/aoptcpu.pas
--- Recording mergeinfo for merge of r40324 into '.':
 G   .
------------------------------------------------------------------------
r40326 | pierre | 2018-11-16 13:28:26 +0000 (Fri, 16 Nov 2018) | 1 line

 Change local variables offsetdec and extraoffset type to ASizeInt
------------------------------------------------------------------------
--- Merging r40326 into '.':
U    compiler/ncgmem.pas
--- Recording mergeinfo for merge of r40326 into '.':
 G   .
------------------------------------------------------------------------
r40377 | pierre | 2018-11-27 10:19:36 +0000 (Tue, 27 Nov 2018) | 1 line

 Fix bug report 34605 and add corresponding test
------------------------------------------------------------------------
--- Merging r40377 into '.':
A    tests/webtbs/tw34605.pp
U    compiler/nutils.pas
--- Recording mergeinfo for merge of r40377 into '.':
 G   .
------------------------------------------------------------------------
r40378 | pierre | 2018-11-27 10:21:37 +0000 (Tue, 27 Nov 2018) | 1 line

 Avoid range errors or overflows on for AVR cpu, when computing address offsets
------------------------------------------------------------------------
--- Merging r40378 into '.':
U    compiler/ncgset.pas
U    compiler/ngtcon.pas
--- Recording mergeinfo for merge of r40378 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40716 -
2018-12-31 15:48:08 +00:00
pierre
1fafc17016 Merge of revisions 39731 39825 39849 39912 39913 39914 39924 39935 39999 40000 40001 40026 40115 40132 40163 from trunk to fixes_3_2
------------------------------------------------------------------------
r39731 | pierre | 2018-09-11 08:00:54 +0000 (Tue, 11 Sep 2018) | 1 line

 Disable overflow for UDIVX ans SDIVX 64-bit instructions
------------------------------------------------------------------------
--- Merging r39731 into '.':
U    compiler/sparcgen/ncpumat.pas
--- Recording mergeinfo for merge of r39731 into '.':
 G   .
------------------------------------------------------------------------
r39825 | pierre | 2018-09-27 06:59:07 +0000 (Thu, 27 Sep 2018) | 1 line

 Add rtl dependency and fix fpcdir value
------------------------------------------------------------------------
--- Merging r39825 into '.':
U    packages/ide/compiler/Makefile.fpc
--- Recording mergeinfo for merge of r39825 into '.':
 G   .
------------------------------------------------------------------------
r39849 | pierre | 2018-10-01 21:50:13 +0000 (Mon, 01 Oct 2018) | 1 line

 Use vfpv2 as default fpu for eabihf if cpu is below armv7
------------------------------------------------------------------------
--- Merging r39849 into '.':
U    compiler/options.pas
--- Recording mergeinfo for merge of r39849 into '.':
 G   .
------------------------------------------------------------------------
r39912 | pierre | 2018-10-11 20:38:39 +0000 (Thu, 11 Oct 2018) | 1 line

 Fix ppuload for string type for i8086, use getasizeint for all string defs but short string
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r39912 into '.':
 G   .
------------------------------------------------------------------------
r39913 | pierre | 2018-10-11 21:02:25 +0000 (Thu, 11 Oct 2018) | 1 line

 fix position of ppuload_platform for trecorddef
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r39913 into '.':
 G   .
------------------------------------------------------------------------
r39914 | pierre | 2018-10-12 06:05:50 +0000 (Fri, 12 Oct 2018) | 1 line

 Adapt ppudump to fix introduced in revision 39912
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r39914 into '.':
 G   .
------------------------------------------------------------------------
r39924 | pierre | 2018-10-13 11:35:34 +0000 (Sat, 13 Oct 2018) | 1 line

 Downgrade some warnings to notes for EXTDEBUG
------------------------------------------------------------------------
--- Merging r39924 into '.':
U    compiler/pass_2.pas
U    compiler/tgobj.pas
--- Recording mergeinfo for merge of r39924 into '.':
 G   .
------------------------------------------------------------------------
r39935 | pierre | 2018-10-14 22:18:50 +0000 (Sun, 14 Oct 2018) | 1 line

 Add missing setting of expectloc for multiplications
------------------------------------------------------------------------
--- Merging r39935 into '.':
U    compiler/nadd.pas
--- Recording mergeinfo for merge of r39935 into '.':
 G   .
------------------------------------------------------------------------
r39999 | pierre | 2018-10-20 18:44:05 +0000 (Sat, 20 Oct 2018) | 1 line

 Avoid run time error if compiled with -CR option
------------------------------------------------------------------------
--- Merging r39999 into '.':
U    compiler/m68k/cpupara.pas
--- Recording mergeinfo for merge of r39999 into '.':
 G   .
------------------------------------------------------------------------
r40000 | pierre | 2018-10-20 18:49:53 +0000 (Sat, 20 Oct 2018) | 1 line

Avoid range check error when compiled with -CR
------------------------------------------------------------------------
--- Merging r40000 into '.':
U    compiler/m68k/cgcpu.pas
--- Recording mergeinfo for merge of r40000 into '.':
 G   .
------------------------------------------------------------------------
r40001 | pierre | 2018-10-20 22:19:08 +0000 (Sat, 20 Oct 2018) | 1 line

 Add explicit typecast to avoid range check error
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r40001 into '.':
 G   .
------------------------------------------------------------------------
r40026 | pierre | 2018-10-24 21:37:22 +0000 (Wed, 24 Oct 2018) | 1 line

 Explicitly disable range checking
------------------------------------------------------------------------
--- Merging r40026 into '.':
U    compiler/x86/cgx86.pas
--- Recording mergeinfo for merge of r40026 into '.':
 G   .
------------------------------------------------------------------------
r40115 | pierre | 2018-10-31 22:53:11 +0000 (Wed, 31 Oct 2018) | 1 line

 Avoid range check error in ReadPosInfo
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r40115 into '.':
 G   .
------------------------------------------------------------------------
r40132 | pierre | 2018-11-01 07:09:47 +0000 (Thu, 01 Nov 2018) | 1 line

 Only call moved if len>0, as otherwise astring local variable is nil, which leads to a range check error for astring[1]
------------------------------------------------------------------------
--- Recording mergeinfo for merge of r40132 into '.':
 G   .
------------------------------------------------------------------------
r40163 | pierre | 2018-11-01 21:58:54 +0000 (Thu, 01 Nov 2018) | 8 lines

  More -CriotR fixes:
  * entfile.pas: Change PPU header falgs filed from longint to dword.
  * ngtcon.pas: Change local variable startoffset type to aword.
  * omfbase.pas: Avoid calling move with a nil string s indexed as s[1],
    to avoid a range check error.
  * owomflib.pas: Disable range check explicitly in hash computation.
  * utils/ppuutils/ppudump.pp: Adapt to flags type change in entfile.pas

------------------------------------------------------------------------
--- Recording mergeinfo for merge of r40163 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40616 -
2018-12-22 22:19:05 +00:00
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
Károly Balogh
64e7c90147 m68k: some quickhacks to support PalmOS reg-relative globals and quick-n-dirty small code PIC. needs some cleanup, but the basic idea will be useful a potential for MacOS and Amiga .library support as well, among others
git-svn-id: trunk@37900 -
2018-01-04 08:33:43 +00:00
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