Commit Graph

143 Commits

Author SHA1 Message Date
florian
f6002d8078 * ensure make_simple_ref is called, resolves #40851 2024-07-10 22:26:09 +02:00
J. Gareth "Curious Kit" Moreton
e601156b8c * x86-64: Bug fix where RIP-relative references were made absolute in minmax optimisations by mistake. 2024-04-27 16:32:04 +00:00
florian
139f2dfe84 * fix internalerror 200502052 with certain min/max optimizations on x86-64, resolves #40730 2024-04-06 23:31:37 +02:00
florian
8cdb3deebd * another fix for min/max intrinsics on x86_64 for non constant/reference/register locations, resolves #40724 2024-04-03 22:03:30 +02:00
florian
3b8fcfc6eb * fix min/max intrinsics on x86_64 for non constant/reference/register locations, resolves #40721 2024-04-01 23:25:24 +02:00
florian
a8d496ade7 * i386 uses generic x86 abs(long/int64) code now 2024-03-29 20:54:52 +01:00
florian
fea8050457 * fix i386 building after fb3c4ff75b 2024-03-27 00:04:46 +01:00
florian
fb3c4ff75b * avoid CMPs with constants outside the range of signed 32 bit values 2024-03-26 23:53:46 +01:00
J. Gareth "Curious Kit" Moreton
ee1916e919 * i8086: Local variables unused in "second_AndOrXorShiftRot_assign" on i8086 are now not defined on this platform 2024-03-26 14:18:31 +00:00
J. Gareth "Curious Kit" Moreton
11b341cc97 * x86: Added new OptPass1CMOVcc peephole optimisation routine to dust up min/max code 2024-03-26 14:18:31 +00:00
J. Gareth "Curious Kit" Moreton
e4a0ce2fb5 * x86: Min/max intrinsic support 2024-03-26 14:18:31 +00:00
florian
12176d3683 * avoid to generate bts/r with memory operand
+ thlcgx86.a_bit_set_reg_reg
2024-03-24 23:03:33 +01:00
J. Gareth "Curious Kit" Moreton
2b7df4237b * nf_pass1_done, nf_error, nf_processing and nf_do_not_execute
have been moved to a new "transientflags" node field that
    isn't stored in PPU files
2024-03-24 18:14:49 +00:00
florian
c3b8b51cb5 * more overflow checking for abs(...) 2024-03-16 21:54:12 +01:00
florian
2a46596edd * overflow check abs(...) for x86 2024-03-14 23:14:47 +01:00
J. Gareth "Curious Kit" Moreton
5fab6cc5e0 * Fixed internal error number clash (2022102110) 2023-11-10 18:43:55 +00: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
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
florian
81e83ffa67 * release temp 2021-09-15 23:16:53 +02:00
florian
c02b43fb93 * change fma cpu flag into an fpu flag
git-svn-id: trunk@49448 -
2021-06-01 21:16:52 +00:00
florian
b09669dffe * allow also CSUBSETREG in tx86inlinenode.second_IncludeExclude, resolves #38733
git-svn-id: trunk@49151 -
2021-04-09 20:09:19 +00:00
yury
64c586b86d * Removed/ifdefed lots of unused variables.
git-svn-id: trunk@48384 -
2021-01-24 12:24:01 +00:00
florian
9592c033e5 * process fma intrinsic parameters in an order which takes care of multiple x87 stack parameters, resolves #38295
git-svn-id: trunk@48017 -
2021-01-03 17:08:58 +00:00
Jonas Maebe
2fc672452d * fixed error in load_fpu_location triggered by round() (fixes webtbs/tw32671
on i386 after r47854)

git-svn-id: trunk@47890 -
2020-12-29 13:07:41 +00:00
pierre
26170815b4 Fix compilation of i8086 compiler after commit #47840
git-svn-id: trunk@47844 -
2020-12-24 11:26:01 +00:00
florian
b713c7380b * implemented UseAVX512 properly
+ make use of VREDUCE* for frac(...) if AVX512QD is a available

git-svn-id: trunk@47840 -
2020-12-23 17:25:09 +00:00
florian
b28aa5c684 * properly handle result size for avx/sse based frac function, resolves #38248
git-svn-id: trunk@47839 -
2020-12-23 16:10:08 +00:00
florian
674c3f04e0 + added explanation for min/max intrinsics
* prepared x86 implementation for proper NaN handling

git-svn-id: trunk@47715 -
2020-12-07 21:31:07 +00:00
florian
1a9678f4c4 + min/max support for x86
git-svn-id: trunk@47701 -
2020-12-06 18:09:30 +00:00
florian
637976e83f * patch by Marģers to unify internal error numbers, resolves #37888
git-svn-id: trunk@47103 -
2020-10-13 19:59:01 +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
florian
70a836c4a2 * first part of merging parts of Jeppe's intrinsics patch, mainly r31135
is merged by this commit with a lot of adaptions

git-svn-id: trunk@43949 -
2020-01-14 21:52:39 +00:00
florian
11287f018f * explicitly emit a sub instruction in tx86inlinenode.second_high, resolves #36530
git-svn-id: trunk@43888 -
2020-01-07 21:46:07 +00:00
florian
f7a052f884 + inline high(<dyn. array>), resolves #28536
git-svn-id: trunk@43808 -
2019-12-28 21:38:38 +00:00
svenbarth
f4d96906c2 * reference FPC_ABSMASK_SINGLE/-DOUBLE using the indirect symbol if required for dynamic packages
git-svn-id: trunk@43536 -
2019-11-21 21:44:22 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
nickysn
9272bf59b2 + added x86 (i8086, i386 and x86_64) intrinsics fpc_x86_get_cs/ss/ds/es/fs/gs
for getting the value of x86 segment registers

git-svn-id: trunk@39433 -
2018-07-11 14:19:40 +00:00
nickysn
ff2fff365f + added x86 compiler intrinsics fpc_x86_sti and fpc_x86_cli, which generate the
'sti' and 'cli' instructions

git-svn-id: trunk@39388 -
2018-07-04 16:48:34 +00:00
nickysn
6cd88a24dc * release al/ax/eax immediately after the 'in', before (instead of after) moving
it to the destination imaginary register. This generates better code.

git-svn-id: trunk@39380 -
2018-07-04 13:09:47 +00:00
nickysn
f34710faa0 + use the in and out instructions with immediate constant port number for ports
that are evaluated as a compile-time constant in the range 0..255

git-svn-id: trunk@39365 -
2018-07-03 20:15:20 +00:00
nickysn
fdc896ad0a + inline support for the x86 'in' and 'out' instructions. Currently only enabled
in the i8086-msdos 'ports' unit, but will be enabled on other targets (e.g.
  go32v2) in the future as well. 32-bit 'in' and 'out' not inlined on i8086, but
  will be on i386 and x86_64.

git-svn-id: trunk@39362 -
2018-07-03 17:01:42 +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
florian
98bd768521 * remove type cast of the parameter of int(...), if an instruction is available which can be used directly
git-svn-id: trunk@38335 -
2018-02-24 23:13:27 +00:00
nickysn
16d7eefbca + adapted and enabled the x86 specific abs() code generation for i8086, because
it generates slightly better code, than the generic implementation

git-svn-id: trunk@37161 -
2017-09-10 12:12:34 +00:00
florian
358bfb4858 * SSE4.1+ implementation of int(...)
git-svn-id: trunk@36285 -
2017-05-21 15:28:34 +00:00
florian
12dec14859 * try to break dependency chains when generating vsqrt instructions
git-svn-id: trunk@36282 -
2017-05-21 11:35:33 +00:00
florian
8eec29b139 + enable support for a processor specific frac function
* implemented inlined frac support for CPUs with SSE4.1+

git-svn-id: trunk@36281 -
2017-05-21 11:12:59 +00:00
nickysn
efc5e339d0 * use an enum instead of integer constants to represent inline numbers
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
  their enum name, instead of number

git-svn-id: trunk@36174 -
2017-05-10 14:41:43 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +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