Pierre Muller
144ee6d51d
Add missing swaping in case of different endianess of stab entry inside TInternalAssembler.WriteStab
2023-04-30 21:23:06 +02:00
Pierre Muller
dc04a8a677
Fix storing of unaligned 64-bit to memory
2023-04-21 10:32:13 +01:00
Pierre Muller
aaf356ba9f
Avoid read past buffer end for empty source when checking for utf-8 signature
2023-04-12 20:10:44 +02:00
Pierre Muller
892220d6fe
Treat -Cb / -Cb- options in first pass (to be able to use FPC_BIG_ENDIAN inside .fpc.cfg config file)
2023-04-06 16:49:40 +02:00
Pierre Muller
2a4ca98e85
Use systems_darwin set for supported targets for as_clang_llvm_darwin
2023-04-06 14:40:15 +00:00
Pierre Muller
3855625b8d
Add tf_use_psabieh for LLVM for x86_64-iphonesim, aarch64-ios and aarch64-iphonesim targets
2023-04-05 00:01:03 -05:00
florian
a807144ead
* patch by Rika: Fix and possible simplification of SanitiseXMLString, part of #39800
2023-04-04 23:21:14 +02:00
florian
8f3cce556d
* some error messages use nicer symbol names
2023-04-01 22:34:37 +02:00
Nikolay Nikolov
4143912b72
* use a TFPList, instead of a dynamic array in twasmnodeutils.InsertObjectInfo.
...
No functional changes.
2023-04-01 17:17:42 +03:00
Nikolay Nikolov
e82c98bfce
* wasm32: generate module info by traversing through current_module and its
...
used_units list recursively. This should fix #40229
2023-04-01 04:25:15 +03:00
florian
e40f997a40
* another patch to fix #40223
2023-03-31 23:45:45 +02:00
Pierre Muller
644ffa8e7a
Do not always set DEBUG_AOPTCPU
2023-03-30 22:07:37 +00:00
florian
6663d5ca63
* do not replace index registers with esp/rsp, resolves #40223
2023-03-30 21:36:35 +02:00
Dmytro Bogatskyy
327aac7f24
Add aarch64-iphonesim target
2023-03-27 18:45:00 +00:00
florian
b797bbf5dc
* spelling fixed
2023-03-26 15:55:37 +02:00
florian
466561f09f
* patch by Rika: Use Index* for pointer lists, resolves #40218
2023-03-25 21:32:29 +01:00
florian
3ad8b4199c
* patch by Rika: Shorten cutils.compareansistrings, resolves #40213
2023-03-24 22:50:19 +01:00
Jonas Maebe
12bde4e903
WPO: fix dead code detection, and handle procvars
...
Extend dead code detection to not only look for the main mangled name, but also
for any aliases before deciding that a routine has been dead-stripped.
Assume objects/classes can also be constructed if the address of one of their
constructors or of the TObject.NewInstance class method has been taken.
Resolves #40204
2023-03-24 21:22:18 +01:00
florian
8cd10d88cc
* revert use of DW_AT_external for types as this is not covered by the dwarf standard
2023-03-23 22:44:00 +01:00
florian
4848327300
* write types declared in the interface section with a DW_AT_external tag, should resolve #40210
2023-03-22 21:16:49 +01:00
florian
488c389b9b
+ support FILEEXISTS(...) in preprocessor expressions, resolves #39527
...
+ tests
* tscannerfile.readpreproc sets preproc_pattern correctly for quoted strings
2023-03-20 23:17:09 +01:00
florian
0d3ec87492
* also initalize default helper variables of initialization sections, resolves #40183
2023-03-19 21:19:10 +01:00
Jonas Maebe
0ea0b69a30
LLVM: cleaned up some comments
2023-03-18 23:14:25 +01:00
Jonas Maebe
e41bfa0495
LLVM: LLVM 16 support
...
No changes compared to LLVM 15 that affect us
2023-03-18 23:13:58 +01:00
Jonas Maebe
839849085b
LLVM: don't use type names in ctor/dtor arrays
...
Workaround for https://github.com/llvm/llvm-project/issues/56809
2023-03-18 23:13:03 +01:00
Jonas Maebe
0e46041717
WPO: also consider NewInstance to detect class instancing
...
Resolves #40200
2023-03-18 21:18:25 +01:00
florian
64319dc019
* PopCount takes care only of the bit pattern, so take the uvalue to avoid an internal error, resolves #40190
2023-03-17 22:30:36 +01:00
Sven/Sarah Barth
c1ecfc323a
* ensure that a procvar (especially a "REFERENCE TO") begins either with FUNCTION or PROCEDURE
...
+ added test
2023-03-15 23:39:59 +01:00
florian
7909f00c83
* project files updated
2023-03-15 23:01:44 +01:00
florian
2b0317f400
* compilation fixed with -Oodfa
2023-03-14 23:10:32 +01:00
florian
30cb20bccd
+ riscv32-freertos: first version of TlinkerFreeRTOS.GenerateDefaultLinkerScripts
2023-03-14 22:22:01 +01:00
J. Gareth "Curious Kit" Moreton
3f25438d35
* x86: TEST/Jcc/TEST optimisations can now look beyond the next instruction under -O3
2023-03-11 22:10:35 +00:00
J. Gareth "Curious Kit" Moreton
d372286159
* x86: RegModifiedByInstruction and RegInInstruction
...
are now more accurate for (I)MUL and (I)DIV.
2023-03-11 22:10:35 +00:00
J. Gareth "Curious Kit" Moreton
3635f7cd6f
* x86: Fixed oversight in RegModifiedByInstruction not checking W0, W1 and WU-type flags
2023-03-11 22:10:35 +00:00
J. Gareth "Curious Kit" Moreton
b637a3a022
* x86: Fix to MOV/CMP register deallocation positioning
2023-03-11 22:10:35 +00:00
ccrause
f83a8f0f8f
Only perform OpCp2Op optimization when the first Op is ANDI and comparison is against 0.
2023-03-09 18:19:20 +02:00
J. Gareth "Curious Kit" Moreton
77f53ebde3
* x86: The LEA/LEA optimisations can now work with a different
...
destination register and the intermediate register still in
use.
2023-03-08 21:54:41 +00:00
J. Gareth "Curious Kit" Moreton
931bda5633
* x86: LeaLea2Lea now handles cases where the second LEA instruction
...
has a second register in the reference.
2023-03-08 21:54:41 +00:00
florian
66ff7a928c
+ added debug messages
2023-03-08 22:54:17 +01:00
florian
99b01f6634
* second mul might get called with a zero operand if the other has a side effect,
...
handle this correctly in ti386addnode.second_mul64bit, resolves #40182
2023-03-06 23:19:34 +01:00
florian
bf8746ed10
* fixed comment
...
* shortened code
2023-03-05 21:24:50 +01:00
florian
ccbdfa9150
+ x86: AND/CMP -> CMP optimiziation
2023-03-04 21:20:52 +01:00
J. Gareth "Curious Kit" Moreton
b8933dd267
* x86: Some refactoring to use aoc_ForceNewIteration instead of manually advancing p
2023-03-04 18:40:27 +00:00
J. Gareth "Curious Kit" Moreton
7854152304
* Adjustment to TBLockNode.pass_1 to actually strip nothing nodes
2023-03-03 21:07:31 +00:00
J. Gareth "Curious Kit" Moreton
ecf2ad3e53
x86: Some oversights fixed where another iteration of pass 1 wasn't performed when it should have been
2023-03-03 20:47:24 +00:00
florian
708aaa7b97
* fix (hopefully) build without an ld.bfd variant
2023-03-02 22:56:23 +01:00
florian
40f23030dc
* check if a linker with the postfix .bfd exists, if yes, use it, resolves #40175
2023-03-01 23:01:19 +01:00
J. Gareth "Curious Kit" Moreton
c4899b5dc0
* Dead code in TAddNode.Simplify has been stripped
2023-02-28 20:56:38 +00:00
J. Gareth "Curious Kit" Moreton
487ca08cf3
* In TAddNode.Simplify, commutative operations now ensure integer constant operands go on the right for simplicity
2023-02-28 20:56:38 +00:00
Sergey Larin
de58691e75
Allow WideChar const to UTF8String const conversion
2023-02-24 22:59:39 +00:00
J. Gareth "Curious Kit" Moreton
4d33e5f137
* x86: OptPass1_V_MOVAP now uses GetNextInstructionUsingReg and UpdateUsedRegsBetween
2023-02-24 19:39:39 +00:00
J. Gareth "Curious Kit" Moreton
9ee672f9eb
* New UpdateUsedRegsBetween utility subroutine
2023-02-24 19:39:39 +00:00
florian
95e5eeb226
* fix compilation with -dEXTDEBUG
2023-02-24 20:39:13 +01:00
J. Gareth "Curious Kit" Moreton
a5702d89e8
* More complex uses of the pruning methods in TAddNode.Simplify
2023-02-21 20:44:02 +00:00
J. Gareth "Curious Kit" Moreton
9d8fd6d55e
* TAddNode.Simplify now uses pruning methods
2023-02-21 20:44:02 +00:00
J. Gareth "Curious Kit" Moreton
7488f1e3f8
* New node pruning methods
2023-02-21 20:44:02 +00:00
J. Gareth "Curious Kit" Moreton
2a44ffe51b
* x86: BZHI optimisation now sets the subtract and shift nodes to 'do not execute' as they are skipped over.
2023-02-21 20:44:02 +00:00
J. Gareth "Curious Kit" Moreton
16bd996e74
* x86: 'and not' optimisation now sets the NOT node to 'do not execute' as it is skipped over
2023-02-21 20:44:02 +00:00
J. Gareth "Curious Kit" Moreton
1b43913408
* New 'do not execute' flag for notes and respective internal error triggering
2023-02-21 20:44:02 +00:00
florian
586a7d30ab
* patch by ccrause: fixes another .fpc* section problem for AVR, resolves #40162
2023-02-20 22:48:15 +01:00
J. Gareth "Curious Kit" Moreton
dd7320ec13
* x86: PostPeepholeOptCmp and PostPeepholeOptTestOr
...
now do a final attempt of TrySwapMovCmp to
clean up Pass 2 optimisations
2023-02-19 20:22:49 +00:00
J. Gareth "Curious Kit" Moreton
4d676cd6fa
* x86: JccMovJmpMov2CMovCMov will no longer move
...
MOV instructions (fixes i40122)
2023-02-19 20:22:49 +00:00
florian
8f7e61eef6
* patch by ccrause: do not load .fpc* sections into avr microcontroller to save space, resolves #40160
2023-02-19 20:19:20 +01:00
J. Gareth "Curious Kit" Moreton
4e8ef448ed
* i386: Bug fix where EBP was marked as preserved when it wasn't, causing faulty optimisations
2023-02-19 16:49:29 +00:00
florian
a221f2af79
* completed post/pre inc/decrement addressing mode instructions in TAoptBaseCpu.RegModifiedByInstruction
2023-02-18 11:15:39 +01:00
florian
22f1289b2a
* post/pre inc/decrement references modify obviously the base register on avr, resolves #40153
2023-02-17 23:02:40 +01:00
florian
ece59f2534
* also count the use of enum syms in preprocessor expressions correctly
2023-02-16 23:02:47 +01:00
florian
811c683775
* set rangedef of dyn. arrays correctly, resolves #40149
2023-02-15 22:14:55 +01:00
Pierre Muller
b49c3fe4f8
Aslo check that live_end is assigned before refering to it
2023-02-13 15:50:04 +01:00
Pierre Muller
c8b2a36bb1
Add support for -Ploongarch64 option
2023-02-13 13:01:21 +00:00
florian
63199a0966
* memory sizes updated
2023-02-12 20:55:38 +01:00
J. Gareth "Curious Kit" Moreton
2224305834
* x86: Fixed bad register tracking in OptPass2JMP
2023-02-12 15:14:21 +00:00
florian
def475f889
* arm compilation fixed
2023-02-11 21:21:21 +01:00
florian
d06852e6e9
+ exec_e_cant_call_linker shows now the error message
2023-02-11 21:07:01 +01:00
florian
d3ccd10674
* call esptool.py properly on Darwin
2023-02-11 21:06:40 +01:00
florian
67864b662a
* fix systems_freertos
2023-02-11 20:49:52 +01:00
florian
c7a0c0bbb4
* set FPU type properly for riscv32-freertos
2023-02-11 20:42:31 +01:00
florian
f1f84a292c
* don't not generate non-constant leb128 entriesm for riscv32-freertos
2023-02-10 21:28:39 +01:00
florian
0e05e908d5
riscv32-freertos:
...
* unit name fixed
* linker script fixed
* assembler supports dwarf
2023-02-09 21:29:06 +01:00
florian
71e0c12c88
* set fpu type correctly for riscv32-freertos
2023-02-08 22:38:17 +01:00
florian
87ec3d6fad
+ completed identifiers for RiscV ABIs
2023-02-08 22:26:58 +01:00
florian
7e3bdd501c
* enable to check the existing of environment variables in config files
2023-02-08 21:33:21 +01:00
florian
f79448a9ff
* target cpu type fixed
2023-02-07 22:59:51 +01:00
J. Gareth "Curious Kit" Moreton
33dfb6cb4e
* x86: Converted bit-test optimisations to use
...
debug_hexstr so comments aren't truncated
(and put $ before BTx values)
2023-02-06 21:31:50 +00:00
J. Gareth "Curious Kit" Moreton
ae47cc2c88
* x86: New debug_hexstr instruction to help produce concise debug comments
2023-02-06 21:31:50 +00:00
florian
6e84ee5806
* patch by Jinyang He to fix building loongarch64 with -Oodfa/-O4
2023-02-06 22:26:02 +01:00
Jinyang He
783bbb66f9
Update Makefiles
2023-02-05 19:18:48 +00:00
Jinyang He
92e60d2107
add loongarch64 linux rtl support
2023-02-05 19:18:48 +00:00
Jinyang He
3d2c96ebbf
Add loongarch64 linux support to compiler
2023-02-05 19:18:48 +00:00
Jinyang He
12c4290ffe
Add loongarch64 architecture support to compiler
2023-02-05 19:18:48 +00:00
Jinyang He
8fac3d62ce
add has_double_field
2023-02-05 19:18:48 +00:00
Jinyang He
96f4300158
Fix the edge of first_imaginary in move op
2023-02-05 19:18:48 +00:00
Jinyang He
2d680afab7
Fix the ~ is NOR rather than NOT
2023-02-05 19:18:48 +00:00
Jinyang He
cda8971baa
Add dwarf cfa support
2023-02-05 19:18:48 +00:00
Jonas Maebe
7f41bb4718
JVM: add typesym for anonymous record typed constants
...
Fixes compilation of system unit with JVM compiler after b38d13577f
2023-02-05 10:58:59 +01:00
florian
9c10167b6f
+ CPUX86_HAS_BSWAP
2023-02-04 19:20:10 +01:00
Karoly Balogh
6bbb10e64d
m68k: do not generate LEA instructions with explicitly specified size. only long is possible anyway.
2023-01-30 09:56:41 +01:00
Karoly Balogh
c577ac5ce9
m68k: add tables to convert from some stub opcodes + condition into real opcodes. Use them in the external assembler writer for now. Later the internal assembler will need these tables too.
2023-01-30 09:56:41 +01:00
florian
e9ec4a8bb3
* more riscv32-freertos-esp32c3 stuff added
2023-01-29 19:30:11 +01:00
florian
09b435cdab
* transform a/a only into 1 if fastmath is on
2023-01-29 13:49:33 +01:00
florian
bedd4edc72
+ first work for esp32-c3 support
2023-01-28 21:28:19 +01:00
florian
048385fd7f
* compilation fixed
2023-01-28 11:42:52 +01:00
florian
3e75ba52f3
* initial preparations for riscv32-freertos
2023-01-27 22:39:15 +01:00
Sven/Sarah Barth
e8fcc5343b
* use new chartype_for_stringlike function to retrieve the char type for a stringlike def instead of casting to a stringdef
2023-01-26 07:07:34 +01:00
Sven/Sarah Barth
ea417fbaaf
+ add utility function to retrieve the char type def from a stringlike def
2023-01-26 07:07:34 +01:00
florian
dfb8794d4d
* compilation after merge fixed
2023-01-25 20:44:34 +01:00
Pierre Muller
aaa6f0d9c5
Only signed extension is needed
2023-01-25 19:36:45 +00:00
Pierre Muller
4793447be1
Add sign extension to 32-bit for unaligned OS_8 and OS_16 types (to try to solve #40102 )
2023-01-25 19:36:45 +00:00
florian
8ef0f59025
* mark constant symbols used in preprocessor expressions as used, resolves #40108
2023-01-24 22:36:26 +01:00
Jonas Maebe
821c22a38f
LLVM: workaround to fix make all
2023-01-23 22:44:48 +01:00
Jonas Maebe
e54197e9d2
Darwin: support -Xg for DWARFv4
2023-01-22 22:34:25 +01:00
florian
789031a6e6
* compile float*2 as float+float if possible as proposed by Rika, resolves #40116
2023-01-22 20:07:40 +01:00
florian
ec28b7586c
+ support procvar[] in tp/mac procvar mode if the procvar returns an array type
2023-01-22 16:24:29 +01:00
J. Gareth "Curious Kit" Moreton
f3f9c68ddb
* x86-64: Extended the movl/movq optimisation to cover more distance
2023-01-22 09:35:35 +00:00
J. Gareth "Curious Kit" Moreton
42b052eb83
* x86-64: movl/movq -> movl/movl zero-extension optimisation
2023-01-22 09:35:35 +00:00
Jonas Maebe
00a5d30300
LLVM: remove use of getelementptr in make_simple_ref_ptr
...
We cannot safely infer whether it needs to be indirect or not there,
it should be done at a higher level if appropriate.
2023-01-20 21:07:18 +01:00
Jonas Maebe
51fdbb5524
macOS: set max var/constalign to 64
...
For all non-ppc(64) targets. Fixes test/talignrec1.
2023-01-20 21:07:18 +01:00
Jonas Maebe
29bae2297f
tcginnode.pass_generate_code: use tlhcgobj.g_undefined_ok
...
Also override the code that uses this for LLVM with a variant that does not
need it for LLVM versions that do not support the freeze instruction.
2023-01-20 21:07:18 +01:00
Jonas Maebe
ab581c5c30
LLVM: override thlcgobj.g_undefined_ok
...
Uses the freeze instruction available in LLVM 10.0+. If we don't freeze undef/
poison values before using them in a calculation (even if that calculation is
something like "and 0", which masks the result completely), the result will
still be undef/poison and will keep propagating.
2023-01-20 21:07:18 +01:00
Jonas Maebe
ee0ad3ff86
thlcgobj.g_undefined_ok: new method
...
Specify that a register's contents may be undefined because of previous
operations (e.g. shifting by more bits than the register has, whose result
depends on the target architecture), but that the code generator will
later on ensure that if this is the case, that result will be overwritten/
masked.
2023-01-20 21:07:18 +01:00
Jonas Maebe
0b6942de8a
llvm:a fix opaque ptr IR for Objective-C protocol
...
Also for interfacecom functions and properties. Fixes test/tobjc9 and
test/tobjc9b with LLVM 15.0+
2023-01-20 21:07:18 +01:00
florian
55deefbab5
* do not crash on illegal with statement, resolves #40118
2023-01-18 23:03:28 +01:00
florian
5598ffc210
* x86_64: warn only on negative offsets if rsp is involed, second part of #40113
...
+ tests
2023-01-17 23:09:42 +01:00
florian
8b08486fa1
* do not warn on lea e/rsp with negative address offset, part of #40113
...
+ tests
2023-01-15 23:06:05 +01:00
Pierre Muller
5cedecbe25
Avoid float_raise call in FPC_SOFT_FPUX80 code
2023-01-14 11:41:20 +00:00
Pierre Muller
977ca19dc0
Set current_filepos in Internal assembler class also if DEBUG macro is set
2023-01-14 11:41:20 +00:00
florian
a9dca32689
* undid accidentely activated define
2023-01-13 22:34:57 +01:00
florian
e77ec69de4
* avoid internal error in case of an illegal generic declaration
2023-01-12 23:05:51 +01:00
J. Gareth "Curious Kit" Moreton
df80d4e612
* x86: CMOV optimisations now check optimizecputype rather than cputype
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
4d57dee8d9
* x86: Extension to CanBeCMOV that permits a potentially unsafe reference if it appears in the previous comparison
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
b108608b29
* x86: New CMP optimisation that mimics some of the CMOV optimisations and removes unnecessary conditions.
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
bab60d819f
* x86: Refactored CMOV optimisations and permitted the use of constants in some cases.
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
5f3749dc49
* x86: Introduced TrySwapMovOp method, and redesigned TrySwapMovCmp
...
to use it while also trying to move one more instruction back
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
6af886c2b9
* Removed foolish inline from StripLabelFast
2023-01-10 22:23:58 +00:00
J. Gareth "Curious Kit" Moreton
5cdef8050b
* Fixed bug in register preservation tracking
2023-01-10 22:23:58 +00:00
florian
f4d9082028
* copyright for 2023 updated
2023-01-09 22:54:46 +01:00
Karoly Balogh
3cea1706e9
m68k: more work on instruction validation for the internal assembler
2023-01-09 12:01:10 +01:00
Karoly Balogh
69761839c0
m68k: removed the unused S_IQ opsize
2023-01-09 12:01:10 +01:00
florian
0b45cd95f7
+ introduce long forms for $E, $F and $S, resolves #39889
2023-01-08 21:29:31 +01:00
Karoly Balogh
459dc68ab9
m68k: more boiler plate and refactor for a future internal assembler
2023-01-05 13:32:34 +01:00
Karoly Balogh
f2d6b4d530
m68k: added a helper function to check if a register is an FPU register
2023-01-05 13:32:33 +01:00
Jonas Maebe
a641860fa8
Implicit specialisation: use regular array parameters for array constructors
...
Fixes compilation of test/timpfuncspez5 with LLVM and debug info, as the LLVM
debug info writer internalerror's when you try to generate debug info for
an array constructor (since those types should never appear as parameter/
variable types).
Replace them with reusable regular array types, so that multiple invocations
of the same generic function with array constructors of the same type and
number of elements are collapsed into the same specialisation
2023-01-03 21:44:44 +01:00
Pierre Muller
cd8aa3f0e0
Avoid generation of invalid 'cb(n)z sp,label' instruction
2023-01-02 18:22:49 +00:00
florian
6c5f9537b3
* avoid to generate bt [mem], reg, resolves #40039
2022-12-31 18:27:27 +01:00
Tomas Hajny
1bb4003984
* messages regenerated after fixing #40008
2022-12-31 17:31:31 +01:00
Tomas Hajny
baf950bf76
* improved consistency as suggested in bug #40008
2022-12-31 17:27:06 +01:00
Jonas Maebe
32f8dc7ef5
symcreat: add hidden high parameters in create_procdef_alias
...
No longer happens automatically for pc_bareproc procdef copies
2022-12-31 11:59:05 +01:00
J. Gareth "Curious Kit" Moreton
a1abe51f2a
* Refactor of is_cyclic to use a linked list on the stack instead of a dynamic array
2022-12-31 09:04:02 +00:00
Sven/Sarah Barth
4b659175d9
- remove no longer required readonly functionality from tparasymtable
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
e1288897f3
* fix #40031 : with support for inline specializations it no longer makes sense to make the parameter symtable of a procedure variable type readonly as there *are* defs that are added to it
...
+ add adjusted test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
b6b2785b66
* also skip high parameters when pc_normal_no_hidden is given to tprocdef.getcopyas
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
430bcac389
* ensure that all hidden parameter symbols are removed when adding an anonymous function to a capturer (they'll be added again later on)
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
d7d65fe0d7
* fix typo in comment
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
4510945465
* fix #40062 : ensure that Self is only added to anonymous functions when dealing with method pointers
...
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
d410deb7ae
* when assigning an anonymous function to a method pointer move the function to the normal function level to avoid potential problems when accessing other variables
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
a6ddea87b7
* don't free the old, captured Self symbol as that does not belong to the anonymous function
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
1d73dab2b0
* a callnode for an anonymous function can have its procdefinition fixed, thus avoid the need to check for overloads
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
5d7e3ca240
* fix #40060 : ensure that Self is not added for anonymous functions that are part of a static class method
...
+ added test
2022-12-30 23:32:00 +01:00
Sven/Sarah Barth
4c6338207f
* fix #40061 : the Self of types that aren't implicit pointers (recods, TP-style objects, primitive types (for helpers)) needs to be stored as a Pointer in the Capturer so that modifications are correctly visible
...
+ added tests
2022-12-30 23:32:00 +01:00
florian
7affd78904
* do not throw an internal error on typed constants with wrong element count, resolves #40066
2022-12-30 21:53:04 +01:00
Karoly Balogh
721e988da2
m68k: add some initial CPU-specifc boilerplate for an internal ELF writer
2022-12-29 05:08:46 +01:00
Karoly Balogh
e19f60503b
m68k: updated instruction tables to match vasm release 1.9a
2022-12-29 03:36:51 +01:00
florian
4430422489
* improve module local data accesses by avoiding a got read
2022-12-28 22:05:23 +01:00
florian
30e0df384d
* second part of #40041 fixed
...
+ tests
2022-12-22 22:41:39 +01:00
florian
e0fef23d77
* properly transform a+const1-const2 into a+const1+(-const2), resolves #40041
2022-12-21 22:34:46 +01:00
Pierre Muller
e2905b8fad
Refuse A_Jcc, A_SETcc, and A_CMOVcc without condition
2022-12-10 19:50:47 +00:00
Pierre Muller
af04a523bb
* Fix testing of A_JCC and A_SETCC, add A_CMOVCC
...
* Add $PIC for i386 and x86_64 solaris assemblers
2022-12-10 17:41:33 +01:00
Pierre Muller
b9a8e6832f
Do not set usesectionprogbits and usesectionflags to true for solaris assembler
2022-12-10 17:41:05 +01:00
florian
14466ee9d9
* change table updates
2022-12-06 22:41:30 +01:00
Jonas Maebe
851af5033f
Darwin/AArch64: adjust alignment info of custom-aligned paralocs
...
Resolves #40019
2022-12-06 21:46:26 +01:00
florian
8ad7decaa3
* another change information update
2022-12-04 23:17:56 +01:00
Jonas Maebe
bba1076e12
LLVM: add Xcode 14.0 support (-ClvXcode-14.0)
2022-12-04 21:51:55 +01:00
Jonas Maebe
1e83d415c3
LLVM: us paraloc def instead of para def for byval
...
We also use the paraloc instead of the para to write the def
2022-12-04 21:51:55 +01:00
J. Gareth "Curious Kit" Moreton
f00a932cc6
* New is_cyclic function to detect if def references itself - fixes #40010
2022-12-03 23:53:16 +00:00
florian
42d91c02bd
* continued to fix change information
2022-12-03 23:36:07 +01:00
Jonas Maebe
230142e183
AArch64 cgcpu: add missing brackets around and/or expression
2022-12-03 21:17:18 +01:00
florian
e0eff8bd89
+ more change information fixed
2022-12-02 23:34:36 +01:00
Sven/Sarah Barth
7a34677b2a
* as long as the type passed into a TypeInfo() is not an undefined or error def the resulting value will always be constant at compile time, so it can be compared to another then no matter if typenode or not
...
+ added tests
2022-12-02 17:47:15 +01:00
Jonas Maebe
c5f4a6acd0
LLVM: fix variant records when alignment of first part is not the highest
...
Resolves #40015
2022-12-01 22:43:40 +01:00
florian
96d4bd19ac
* use bzhi only (if at all) for in_and_assign_x_y and not other in_*_x_y operations, resolves #40016
2022-11-30 22:16:21 +01:00
florian
a1a2549cf1
+ Debug message
2022-11-29 23:20:35 +01:00
J. Gareth "Curious Kit" Moreton
cc27576339
* x86: Fixed movzwl/movzbl bug in OptPass2Movx (resolves i40003)
2022-11-28 21:43:50 +00:00
florian
1700516721
* cleanup
2022-11-26 23:27:02 +01:00
J. Gareth "Curious Kit" Moreton
170c112301
* x86: Added FMA as an FPU target distinct from AVX and AVX2 (the latter of which has a new FPUX86_HAS_AVX2 flag)
2022-11-25 22:14:59 +00:00
J. Gareth "Curious Kit" Moreton
69c7838571
* x86: Addition of AMD CPUs: Bobcat, Jaguar, Piledriver, Excavator, Zen2 and Zen3 (and supporting flags)
2022-11-25 22:14:59 +00:00
florian
247423400f
* create muln with create instead of create_internal when converting "n - n mod const)" so pass1 works properly, resolves #40004
2022-11-24 22:43:27 +01:00
Pierre Muller
84be45f55d
Fix compilation failure of RTL with -Co option for x86_64-linux target
2022-11-24 17:01:37 +00:00
Pierre Muller
1a19fe1f03
Use correct class typecast for commit ba4cee279b
2022-11-23 08:43:28 +01:00
florian
0ba4cee279
* convert n-n mod const into n div const*const, resolves #39615
2022-11-22 22:41:58 +01:00
florian
7da8c774be
+ ShlShl2Shl optimization
2022-11-21 22:23:55 +01:00
florian
f6a8b045c2
* cosmetics
2022-11-21 22:10:29 +01:00
florian
4778973492
* further look ahead for temp. deallocation for FstpFldFstp2Fstp and FstpFld2<Nop>
2022-11-19 21:05:22 +01:00
florian
ef53f9bc25
+ FstpFldFstp2Fstp optimization
2022-11-18 23:37:34 +01:00
J. Gareth "Curious Kit" Moreton
e7e4044bf0
* CollapseZeroDistJump no longer updates registers or strips dead labels, instead just setting p to p.Next
2022-11-18 17:20:20 +00:00
J. Gareth "Curious Kit" Moreton
c21bf747fb
* x86: Extension to Cmp1Jl2Cmp0Jle to catch inverted variant
2022-11-18 17:20:20 +00:00
J. Gareth "Curious Kit" Moreton
e57ef24e37
* x86: TEST and CMP optimisations now perform jump optimisations prematurely to remove unnecessary TEST/CMPs
2022-11-18 17:20:20 +00:00
J. Gareth "Curious Kit" Moreton
3cf8ae8433
* x86: New XOR->BTC peephole optimisation
2022-11-15 21:10:47 +00:00
J. Gareth "Curious Kit" Moreton
f2bd099afb
* x86: Converted BTR and BTS tests to use a new utility function to check if BTx instructions are acceptable to use
2022-11-15 21:10:47 +00:00
J. Gareth "Curious Kit" Moreton
8220221866
* x86: New AND(NOT X)->BTR peephole optimisation
2022-11-15 21:10:47 +00:00
J. Gareth "Curious Kit" Moreton
827fe2bd83
* x86: New OR->BTS peephole optimisation
2022-11-15 21:10:47 +00:00
J. Gareth "Curious Kit" Moreton
314f632377
* x86: New TEST->BT peephole optimisation
2022-11-15 21:10:47 +00:00
florian
a27cb35fa8
* propagate life info properly
2022-11-15 22:06:56 +01:00
florian
3b43bd027c
* calculate life info for if nodes correctly if the then branch is empty, resolves #39992
2022-11-13 22:28:08 +01:00
J. Gareth "Curious Kit" Moreton
c9461b7313
* x86: Flags that relate to optimization hints rather than features have been moved to a separate set
2022-11-13 19:23:30 +00:00
Jonas Maebe
57466587c5
llvmdbg: remove unnecessary typedef intermediates
2022-11-12 21:14:28 +01:00
J. Gareth "Curious Kit" Moreton
a0c87be0fc
* x86: Zen processors now marked with CPUX86_HAS_FAST_BT_MEM flag
2022-11-12 13:18:53 +00:00
florian
d3abd339b7
+ cpu switch for zen
2022-11-11 23:45:52 +01:00
J. Gareth "Curious Kit" Moreton
e942c00f82
x86: MovMovMov2XChg optimisation now makes use of the CPUX86_HAS_FAST_XCHG flag
2022-11-11 22:29:58 +00:00
J. Gareth "Curious Kit" Moreton
aa5517d442
* x86: New CPU feature flags in cpuinfo units
2022-11-11 22:29:58 +00:00
Pierre Muller
71df6b83c6
Avoidd to use hp1 after calling RemoveInstruction, as the VMT is invalidated
2022-11-11 22:20:17 +00:00
Sven/Sarah Barth
a2789d611f
* fix crash in debug output in TX86AsmOptimizer.DoArithCombineOpt for DEC/INC $reg
2022-11-07 23:35:23 +01:00
Pierre Muller
d18ff64ed7
Fix a_load64_reg_ref and a_load64_ref_reg mips methods
2022-11-07 22:24:34 +00:00
Pierre Muller
c96bb0f416
Handle unaligned references in 64-bit a_load_ref_reg and a_load_reg_ref methods
2022-11-06 22:14:38 +00:00
florian
36afcbf7fe
* only i386 uses same special fastcall calling convention
2022-11-06 22:48:18 +01:00
J. Gareth "Curious Kit" Moreton
236febb148
* x86: Fixed bugs in and refactored and renamed
...
DoSubAddOpt optimisation method
2022-11-06 21:01:58 +00:00
Sven/Sarah Barth
9e3483fbeb
* fix #39977 : allow a capturer to access any method independant of visibility as the visibility checks are supposed to have been done before the captured symbol was converted
...
+ added test
2022-11-06 22:01:49 +01:00
Sven/Sarah Barth
b051e7667c
* fix #39978 : ensure that Self is captured when a method of the current class is captured into a function reference
...
+ added test
2022-11-06 22:01:49 +01:00
Sven/Sarah Barth
d221f42a57
* ensure that the correct overload is picked for function reference parameters
...
+ added tests
2022-11-06 22:01:49 +01:00
Sven/Sarah Barth
19cee9b841
+ mark the def for a capturer class with a corresponding object option
2022-11-06 22:01:48 +01:00
Sven/Sarah Barth
a714e2ff35
* fix #39981 : retrieve the symbol that returns the desired procdef/procvardef not maybe the Self or something else as we need that symbol to differentiate the procdefs
...
+ added test
2022-11-06 22:01:48 +01:00
Sven/Sarah Barth
3c2703787c
* ensure that newly created tloadparentfpnodes have a valid resultdef as they might be created in situation where the loadnode itself is no longer typechecked
2022-11-06 22:01:48 +01:00
J. Gareth "Curious Kit" Moreton
c40f518de4
* x86: "x and ((1 shl y) - 1)" to BZHI adapted for in_and_assign_x_y
2022-11-06 15:42:09 +00:00
J. Gareth "Curious Kit" Moreton
7da9b4a988
* x86: The code generator will now attempt to manipulate "x and ((1 shl y) - 1)" to use BZHI
2022-11-06 15:42:09 +00:00
J. Gareth "Curious Kit" Moreton
e748e4c7ab
* x86: Added new emit_reg_ref_reg routine and related methods to support BMI2 instructions
2022-11-06 15:42:09 +00:00
Jonas Maebe
95f94a279c
llvmdbg: fixes for method debug info
...
Mark "self" parameter as artificial
Add methods to the scope of the class/record rather than to the file scope
Add the vmt field, strip the "($)hidden" prefix from its name, and emit its
real type
2022-11-06 16:41:25 +01:00
Jonas Maebe
c5cdfbd9c0
dwarf-eh: don't emit header if there's no data to emit
2022-11-06 16:41:25 +01:00
florian
1b08b89b7b
* check if a target really supports safecall before calling load_safecallresult_node
2022-11-06 16:38:01 +01:00
florian
3db1415a44
* generate correct dfa for subroutines declared as safecall
2022-11-05 16:56:24 +01:00
florian
e67670fa70
* changed of do_optdeadstoreelim must be passed by reference as noted by Alexey Torgashin
2022-11-03 19:01:02 +01:00
florian
342524c312
* run dead store elimination multiple times if needed
2022-11-02 22:14:12 +01:00
florian
a0366d7d28
* dead store elimnation should not remove statements which can cause an exception
2022-11-02 22:13:40 +01:00
florian
3f7bf0fd70
* stop generation of typed array constants if the size does not match, resolves #39980
2022-11-01 21:16:31 +01:00
florian
0eee70ac81
* fix FindUnitSymtable for exception symtables, resolves #24801 and #39974
...
* more consistent naming of exceptsymtable enumeration symbol
2022-10-31 20:19:10 +01:00
J. Gareth "Curious Kit" Moreton
dbd8259c48
* x86: Fixed mistake in var9 optimisation under -Os; "andl $255,%eax" is not
...
smaller than "movzbl %al,%eax" because the immediate is sign-extended,
not zero-extended, so $255 will be stored as a 32-bit value.
2022-10-31 18:40:23 +00:00
Pierre Muller
92cc78e723
Allow cycle to finish successfully with -dEXTDEBUG without ALLOW_WARNINGS=1
2022-10-31 07:09:37 +01:00
Jonas Maebe
6d3e3d06e2
Linux: don't discard CFI when using it for exceptions
2022-10-30 21:57:19 +01:00
Jonas Maebe
57935a895c
Darwin: really fix -Xg for DWARF4
2022-10-30 21:57:19 +01:00
Jonas Maebe
e62cf5b9e7
systems_iphonesym -> systems_iphonesim
...
It's a simulator, not a symbolator
2022-10-30 21:57:18 +01:00
J. Gareth "Curious Kit" Moreton
3ba9cf5b4f
* x86: PostPeepholeOptTestOr has different debug messages for each found instruction, and also tests for BEXTR and BZHI.
2022-10-30 16:16:56 +00:00
J. Gareth "Curious Kit" Moreton
a7d1f7d771
* x86: FuncMov2Func now has code to remove "mov %reg,%reg" (since it doesn't get removed in Pass 2).
2022-10-30 16:06:01 +00:00
J. Gareth "Curious Kit" Moreton
3d805b8a9a
* x86: FuncMov2Func moved to separate method and also called by OptPass2MOV.
2022-10-30 16:06:01 +00:00
J. Gareth "Curious Kit" Moreton
d35be8a9ea
* x86: Extended FuncMov2Func optimisation to handle 1, 3 and 4-operand functions
2022-10-30 16:06:01 +00:00
J. Gareth "Curious Kit" Moreton
9fc2b9062d
* x86: Updated Mov0LblCmp0Jne optimisation to work when alignment hints appear before the label
2022-10-30 15:58:43 +00:00
florian
a1064ad8fd
+ MovSubCmp2MovSub optimization
2022-10-30 16:58:09 +01:00
Pierre Muller
ae12a79bf7
Avoid string truncation
2022-10-30 10:59:31 +01:00
Pierre Muller
dce70b3b70
Short version of the mips code genration bug
2022-10-29 21:34:00 +01:00
Jonas Maebe
f18524f2fe
Darwin: fix mac0S 11.0 version string
...
Prevents LLVM warnings
2022-10-29 14:24:37 +02:00
Jonas Maebe
cd8ddffe42
AArch64: X18 is not a volatile register
...
It may be unused on some platforms, but in general it's reserved for OS library
usage (usually related to TLS)
2022-10-29 14:24:37 +02:00
Jonas Maebe
49fb1b4c29
RTTI: don't generate full RTTI for internal types
...
These are types created by the code generator for internal purposes, and hence
are never queried by user code
2022-10-29 14:24:37 +02:00
Sven/Sarah Barth
f0e31628ad
* ensure that hmodule is initialized correctly
2022-10-29 12:15:59 +02:00