Karoly Balogh
06da0b3db6
* fix m68k IE after e9acd759
, patch by Yuriy Sydorov
2021-12-13 16:14:59 +01:00
J. Gareth "Kit" Moreton
f60523a3b9
x86: New TEST optimisations
2021-12-12 21:40:42 +00:00
Yuriy Sydorov
e9acd759a4
* Fixed random AVs when targeting the AVX FPU.
2021-12-12 18:19:35 +02:00
Yuriy Sydorov
7b2cd0bcdc
* Prevent a range check error in case of big unsigned values.
2021-12-12 17:55:46 +02:00
Yuriy Sydorov
59fca3a01d
* Increased the bounds of TBooleanArray to prevent a range check error while linking Lazarus.
2021-12-12 15:50:12 +02:00
florian
5921fa9a62
+ store references to global variables in registers if benefical (currrently used for aarch64 only)
2021-12-11 22:46:27 +01:00
J. Gareth "Curious Kit" Moreton
72661fd5c1
Added missing MOVSXD check to PostPeepHoleOptsCpu
2021-12-09 02:15:55 +00:00
Florian Klämpfl
49af134ba7
* compilation of x86_64-win64 fixed
2021-12-04 16:21:29 +01:00
florian
0b3fb55c6a
* generate no exit code at all on x86-64 if the subroutine is compiled with po_noreturn
2021-12-03 23:26:28 +01:00
J. Gareth "Curious Kit" Moreton
0f1c4b4db8
Fixed Unreachable code warning when building on a 32-bit platform with DEBUG_NODE_XML
2021-12-02 20:32:05 +00:00
florian
89aeedac1e
* fixes excluding of cpu capabilities
2021-12-01 22:48:19 +01:00
florian
60623f39a1
+ - can be used to remove options from a cpu capability switch
2021-11-30 22:37:47 +01:00
ccrause
793c157a9c
Always call DoExec to generate linker scripts. Even if cs_link_nolink is set, the ldgen scipt needs to be called in the generated ppas script.
2021-11-29 22:42:49 +01:00
ccrause
b0c0309cc1
Add output path to kconfig source file location parameters.
2021-11-29 22:42:49 +01:00
ccrause
f66dd54bc2
Extract linker script generation as separate method. Check if esp linker scripts can be found in library paths, if not then generate scritps.
2021-11-29 22:42:49 +01:00
ccrause
ab00794343
Keep esp32 and esp8266 version specific tweaks separate.
2021-11-29 22:42:49 +01:00
ccrause
a58567004b
Remove unused $OUTPUT substtution and empty check of outputexedir.
2021-11-29 22:42:49 +01:00
ccrause
655a5f526c
Place IDF related files in executable output folder.
2021-11-29 22:42:49 +01:00
ccrause
e86d3af7e0
The linklib list for esp-idf v4.2 is also needed for v4.3
2021-11-29 22:42:49 +01:00
florian
5db20610dd
* correct idf version check
2021-11-29 22:42:49 +01:00
florian
802f24dfbd
* force result to be set
2021-11-29 22:42:49 +01:00
florian
54f2308d2a
+ draft for esp-idf version specific rtl unit which contains the necessery linklib statements
2021-11-29 22:42:49 +01:00
florian
dc161e519f
* inputfilepath might not be empty
2021-11-29 22:42:49 +01:00
ccrause
5289aab4f2
Add -WP option so that IDF version can be passed in - stored in globals.idf_version. The version is checked in t_freertos.pas and for esp-idf version 4.3.x an extra link file is added, also running ldgen.py is skipped as that seems unused.
2021-11-29 22:42:49 +01:00
Pierre Muller
222a41be7b
Change declaration of DynLinkStr local variable of MakeExecutable method to ansitring to avoid short string overflows
2021-11-28 23:57:09 +00:00
Jonas Maebe
2de72c8541
Linux/PPC64: fix missing TOC loads
...
Routines loading a global symbol need the TOC register
2021-11-28 18:32:32 +01:00
florian
9314bbbf08
* compilation hopefully fixed
2021-11-28 00:03:30 +01:00
Yuriy Sydorov
4f711a8b2c
* Use longint for Tmoveins.id instead of word to prevent overflow in extreme cases.
2021-11-28 01:02:20 +02:00
florian
12f48c230b
* use high level interface wrappers for powerpc64 if pic is generated as
...
the abi does not support branches between functions located in different
tocs which might happen for inter-module branches
2021-11-27 23:33:22 +01:00
Yuriy Sydorov
5c55f1a16e
* Added Tmoveins.id to be used for sorting and searching in Tmovelist, to
...
produce the consistent order of elements.
This fixes occasional differences in the register allocation caused by
the address space randomization. When ASLR is in effect, the previous
approach to sort elements by their memory addresses can't guarantee the
consistent elements order for each compilation of the same source code.
2021-11-27 19:44:50 +02:00
florian
e132ae2fee
* last commit was not correct, fixed
2021-11-27 00:28:57 +01:00
florian
bf5f37b14a
* fix conditional statement as pointed out by Sergey Larin
2021-11-26 22:27:19 +01:00
Pierre Muller
271ba59cf1
All Makefile's regenerated
2021-11-25 22:13:32 +00:00
florian
5bddb3a435
* x86-64 can handle overflows in 64 bit multiplications directly, part of resolving #39450
2021-11-24 23:06:38 +01:00
florian
65ef6f1f37
* regenerated Makefiles
2021-11-24 22:50:37 +01:00
florian
b733e21fd1
+ more AArch64 extensions
2021-11-20 20:47:47 +01:00
florian
67f3a7502d
+ Aaarch64: support adr instructions with local labels in the assembler reader
...
+ throw an error if an illegal instruction extension is passed as command line option
2021-11-19 22:37:47 +01:00
florian
6404478ea4
* cleanup of VER3_0 defines
2021-11-17 22:19:57 +01:00
J. Gareth "Curious Kit" Moreton
2dc0995067
- Bug fix to new ADD/SUB optimisation where conditions are concerned
...
- Register allocation fixes for overflow checks
2021-11-17 20:18:57 +00:00
J. Gareth "Curious Kit" Moreton
3ce6c478cc
Bug fixes to magic division and vectorcall code that trigger -CriotR checks
2021-11-16 20:39:57 +00:00
J. Gareth "Curious Kit" Moreton
9f60628e5b
x86: new optimisation to change add/sub 128,(dest) to sub/add -128,(dest) to reduce binary size
2021-11-14 21:38:38 +00:00
florian
feb5bde09c
* better code and data size info for FreeRTOS
2021-11-13 19:04:58 +01:00
florian
550d0481b3
* better error message
2021-11-11 22:52:21 +01:00
florian
03ce23246f
* patch by Don Siders: Fixes spelling, grammar errors in source and compiler messages, resolves #39434
2021-11-10 19:16:14 +01:00
florian
e4ee8fa6a2
* patch by Rika to pass some strings by reference, resolves #39338
2021-11-09 22:41:52 +01:00
Pierre Muller
8e7791ac23
Explicitly disable overflow for offset propagation optimization
2021-11-08 22:55:44 +00:00
J. Gareth "Curious Kit" Moreton
671c674d65
Expanding division to 64-bit and tests
2021-11-08 21:46:12 +00:00
florian
292be9029e
* when converting a*a into sqr(a), set the result type correctly
...
* removefloatupcasts takes care of cs_excessprecision, resolves #39012
2021-11-07 21:54:25 +01:00
florian
d708bef92f
+ Aarch64: read register sets with ranges properly
...
+ tests
2021-11-07 20:02:29 +01:00
florian
7fcbd1d7e0
* my last commit hopefully fixed
2021-11-07 14:58:17 +01:00
florian
492d75483d
* fix (V)Cvtss2CvtSd(V)Cvtsd2ss2* optmizations for non-avx code, resolves #39416
2021-11-07 14:46:13 +01:00
florian
c917639b91
* cosmetics
2021-11-07 14:46:03 +01:00
florian
f570b6cb7b
+ more Aarch64 cpu capability flags added
2021-11-07 11:06:01 +01:00
florian
c1d43df4a1
+ be able to add single cpu capabilites by the command line
...
+ AArch64: SHA2 capability
2021-11-06 23:32:56 +01:00
florian
716e8c8e89
* tcgsizep2size now supports all tcgsize values
2021-11-06 21:16:07 +01:00
Yuriy Sydorov
8e5c2467e2
* Fixed node coalescing with real registers.
2021-11-06 21:47:28 +02:00
florian
9423d5e390
+ fp-armv8 fpu type added
2021-11-06 11:00:53 +01:00
florian
9feafc7bd7
+ ARM: started on vfpv5 support
2021-11-05 23:05:38 +01:00
florian
44051b4af3
* corrected accidently made changs in 01a449c8
, resolves #39424
2021-11-03 22:41:07 +01:00
florian
2240c69078
* improved heurisics when thread var addresses or float constants are put in registers
2021-11-03 22:28:48 +01:00
Florian Klämpfl
a47f153dae
* avoid to create a stack frame on aarch64 if possible
2021-11-02 22:23:24 +01:00
florian
e0a78c2485
* tcgaarch64.g_concatcopy calls tcgaarch64.g_concatcopy_move only if the current subroutine has pi_do_call set
...
* fixed copy loop in tcgaarch64.g_concatcopy if ldp/stp is used: fixed increment calculation and fixed tail length calculation
2021-11-02 22:01:52 +01:00
Yuriy Sydorov
7e4753bebd
* Typo fixed.
2021-11-02 20:36:30 +02:00
Yuriy Sydorov
5b32c81bef
* Corrected setting of the flag.
2021-11-02 20:33:34 +02:00
Yuriy Sydorov
b78761efd3
* Removed obsolete OLDREGVARS ifdefs.
2021-11-02 17:08:08 +02:00
Yuriy Sydorov
d96600a02d
* Removed unused and confusing tnode.parent and tnode.concattolist().
2021-11-02 16:55:59 +02:00
Yuriy Sydorov
d0cc649428
* Write interference graphs to the unit output directory.
2021-11-02 16:46:09 +02:00
Yuriy Sydorov
e04df465ef
* The label which is generated by traisenode is not a jump target. Mark
...
this label as nf_internal, which means the label does not impact the
code flow. This leads to a much better register allocation.
2021-11-02 16:46:09 +02:00
Yuriy Sydorov
c4a1cdceae
* Corrected calculation of spilling efficiency.
2021-11-02 16:46:08 +02:00
Yuriy Sydorov
c9d9d42f0e
* Better coalescing with real registers. This improves setting of parameters
...
in registers.
* Removed superfluous condition in trgobj.enable_moves().
* Fixed flags checking in trgobj.adjacent_ok().
* Added assembler comments about coalescing when DEBUG_SPILLCOALESCE is defined.
2021-11-02 16:46:08 +02:00
Yuriy Sydorov
66b7ed45fd
* Removed unused tlocation.registers[].
2021-11-02 16:46:08 +02:00
florian
dcb1fcd9b8
+ support $lgeacyifend directive, resolves #37676
2021-11-01 23:24:42 +01:00
Jonas Maebe
89d2775191
optcse: fix wrong typecast
2021-11-01 13:56:51 +01:00
florian
fcdbb31ec4
* AArch64: TCpuAsmOptimizer.RegLoadedWithNewValue: check if p.ops=0
2021-11-01 11:46:19 +01:00
Jonas Maebe
15865e7602
Record variant discriminators: check types
2021-10-31 21:13:35 +01:00
florian
4f77cbbac4
+ keep addresses of thread vars in registers if possible and likely an advantage
2021-10-31 19:25:01 +01:00
florian
5a617cd108
+ fold real constants c1,c2 for v+c1+c2 or c1+(c2+v) (+ being either + or *) as well if fastmath is enabled
2021-10-31 17:38:08 +01:00
J. Gareth "Curious Kit" Moreton
284317d877
Fixed OptPass2Lea not honouring symbols
2021-10-31 15:44:00 +00:00
J. Gareth "Curious Kit" Moreton
42eb06f5c6
Fixed some range check problems
2021-10-31 15:44:00 +00:00
J. Gareth "Curious Kit" Moreton
b58fdc3e58
Improved ADD and SUB optimisations for LEA instructions
2021-10-31 15:44:00 +00:00
florian
ff3acfb8cd
* cleanup of 2.7.0 defines
2021-10-31 13:20:28 +01:00
florian
e657aa6431
+ write code and data size for Mach-O files if possible
2021-10-31 11:57:32 +01:00
florian
fb7cdbefb3
+ some opcodes added
2021-10-30 20:21:59 +02:00
florian
95ad8f1694
* correctly read the region label in $region directives, resolves #39395
2021-10-28 21:13:01 +02:00
Jonas Maebe
3263e12a3e
iphonesim: use ios_simulator_version_min
...
The linker expects ios_simulator_version_min rather than -iphoneos_version_min
when targeting the iOS simulator platform. Fixes compilation with Xcode 11
toolchains, which is more strict about this.
2021-10-27 20:53:42 +02:00
Jonas Maebe
334cf9c19d
iphonesim target: requires proper alignment
...
Just like the native iOS targets
2021-10-27 20:53:39 +02:00
florian
4b157a1498
+ print full file path if -vb is passed even if no line number is known, resolves #39419
2021-10-26 21:37:28 +02:00
florian
10fcae34a9
* improved TX86AsmOptimizer.OptPass1MOVXX
2021-10-24 18:38:23 +02:00
florian
4610980f2e
* TX86AsmOptimizer.OptPass1MOVXX takes care of volatility
2021-10-23 23:40:09 +02:00
Nikolay Nikolov
7f1050464a
+ added 'else' tracking for the if..end_if blocks
2021-10-23 11:56:25 +03:00
Nikolay Nikolov
7bef4d827d
* keep track of the block stack, when resolving labels and check whether the
...
blocks match (i.e. block..end_block, if..end_if, loop..end_loop, try..end_try)
2021-10-23 11:25:44 +03:00
J. Gareth "Curious Kit" Moreton
342803532d
Bug fix to MovMov2Mov 6 optimisation exposed by 4012c3dbd4
(and miscellaneous code refactors)
2021-10-22 22:39:46 +00:00
florian
d0fdda6da7
+ TDFABuilder.redodfainfo
2021-10-22 22:39:39 +02:00
Nikolay Nikolov
12a2c56461
- removed thlcgwasm.incblock, .decblock and br_blocks, as branching is now done
...
entirely with labels
2021-10-22 17:42:29 +03:00
Nikolay Nikolov
3094f75690
* WebAssembly code generation for 'case' nodes changed to use labels
2021-10-22 17:31:04 +03:00
Nikolay Nikolov
6fe647ee3d
* moved the default procedure CurrRaiseLabel to the end of the procedure, not
...
at the exit label. This fixes problems when using units with finalization
code that contain classes with class destructors in branchful WebAssembly
exceptions mode.
2021-10-22 13:54:55 +03:00
Nikolay Nikolov
470e77a572
+ added sanity check when resolving labels to ensure we don't get any jumps with
...
negative nesting depth
2021-10-22 13:54:55 +03:00
Nikolay Nikolov
5a0956d805
* use WebAssembly asm labels for the raise branch instruction in branchful
...
exceptions mode
2021-10-22 13:54:55 +03:00
Karoly Balogh
e018264ad9
internalerror if the section we're about to keep has no exesection assigned
2021-10-20 14:37:27 +02:00
Nikolay Nikolov
4e3a6aa5a8
* match the label to the wider block, if it is adjacent to both the brevious
...
and the next instruction
2021-10-20 14:35:52 +03:00
Nikolay Nikolov
c96e203780
* moved the 'end_block' WebAssembly instruction before the 'exit' label right
...
before the procedure finalization code. This fixes compilation errors in
procedures with implicit finalization code (e.g. for ansistring local vars,
etc).
2021-10-20 14:35:52 +03:00
Nikolay Nikolov
bb30958665
+ wrap block nodes with exit in a_block..a_end_block instructions. This fixes
...
'exit' in inlined procedures on the WebAssembly target.
2021-10-20 14:35:51 +03:00
Nikolay Nikolov
703ae75ba6
* if a label cannot be associated with the previous block instruction, try
...
matching it with the next instruction
2021-10-20 14:35:51 +03:00
Nikolay Nikolov
9f077d4ac0
* leave unresolved branches in the asm output, when the compiler is compiled with -dEXTDEBUG
2021-10-20 14:35:51 +03:00
Nikolay Nikolov
1ce2fb8a4a
* use WebAssembly asm labels for generating code for the 'exit' statement
2021-10-20 14:35:51 +03:00
Nikolay Nikolov
dc9090e67f
* fixed some more warnings
2021-10-20 10:23:02 +03:00
Nikolay Nikolov
b3a9c36cbb
* fixed some warnings
2021-10-20 10:03:14 +03:00
Nikolay Nikolov
0662a0bd44
+ use WebAssembly asm labels for the code generation of 'break' statements as well
2021-10-20 09:59:54 +03:00
Nikolay Nikolov
01dc62b127
+ introduced the use of asm labels for WebAssembly. Resolve them in
...
tcpuprocinfo.postprocess_code. Use them when generating code for the
'continue' label jumps.
2021-10-20 09:39:44 +03:00
florian
7e73e0dd23
+ support reading of .p2align with op code and/or max. bytes in the gas assembler reader
...
+ test
2021-10-18 22:12:27 +02:00
florian
08050086b9
* keep type when removing "1*", resolves #38840
2021-10-17 22:23:49 +02:00
florian
ee10850a57
* patch by Sergey Larin: Reducing and aligning the size of TAnsiRec, TUnicodeRec for CPU64, resolves #38018 :
...
For CPU64, the size of record TAnsiRec and TUnicodeRec is 16 bytes instead of 24.
Which is very good also because of the alignment. when allocating memory, the address
of the first character of the string will be aligned on the 16-byte boundary.
At the same time, the useless Dummy field, which is needed in CPU64 for exactly alignment, has been removed.
For CPU32 (and CPU16), the record size has not changed, so procedures such as
fpc_AnsiStr_Decr_Ref, implemented in assembler (see i386, arm), remained working correctly.
* tests adapted
2021-10-17 11:13:29 +02:00
florian
ea6529ff63
* manually merged merge request 69 by J. Gareth "Kit" Moreton:
...
x86: CMP/MOV refactoring and expansion
This merge request refactors the SwapMovCmp routine, and calls to it, to be more self-contained,
having the preliminary checks built-in to ensure that moving the MOV instruction is
actually a sound idea, while also making it more general-purpose so it can handle instructions
that are not MOV operations. This feature is primarily for future expansion,
but also cleans up the code for the x86 peephole optimizer.
2021-10-17 10:22:30 +02:00
florian
4012c3dbd4
* merge request 75 by J. Gareth "Kit" Moreton manually applied:
...
This merge request makes a number of improvements to the DeepMOVOpt method and supporting functions:
* ReplaceRegisterInInstruction now replaces registers in references that are written to
(since the registers themselves won't change)
* RegModifiedByInstruction will no longer return True for a register that appears in a reference
that's written to (for the same reason as above) - special operations like MOVSS
(the 0-operand version) aren't affected.
* DeepMOVOpt returning True will now always set the Result of OptPass1MOV to True even though p
wasn't directly modified, since this often caused missed optimisations.
* Some of the speed-ups in the patch from #32916 have also been applied in order to make
the general DeepMOVOpt run faster, notably it tries to avoid calling UpdateUsedRegs where possible.
2021-10-17 09:50:47 +02:00
J. Gareth "Curious Kit" Moreton
fd28cc0db0
Better handling of zeroing upper parts of registers
...
Better handling of zeroing upper parts of registers
2021-10-16 14:42:19 +02:00
J. Gareth "Curious Kit" Moreton
674ed4069a
Expanded MM block move to include YMM registers under AVX
2021-10-16 14:17:41 +02:00
florian
d55b2c2a35
+ extend assembler optimization MovxMov2Mov to MovxOp2Op
2021-10-15 23:12:59 +02:00
Nikolay Nikolov
0da5d57c1e
* replaced the 'if br end_if' sequence with the 'br_if' instruction, when
...
generating WebAssembly code for try..finally blocks (in all exception modes)
2021-10-14 14:19:13 +03:00
Nikolay Nikolov
dcae87bd52
+ support cdecl and stdcall on the WebAssembly target. They are essentially the
...
same, the only difference is that cdecl creates an unmangled alias
2021-10-14 12:29:59 +03:00
Nikolay Nikolov
b91fc3a0d3
* fixed passing of singleton record parameters, containing a float in WebAssembly
2021-10-14 10:53:55 +03:00
Nikolay Nikolov
df92d88f39
+ added support for the handling of singleton record and array types in
...
defToWasmBasic
2021-10-14 10:53:55 +03:00
Nikolay Nikolov
3511b80972
* fixed formatting in defToWasmBasic
2021-10-14 10:53:55 +03:00
Nikolay Nikolov
ee387f7c66
* C ABI fixes for the passing of records in WebAssembly
2021-10-14 10:53:55 +03:00
Nikolay Nikolov
236e10d03a
+ pass 64-bit structures by address in WebAssembly for compatibility with LLVM's C ABI
2021-10-14 10:53:55 +03:00
florian
321764bdd9
* fix warnings with -dDEBUG_NODE_XML, resolves #38222
2021-10-13 23:08:32 +02:00
florian
6cb24a3929
* itcpugas unit for Z80 providing gas_regname to fix compilation with -dDEBUG_NODE_XML
2021-10-13 23:08:32 +02:00
florian
00d4a6889d
* add no internal flag when folding constants in taddnode.simplify, resolves #39308
2021-10-12 22:59:45 +02:00
florian
ca9384fd6c
* patch by Dean Mustakino to avoid generation of debug info for generics, resolves #38827
...
+ test
2021-10-11 18:45:41 +02:00
florian
07413be8b5
+ being able to define change information for xmm0
...
* corrected change information for SHA256RNDS2
2021-10-10 23:07:23 +02:00
J. Gareth "Curious Kit" Moreton
a925522ead
xor optimisation now doesn't check to see if the REX prefix will actually be removed, as it's beneficial for speed reasons to only use the 32-bit register when zeroing the whole thing
2021-10-10 16:17:43 +00:00
florian
2c180cf101
* by default, DEBUG_AOPTCPU is only enabled if the compiler is compiled with -dEXTDEBUG
2021-10-10 15:35:38 +02:00
J. Gareth "Curious Kit" Moreton
d502bccc1b
A pair of inlines
2021-10-10 09:19:57 +00:00
florian
cc3cbbb7b9
* fix x86 compilation after my last commit
2021-10-10 10:21:21 +02:00
florian
a4672fbd1c
o based on a patch by Rika, resolves #39401 :
...
* use Base64 (62=_, 63=$) encoded FNV hash (instead of CR-32) to shorted identifiers
* renamed fpccrc to fpchash
+ test
2021-10-10 10:09:22 +02:00
florian
6c7e6191f6
+ support of SHA extension in the internal assembler
2021-10-09 15:44:46 +02:00
florian
8f68988aef
* another location to use source register as second register in VCVTSD2SS and VCVTSS2SD
...
to break dependency chains, hopefully final fix for #39360
2021-10-09 14:24:14 +02:00
florian
b4bf371b34
* generate VMOVAPS for (V)Cvtss2CvtSd(V)Cvtsd2ss optimization, resolves #39360
2021-10-08 22:59:29 +02:00
Nikolay Nikolov
344da9597f
+ added the current WebAssembly exceptions mode to the .ppu module flags and
...
perform a check to ensure all units are compiled in the same exceptions mode
as the main program
2021-10-08 23:50:28 +03:00
Yuriy Sydorov
7388735b11
* Strength reduction optimization: - Use a temp for complex loop start values to prevent double evaluation.
...
- For slow CPUs perform the optimization for all sizes of array elements.
2021-10-08 18:04:03 +03:00
Yuriy Sydorov
6bf4c7a68d
* Optimized evaluation of the condition.
2021-10-08 16:51:42 +03:00
florian
4752230c8f
* use source register as second register in VCVTSD2SS and VCVTSS2SD, this should break
...
dependency chains better and resolves partially #39360
2021-10-07 23:16:39 +02:00
florian
ec40db3da7
+ (V)Cvtss2CvtSd(V)Cvtsd2ss2Nop optimization, resolves #39360
2021-10-06 21:57:24 +02:00
florian
d5867793f6
* partially applied patch by J. Gareth "Kit" Moreton to inline parts of cclasses, resolves #39344
2021-10-06 21:24:18 +02:00
Nikolay Nikolov
074ce9c50f
+ added call to g_maybe_checkforexceptions after generating call to fpc_iocheck
2021-10-05 18:02:11 +03:00
Nikolay Nikolov
3c58f26e83
* thlcgwasm.g_checkexceptions renamed .g_maybe_checkforexceptions, added also as
...
an empty virtual method in thlcgobj and modified the WebAssembly
implementation, so that it can be called from any exceptions mode (so it
emits no code in exception modes that don't require it, instead of generating
an internal error). This will allow .g_maybe_checkforexceptions to be called
from the generic parts of the code generator, after calls to systemprocs that
could raise an exceptions.
2021-10-05 17:54:35 +03:00
Nikolay Nikolov
fab4ca449b
* twasmexceptionstatehandler_nativeexceptions.handle_nested_exception and
...
twasmexceptionstatehandler_bfexceptions.handle_nested_exception should not be
called, so now they cause an internal error
2021-10-05 07:54:57 +03:00
Nikolay Nikolov
04a41fa5b0
- removed duplicated assignment
2021-10-05 07:43:47 +03:00
Nikolay Nikolov
99ab6bd56d
+ proper exception object cleanup when using break, continue or exit in try
...
except blocks in WebAssembly native exceptions mode
2021-10-05 07:41:42 +03:00
Nikolay Nikolov
ddbdc529b1
+ proper exception cleanup for try except blocks that use exit, break or
...
continue in WebAssembly branchful exceptions mode
2021-10-05 07:19:24 +03:00
Nikolay Nikolov
023f08d54b
+ exception cleanup when break, continue or exit is used inside a
...
try .. except 'on' block, in WebAssembly native exceptions mode
2021-10-05 06:45:31 +03:00
Nikolay Nikolov
cf7ad98dbf
+ support exception object cleanup, when 'exit', 'break' or 'continue' is used
...
in the except 'on' statements, in branchful WebAssembly exceptions mode
2021-10-05 06:25:32 +03:00
Nikolay Nikolov
7110d1e48e
* use 'br_if' instead of 'if br end_if' sequence in the code, generated by
...
thlcgwasm.g_checkexceptions
2021-10-05 05:29:10 +03:00
Nikolay Nikolov
f7b1ec2435
+ call g_checkexceptions after calls to fpc_reraise and fpc_raise_nested in
...
branchful exceptions mode
2021-10-05 03:38:33 +03:00
Nikolay Nikolov
464b3ebbed
+ implemented the 'on' node code generation (try except 'on' ...) for the
...
branchful exceptions mode
2021-10-05 03:25:03 +03:00
Nikolay Nikolov
a5dcd1c44d
+ initial implementation of try..except in branchful exceptions mode
2021-10-05 03:14:58 +03:00
Nikolay Nikolov
7ce19c1ad7
+ implemented try..finally in branchful exceptions mode
2021-10-05 02:47:49 +03:00
Nikolay Nikolov
7afb665c92
+ insert exception flag check and branch after each function call, when
...
compiling in WebAssembly branchful exceptions mode
2021-10-05 02:26:13 +03:00
Nikolay Nikolov
5be1bfeeca
+ added comment that states that raiseBr is only used in branchful exceptions mode
2021-10-05 01:11:31 +03:00
Nikolay Nikolov
d02921d66b
+ introduced raiseBr, similar to exitBr, but will point to the current
...
innermost exception handler, if there is such a handler in the current
procedure, otherwise it will be the same as exitBr.
2021-10-05 01:07:37 +03:00
Nikolay Nikolov
6599f1d898
- don't generate any WebAssembly native exception handling instructions, nor
...
relocations, when compiling in branchful exceptions mode. This produces a
currently not working, but accepted by wasmtime binary (otherwise, it
complains it doesn't support exceptions and refuses to try to run it).
2021-10-05 01:01:24 +03:00
Nikolay Nikolov
5124ab2521
* cloned the WebAssembly native exceptions code generation and rtl support into
...
the branchful exceptions (which will be modified later, but we're using this
as their starting point, because we can get a snapshot built, without compiler
internal errors)
2021-10-05 00:37:20 +03:00
Pierre Muller
7778d20003
Avoid range check error in TCpuAsmOptimizer.OptPostAnd method
2021-10-04 21:08:24 +00:00
florian
1e136b0cc7
* bail out early in MatchInstruction
2021-10-04 22:18:53 +02:00
florian
01a449c807
+ debug msg added
2021-10-04 22:11:08 +02:00
Jonas Maebe
c745ae4836
AArch64 popt: don't replace registers with X/WZR
...
Most arithmetic/logica instructions don't support X/WZR as operand (since
you should use movk with the calculated constant in that case)
Resolves #39372
2021-10-04 20:58:05 +02:00
Yuriy Sydorov
e9d318e7e2
* x86: Fixed update of used registers in the CMOV optimizations.
...
This fixes a bug reported by Martin Frb in fpc-devel which is triggered
by the recently provided test code in FPC 3.2.2 x86_64, but is hidden
in trunk by other pipeline peephole optimizations.
2021-10-04 18:10:34 +03:00
Nikolay Nikolov
3989a01968
- removed msg2inc. Stupid git added it without my consent.
2021-10-04 00:34:18 +03:00
Nikolay Nikolov
9a85ac204c
+ fixed compilation of ppudump
2021-10-04 00:29:27 +03:00
florian
494dac5db5
+ x86: MovOp2Op optimization
2021-10-03 23:17:27 +02:00
Nikolay Nikolov
1011c31a80
+ increase string type to avoid const string truncation
2021-10-04 00:15:27 +03:00
Nikolay Nikolov
2577180b93
+ introduced WebAssembly branchful exceptions
2021-10-04 00:10:31 +03:00
Jonas Maebe
ab01b0ebd7
Typed constants: no internalerror on failure
...
Don't check whether the expression queue is empty in the destructor in case
there was an error. Also improved error messages (constant expression instead
of variable expression expected).
Resolves #39393
2021-10-03 21:46:23 +02:00
J. Gareth "Curious Kit" Moreton
190c77e863
Fixed bug where hp1 object was used after being freed
2021-10-03 19:45:22 +01:00
florian
2e8c99947a
* define DEBUG_AOPTCPU if EXTDEBUG is used
2021-10-03 18:40:20 +02:00
Nikolay Nikolov
890b899842
+ support the <= and >= operators for smallsets on the Z80
2021-10-03 18:33:00 +03:00
Nikolay Nikolov
b00c0e44a5
+ support equality comparison of smallsets on the Z80
2021-10-03 18:16:45 +03:00
Jonas Maebe
3fb0fab410
Fix bitpacking 62/63 bit fields on 64 bit targets
...
As reported on the lazarus forum:
* https://forum.lazarus.freepascal.org/index.php?topic=56341.new
* https://forum.lazarus.freepascal.org/index.php/topic,56339.msg418608/topicseen.html
Also optimized nextpowerof2 in the compiler
2021-10-03 14:00:50 +02:00
Nikolay Nikolov
41db71c21c
+ implemented the <= operator for smallsets for WebAssembly
2021-10-03 04:37:13 +03:00
Nikolay Nikolov
5adec3ca98
+ workaround for WebAssembly treating the stack parameter of the store and load
...
instructions as unsigned. This caused an 'out of bounds memory access' trap
when accessing arrays with negative offset index, e.g. in test/cg/tvec.pp
2021-10-03 03:16:34 +03:00
Nikolay Nikolov
0a383d8c0f
* fixed WebAssembly method pointer assignment
2021-10-03 02:27:19 +03:00
Nikolay Nikolov
6f88919f37
- don't set casmdata in wasm32/aasmcpu.pas, so that the aasmdef unit can override it
2021-10-03 00:59:11 +03:00
Nikolay Nikolov
c1eeb8beda
+ use the aasmdef unit in wasm32/cpunode.pas
2021-10-03 00:49:53 +03:00
Nikolay Nikolov
020a58b075
+ added system_wasm32_embedded to systems_embedded
2021-10-02 23:14:24 +03:00
Nikolay Nikolov
c450b63f1c
+ enabled compilation of the fpintres unit for the WASI target and enabled tf_has_winlike_resources for the target
2021-10-02 22:43:05 +03:00
J. Gareth "Kit" Moreton
4b39f7dea0
x86: Missed logic with CMP and MOV optimisations
2021-10-02 19:32:44 +00:00
Nikolay Nikolov
cc2fa67dfa
* fixed OS_S8 to OS_16 conversion for WebAssembly. This fixes test/cg/tcnvint6
2021-10-02 22:10:34 +03:00
Nikolay Nikolov
3258937d97
+ implemented move() for WebAssembly via the memory.copy instruction
2021-10-02 21:33:28 +03:00
Nikolay Nikolov
2e3e3edb5f
+ implemented FillChar for WebAssembly via the memory.fill instruction
2021-10-02 20:31:37 +03:00
Nikolay Nikolov
85207e94f8
+ added inline numbers for a memory.copy and a memory.fill intrinsic
2021-10-02 19:40:36 +03:00
Nikolay Nikolov
026d23632a
+ added the memory.copy and memory.fill WebAssembly instructions
2021-10-02 19:35:26 +03:00
florian
cc5ee6b868
+ comments
2021-10-02 16:24:47 +02:00
florian
39164ad732
* cleanup
2021-10-02 16:15:19 +02:00
florian
c1d8e32eae
+ Aarch64: Ldr<Postfix>Mov2Ldr<Postfix> optimization
2021-10-02 16:07:00 +02:00
florian
b5c7997c88
+ Aarch64: AndCmpB.E/NE2Tbnz/Tbz optimization
2021-10-02 15:46:37 +02:00
florian
177b38dfe9
* modified (cosmetics) patch by Rika: replace DJB2 with MurmurHash3, resolves #39377
2021-10-01 23:06:31 +02:00
Nikolay Nikolov
d2726c2406
* fixed WebAssembly code generation for not(cbool64)
2021-10-01 05:17:12 +03:00
Nikolay Nikolov
4fc763ac50
* fixed WebAssembly cbool support for OP_NOT
2021-10-01 04:54:17 +03:00
Nikolay Nikolov
baf5ff4e05
* another WebAssembly cbool fix in twasmtypeconvnode.second_int_to_bool
2021-10-01 04:40:50 +03:00
Nikolay Nikolov
968e23546c
* fixed second_int_to_bool for cbool types for WebAssembly
2021-10-01 04:20:02 +03:00
Nikolay Nikolov
188a21bbfd
* fixed 'not(boolean64)' for WebAssembly
2021-10-01 03:01:55 +03:00