Jonas Maebe
346adf7f55
* replace explicit (sometimes incomplete) tests with calls to doshortbooleval()
...
* the c-style boolean evaluation of "and" is independent of short-circuit evaluation
(you always have to consider the complete values in case the first one is <> 0)
git-svn-id: trunk@45990 -
2020-08-02 14:39:50 +00:00
svenbarth
848ec1d219
* allow overloads with same result type for external Java classes due to Java supporting covariant return types for interfaces
...
git-svn-id: trunk@45988 -
2020-08-02 12:28:46 +00:00
yury
4964f5cf76
* Count the number of interferences with real registers.
...
* Do not coalesce registers 'u' and 'v' if 'u' is the last usable real register available for imaginary register 'n' which also interferences with 'v'.
This prevents endless spilling in some cases for constrained CPUs such as AVR. Resolves issue #37421 .
Also this reduces the number of spilled registers in some cases and even eliminates spilling completely for some simple routines for i386 and AVR.
* Added a debug output of the number of spilled registers for each routine. This allows to easily compare results after changes in spilling algorithms.
git-svn-id: trunk@45987 -
2020-08-02 11:50:43 +00:00
florian
f542ee7b92
* do not throw an internal error if an errorneous type is passed to str, resolves #37462
...
git-svn-id: trunk@45983 -
2020-08-01 21:11:35 +00:00
florian
6f661e44d0
* do not throw an internal error later on in case of a recursive call, if the declaration of the function was faulty, resolves #37460
...
git-svn-id: trunk@45975 -
2020-07-31 21:03:35 +00:00
svenbarth
b412259c1c
* fix for Mantis #37355 : the method name and the named parameters need to be separated by a single #0
...
+ added test
git-svn-id: trunk@45974 -
2020-07-31 15:55:37 +00:00
svenbarth
b62045809d
* reject overloads if they only differ in the result types (as long as they aren't operator overloads)
...
+ added tests
git-svn-id: trunk@45973 -
2020-07-31 15:55:34 +00:00
svenbarth
fa0c9adbf4
* extract checking whether two parameter defs of two procdefs are equal into a separate function
...
git-svn-id: trunk@45972 -
2020-07-31 15:55:31 +00:00
florian
42f2e5f8ad
+ simplify "x mod -1", resolves #37449
...
git-svn-id: trunk@45969 -
2020-07-30 20:35:34 +00:00
florian
941020af1a
* patch by J. Gareth Moreton: Minor oversight in MovAnd2Mov 3 optimisation, resolves #37442
...
git-svn-id: trunk@45961 -
2020-07-29 21:11:46 +00:00
yury
2d8873d085
* Fixed TAOptObj.CollapseZeroDistJump to properly handle delay slots.
...
git-svn-id: trunk@45874 -
2020-07-28 23:27:42 +00:00
yury
2b86651914
* Re-enabled safe generic jump optimizations for mips.
...
git-svn-id: trunk@45873 -
2020-07-28 23:16:21 +00:00
florian
0b5c50ea41
* Aarch64: set register size correctly for AndStrb2Strb optimization, resolves #37427
...
git-svn-id: trunk@45872 -
2020-07-28 20:46:05 +00:00
yury
cc936710a0
* mips: Added support for unaligned load/store. It greatly improves performance and prevents bus errors on systems which do not emulate unaligned memory access.
...
git-svn-id: trunk@45871 -
2020-07-28 20:08:41 +00:00
florian
55c4986c8d
* modified patch by J. Gareth Moreton: MovOpMov2Op/Lea2Add/Lea2Sub consolidation, resolves #37422
...
git-svn-id: trunk@45865 -
2020-07-27 21:00:25 +00:00
florian
a172064767
* patch by J. Gareth Moreton: fix for incorrect alignment removal, resolves #37420
...
git-svn-id: trunk@45864 -
2020-07-26 14:41:50 +00:00
Jonas Maebe
a534fb9acd
* fixed allocation of function result location
...
git-svn-id: trunk@45858 -
2020-07-25 20:26:24 +00:00
yury
e6b89c98f5
* Changed tsuperregisterworklist.get() to always return the last item from the list.
...
* Reversed sort order of simplifyworklist so nodes with most interferences will get their colors first.
Since degree of nodes in simplifyworklist before sorting is always
less than the number of usable registers this should not trigger spilling
and should lead to a better register allocation in some cases.
After these changes sysutils.o for i386-win32 is 80 bytes less. :)
git-svn-id: trunk@45857 -
2020-07-25 18:29:59 +00:00
yury
72dc2145e9
* In Delphi mode throw a conversion error when trying to typecast a pointer to a procdef when they use different memory models.
...
git-svn-id: trunk@45856 -
2020-07-25 17:13:29 +00:00
florian
f6e6b807d5
+ optimize <signed> mod <power of 2> for x86-64 as well
...
git-svn-id: trunk@45854 -
2020-07-25 16:42:19 +00:00
Jonas Maebe
a5bad32b7c
- removed no longer used -target $TARGET parameter (triplet is used instead)
...
git-svn-id: trunk@45853 -
2020-07-25 16:11:54 +00:00
yury
2839533776
* i8086: Enabled the cs_opt_regvar optimization. It works fine now.
...
git-svn-id: trunk@45847 -
2020-07-24 16:45:44 +00:00
yury
34a5dfc885
* i8086: Fixed referencing using BP and SP as base when FAR or HUGE memory model is used.
...
git-svn-id: trunk@45846 -
2020-07-24 16:42:09 +00:00
yury
b1b9d1f341
* i8086: Removed internal error, since global vars can be in registers if used only in pascalmain.
...
git-svn-id: trunk@45845 -
2020-07-24 16:39:26 +00:00
yury
c455e942e5
* Try to avoid spilling of an imm register if it contains a value loaded from an already spilled imm register. It likely leads to an endless loop and the register allocation fails.
...
This fixes the register allocation for i8086 when handling registers for very constrained instructions such as "mov ireg1,[ireg2+ireg3]".
Here ireg2 can be only BX or BP. So in most cases only BX is available. When ireg2 is spilled, its value must be loaded to BX only.
Coloring of the ireg which holds the spilled value must be as early as possible to be able to assign BX to this ireg.
This fix should also help register allocation for other constrained/old CPUs.
git-svn-id: trunk@45843 -
2020-07-24 14:08:18 +00:00
yury
a258774ba9
* To check the size of a register(s) corresponding to a variable it is needed to use localloc.size instead of def_cgsize(vardef).
...
git-svn-id: trunk@45834 -
2020-07-23 13:10:50 +00:00
yury
15f411a332
* Improved r45832.
...
git-svn-id: trunk@45833 -
2020-07-23 12:52:17 +00:00
yury
80facfa0bf
* Fixed indentations of the interference graph.
...
* Added register names to the interference graph.
git-svn-id: trunk@45832 -
2020-07-23 12:45:40 +00:00
Károly Balogh
d7122c6338
z80: preserve system ID and linker ID for the Amstrad CPC
...
git-svn-id: trunk@45831 -
2020-07-23 11:57:20 +00:00
florian
ed158f1e52
* set register size correctly for popcnt(<byte>), resolves #37400
...
git-svn-id: trunk@45828 -
2020-07-22 20:47:12 +00:00
yury
6478a727d7
* Fixed the peephole optimization of conditional movs for mips.
...
git-svn-id: trunk@45826 -
2020-07-22 11:40:21 +00:00
florian
5da913de0e
* float operations can have an exception as a side effect, resolves #37398
...
git-svn-id: trunk@45824 -
2020-07-21 20:09:39 +00:00
Jonas Maebe
dd6e6eb26a
* disable tail recursion optimisation if there is a copy-back parameter
...
* handle fparainit in tail recursion optimisation (mantis #37397 )
git-svn-id: trunk@45823 -
2020-07-21 17:57:50 +00:00
Jonas Maebe
924ffe6538
* removed initialisation of unused fparacopyback from tcallparanode.copy_value_by_ref_para
...
git-svn-id: trunk@45822 -
2020-07-21 17:57:45 +00:00
pierre
57b8f28574
Avoid overflow errors on z80 CPU by changing local variable type from aint to tcgint
...
git-svn-id: trunk@45816 -
2020-07-21 05:23:36 +00:00
pierre
667a010357
Avoid wrong overflow error when using -Criot options
...
git-svn-id: trunk@45815 -
2020-07-21 05:22:26 +00:00
florian
13cb57b2c3
+ Aarch64: trgcpu.get_spill_subreg: return MM sub register correctly, resolves #37393
...
git-svn-id: trunk@45814 -
2020-07-20 21:07:09 +00:00
florian
14bc6674a6
* revert part of r45810 which was accidently committed
...
git-svn-id: trunk@45813 -
2020-07-20 20:21:44 +00:00
pierre
0c6998bb11
Try to fix mipsel-android by making sure P does not point to a freed instruction
...
git-svn-id: trunk@45812 -
2020-07-19 21:21:18 +00:00
florian
09125e834f
+ patch by J. Gareth Moreton: SHL-centric peephole optimisations, resolves #37389
...
git-svn-id: trunk@45811 -
2020-07-19 20:50:13 +00:00
florian
d6d92e3666
* revert part of r44879: flock must use kernel_off_t: off_t breaks e.g. i386
...
git-svn-id: trunk@45810 -
2020-07-19 19:54:22 +00:00
Jonas Maebe
64da9c4ab2
* add a patch level to the default version numbers so llvm doesn't complain
...
* fixed compiler variable for default macOS 11.0
git-svn-id: trunk@45809 -
2020-07-19 14:30:41 +00:00
Jonas Maebe
edb660ed58
* made TAArch64ClangGASAssembler inherit from TAArch64Assembler and removed custom
...
$TARGET handling (handled by the general triple handling now)
git-svn-id: trunk@45808 -
2020-07-19 14:30:38 +00:00
Jonas Maebe
eb7ba1690e
* mark all external assemblers using an LLVM tool using af_llvm
...
+ added support for constructing target triplets
* pass "-target triplet" when using an LLVM assembler
o removed no longer needed $DARWINVERSION and $ARCH parameters
* consistently use as_clang_gas when clang is used to assembler GAS-style
assembly, and rename as_llcm_clang to as_clang_llvm (for consistency)
* support pipe assembling when using clang on *nix in all cases
git-svn-id: trunk@45807 -
2020-07-19 14:30:35 +00:00
Jonas Maebe
6fe8d7bd14
* don't crash if no info is registered for the selected external assembler
...
git-svn-id: trunk@45806 -
2020-07-19 14:30:31 +00:00
florian
043c3df292
* properly handle boolean64 xor boolean64 on i386
...
git-svn-id: trunk@45804 -
2020-07-18 18:32:17 +00:00
Jonas Maebe
59331c3d3c
* enable putting records that contain a single field into records on all
...
targets (patch by J. Gareth Moreton, mantis #37343 )
git-svn-id: trunk@45801 -
2020-07-17 20:57:24 +00:00
Jonas Maebe
3e9e0a0f7d
* completely disable records containing float fields in registers again, as
...
the code generator does not support subsetreg loads of floats
git-svn-id: trunk@45800 -
2020-07-17 20:57:20 +00:00
florian
db250b04e0
* generate soft float code for arm vfp units which have no double operation support
...
git-svn-id: trunk@45799 -
2020-07-17 16:45:52 +00:00
pierre
bb6d4929d8
* Handle R_SUBMMWHOLE in reg_cgsize for R_MMREGISTER type
...
* Disable range and overflow checking inside is_continuous_mask function.
git-svn-id: trunk@45798 -
2020-07-17 15:27:27 +00:00