Commit Graph

67 Commits

Author SHA1 Message Date
florian
56a99d2512 + sanity checks in mips and sparc register allocator
(cherry picked from commit 03f4685455)
2023-06-09 07:53:29 +01:00
Jonas Maebe
197f5cbec5 * let all the case code generation work with tconstexprint instead of aint,
so it also works for 32 bit targets and a high level code generator
    (where aint is still 32 bit, but 64 bit operations are not decomposed)

git-svn-id: trunk@41441 -
(cherry picked from commit 07bd4ba517)

With local change to fix compilation for x86_64 CPU
2021-08-26 23:28:28 +02:00
pierre
9cd5a5b916 ------------------------------------------------------------------------
r40155 | jonas | 2018-11-01 20:39:38 +0000 (Thu, 01 Nov 2018) | 1 line

  * fixed compilation with -O3 (one false positive, one real error)
------------------------------------------------------------------------
--- Merging r40155 into '.':
   C compiler/riscv { not present in fixes branch }
U    compiler/sparcgen/ncpumat.pas
--- Recording mergeinfo for merge of r40155 into '.':
 U   .
Summary of conflicts:
  Tree conflicts: 1

git-svn-id: branches/fixes_3_2@49419 -
2021-05-31 13:37:44 +00:00
pierre
8e9f91ee79 Merge commit 47798 to fixes branch
------------------------------------------------------------------------
r47798 | pierre | 2020-12-16 23:16:37 +0000 (Wed, 16 Dec 2020) | 1 line

 Try to fix sparc32 code generation error for overflow test
------------------------------------------------------------------------
--- Merging r47798 into '.':
U    compiler/sparcgen/cgsparc.pas
--- Recording mergeinfo for merge of r47798 into '.':
 U   .

git-svn-id: branches/fixes_3_2@47825 -
2020-12-20 22:04:33 +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
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
pierre
36f9ce1cb2 Merge of trunk commits 39983,39986,40109
------------------------------------------------------------------------
r39983 | florian | 2018-10-18 20:28:03 +0200 (Thu, 18 Oct 2018) | 3 lines

* properly take care of register allocations between the first and second instruction for the FoldLea optimization
* check for ait_instruction after a GetNextInstruction function call
* cosmetics
------------------------------------------------------------------------
------------------------------------------------------------------------
r39986 | pierre | 2018-10-18 22:21:54 +0200 (Thu, 18 Oct 2018) | 1 line

 Fix for bug report #34380
------------------------------------------------------------------------
------------------------------------------------------------------------
r40109 | pierre | 2018-10-31 15:43:18 +0100 (Wed, 31 Oct 2018) | 1 line

 Use correct field for sl_absolutetype or sl_typeconv ppropaccesslistitem type (revealed by compilation with -CriotR)
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@40482 -
2018-12-06 22:17:57 +00:00
Jonas Maebe
d69ad8fa41 * removed temppos field again from parameter locations: they're not allocated
by the temp manager of the current procedure

git-svn-id: trunk@38858 -
2018-04-27 19:18:55 +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
Jonas Maebe
1b66995754 * factored out check to determine whether a variable can be subscripted in
inline assembly, and fixed check after r35959 (mantis #32318)
   o can also subscript parameters passed by value on the stack
   o can also subscript local variables, the parameters passed by reference
     that are subsequently copied into a local

git-svn-id: trunk@37886 -
2018-01-01 14:29:21 +00:00
florian
4cf2a2672a changes to fix #32043
* changed most of the variables in the assembler readers used to store constants from aint to tcgint 
  as aint has only the size of the accumular while some CPUs (AVR) allow larger constants in instructions
+ allow access to absolute symbols with address type in inline assembler
* allow absolute addresses in avr inline assembler
+ tests

git-svn-id: trunk@37411 -
2017-10-06 21:07:19 +00:00
florian
bfeb5fef53 + cas* mnemonics for sparc64
git-svn-id: trunk@37188 -
2017-09-11 20:06:22 +00:00
florian
074ef98535 * fix spilling on sparc64 if the offset must be built by sethi/or/xor
git-svn-id: trunk@37159 -
2017-09-09 19:36:52 +00:00
florian
b8354b9b60 * fix trgcpu.do_spill_replace for sparc64
git-svn-id: trunk@36998 -
2017-08-20 20:35:10 +00:00
florian
08fd0b1c5c * fix jump. tables for sparc64
git-svn-id: trunk@36997 -
2017-08-20 20:35:08 +00:00
florian
c8e448345a * return correct reg_cgsize for int. registers on sparc64
git-svn-id: trunk@36996 -
2017-08-20 20:35:06 +00:00
florian
ec141a716b * SLAX and MULX are candidates for the OpMov2Mov optimization as well
git-svn-id: trunk@36956 -
2017-08-20 17:20:35 +00:00
florian
f18ddd6a54 + SLLXSRxXST2ST assembler optimization for SPARC64
git-svn-id: trunk@36955 -
2017-08-20 17:20:33 +00:00
florian
265eae2cc1 + DebugMsg for SPARC assembler optimizer
git-svn-id: trunk@36954 -
2017-08-20 17:20:32 +00:00
florian
9b3e0a80df * a_loadfpu_ref_cgpara uses g_concatcopy instead of a_load_ref_ref
git-svn-id: trunk@36950 -
2017-08-20 15:21:57 +00:00
florian
09d99a6009 * sparc64 does not generate a unimp instruction if a parameter is returned in a memory location
git-svn-id: trunk@36949 -
2017-08-20 15:21:55 +00:00
florian
4988337e6f * correctly set std_param_align for sparc64
git-svn-id: trunk@36948 -
2017-08-20 15:21:54 +00:00
florian
9c3f5db022 * split create_paraloc_info_intern for sparc32 and sparc64
* fixed several sparc64 calling convention issues

git-svn-id: trunk@36947 -
2017-08-20 15:21:51 +00:00
pierre
7ee567fcca Use A_LD_R alias in functions using GOT indirection
git-svn-id: trunk@36795 -
2017-07-26 14:58:03 +00:00
pierre
ef3b006eb2 Use A_LD_R alias in do_spill_replace function
git-svn-id: trunk@36794 -
2017-07-26 14:57:21 +00:00
pierre
6e18d537fc Use A_LD_R and A_ST_R aliases for spilling_create_(load|store) functions
git-svn-id: trunk@36793 -
2017-07-26 14:56:11 +00:00
pierre
f5dfbb5ff3 Add A_ST_R and A_LD_R instruction alias for whole register size store/load
git-svn-id: trunk@36792 -
2017-07-26 14:53:30 +00:00
florian
eaa33f416c * sparc64: fix int to bool type conversions for 64 bit ints
git-svn-id: trunk@36762 -
2017-07-21 20:41:14 +00:00
pierre
f3459454e6 Fix compilation failure for sparc CPU
git-svn-id: trunk@36741 -
2017-07-18 04:47:49 +00:00
florian
a7d127cf08 * only sparc v7 and v8 require an instruction between FCMP and the branch
git-svn-id: trunk@36737 -
2017-07-16 09:24:20 +00:00
florian
ac894831e4 * use the 64 bit path in tSparcmoddivnode.pass_generate_code for all 64 bit types (including currency) on sparc64
git-svn-id: trunk@36736 -
2017-07-16 09:24:18 +00:00
florian
dd3d62425c * guard case statement by internalerror to avoid a warning
git-svn-id: trunk@36716 -
2017-07-09 21:33:22 +00:00
florian
f30bf547e2 * TCGSparcGen.maybeadjustresult adapted for sparc64
git-svn-id: trunk@36711 -
2017-07-09 18:14:14 +00:00
florian
25950b8575 * 64 bit multiplications for sparc64 fixed
git-svn-id: trunk@36675 -
2017-07-07 22:18:16 +00:00
florian
bd57ca99a8 * cosmetics
git-svn-id: trunk@36672 -
2017-07-07 22:18:11 +00:00
florian
cbe9a1b65f * make thlcgcpu.g_intf_wrapper usable for sparc64 as well
git-svn-id: trunk@36665 -
2017-07-07 13:17:42 +00:00
florian
8401a460e5 + support 64 bit sar on sparc64
* fix on sparc64 broken a_cmp_const_reg_label and a_cmp_reg_reg_label

git-svn-id: trunk@36661 -
2017-07-07 10:11:44 +00:00
florian
1f4d6e8a4d * compilation on 32 bit sparc fixed
git-svn-id: trunk@36660 -
2017-07-07 09:30:50 +00:00
florian
c8c14d8db9 * pass -32 to the sparc assembler
git-svn-id: trunk@36659 -
2017-07-07 09:08:05 +00:00
florian
a9a0ca6649 * sparc64 needs a helper for overflow checked 64 bit division operations
git-svn-id: trunk@36658 -
2017-07-07 09:08:02 +00:00
florian
ca51bd56c4 + a_jmp_cond64
* generate 64 bit comparisons if needed

git-svn-id: trunk@36657 -
2017-07-06 18:02:24 +00:00
florian
109612b7e1 * correctly load 32 bit values on sparc64
git-svn-id: trunk@36644 -
2017-07-04 20:52:47 +00:00
florian
57a137068b * integer registers must have the size R_SUBWHOLE for sparc, resolves issue #32065
git-svn-id: trunk@36639 -
2017-07-03 20:49:06 +00:00
florian
28cfa838b5 + support for the different flag registers of sparc
* fixing 64 bit cmp operations on sparc64

git-svn-id: trunk@36638 -
2017-07-03 20:49:05 +00:00
florian
4b30e5ee11 + TSparcmoddivnode.pass_generate_code for SPARC64
git-svn-id: trunk@36637 -
2017-07-03 20:49:03 +00:00
florian
5bc9890727 + more sparc64 instructions
git-svn-id: trunk@36636 -
2017-07-03 20:49:01 +00:00
florian
5b91fd7065 + taicpu.op_reg_sym for sparc
git-svn-id: trunk@36635 -
2017-07-03 20:49:00 +00:00
florian
65c9e6c32e + fccX registers
git-svn-id: trunk@36633 -
2017-07-03 20:48:56 +00:00
florian
c321fb35f1 * integer registers on sparc(64) do not have an explicit size anymore, simplifies compiler code sharing between sparc32 and sparc64
+ %icc and %xcc register for sparc64

git-svn-id: trunk@36548 -
2017-06-19 21:18:09 +00:00