Commit Graph

114 Commits

Author SHA1 Message Date
florian
c02b43fb93 * change fma cpu flag into an fpu flag
git-svn-id: trunk@49448 -
2021-06-01 21:16:52 +00:00
florian
e46b426ca1 + tx86addnode.second_opvector makes use of AVX instructions
git-svn-id: trunk@47345 -
2020-11-08 19:39:17 +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
043c3df292 * properly handle boolean64 xor boolean64 on i386
git-svn-id: trunk@45804 -
2020-07-18 18:32:17 +00:00
florian
b2ed667a86 * swap fpu stack correctly when moving data into xmm registers
git-svn-id: trunk@45637 -
2020-06-11 17:19:56 +00:00
florian
5f67d830e7 * better rules if a 3 op mul operation is tried
git-svn-id: trunk@45605 -
2020-06-06 19:21:04 +00:00
florian
b4de0b2e9c * insert fwait after fcompp, resolves #37136
git-svn-id: trunk@45500 -
2020-05-25 20:38:19 +00:00
florian
97efb03ae6 * call x86 addordinal for non short boolean evaluated boolean nodes
as this results in better code

git-svn-id: trunk@45404 -
2020-05-17 17:41:44 +00:00
florian
fca4d3315b * let the operation do the type conversion for x87 floating point operations
git-svn-id: trunk@43867 -
2020-01-05 17:47:23 +00:00
florian
3c16324f80 * x86: avoid to put variables into registers if they are handled by the x87-FPU
git-svn-id: trunk@43856 -
2020-01-03 22:23:49 +00:00
florian
91f3f022fe * MM registers which might not be changed can be still used in 3 op mathematical operations as source
git-svn-id: trunk@43509 -
2019-11-17 14:48:45 +00:00
florian
5f3050961f * load left properly into a register in tx86addnode.second_addordinal, resolves #36287
git-svn-id: trunk@43449 -
2019-11-10 21:45:57 +00:00
florian
c8f746b881 * do not allocate an extra register for some integer operations if not needed
git-svn-id: trunk@43412 -
2019-11-07 21:08:08 +00:00
Jonas Maebe
ce598c15ec * factored out the conditions under which add nodes need to perform
overflow checks
   o in particular ensure that cpu-specific overrides don't perform overflow
     checks when nf_internal is set

git-svn-id: trunk@42573 -
2019-08-03 12:19:50 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
pierre
9c90f593ab Add global range check disable for i8086 cgcpu and x86 nx86add units
git-svn-id: trunk@40124 -
2018-10-31 23:20:29 +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
088af633ba Fix casing, bug ID #38660
git-svn-id: trunk@38660 -
2018-04-02 08:53:31 +00:00
florian
9b18e39c81 * enable Lea2AddBase and Lea2AddIndex in TX86AsmOptimizer.PostPeepholeOptLea as we have flag tracking now
* some flag allocations fixed

git-svn-id: trunk@38501 -
2018-03-11 20:30:09 +00:00
florian
d86ffb9bfb + tcg.a_op_loc_reg
+ optimized tx86addnode.second_ordinal for x86

git-svn-id: trunk@38500 -
2018-03-11 16:32:26 +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
Jonas Maebe
da696057ab * converted register_maybe_adjust_setbase() to the high level code generator
git-svn-id: trunk@32591 -
2015-12-05 18:03:37 +00:00
nickysn
457107d165 * check UseIncDec before generating an INC instruction in tx86addnode.emit_generic_code
git-svn-id: trunk@32057 -
2015-10-15 13:11:47 +00:00
yury
e04a3b4ac6 * Removed unused vars for x86 compiler.
git-svn-id: trunk@31743 -
2015-09-17 15:20:15 +00:00
florian
c9b1df2c91 * the test $-1,%reg optimization shall be done not only if the cpu type is i386, but for the i386 compiler
git-svn-id: trunk@31474 -
2015-08-31 20:03:56 +00:00
Károly Balogh
249a60b28b x86: fix a variable op not initialized warning. This hopefully fixes our x86 testsuite run.
git-svn-id: trunk@28496 -
2014-08-20 10:21:06 +00:00
florian
499dd078e3 + automatically insert fma inlines into floating point code if possible and fastmath is activated
git-svn-id: trunk@28382 -
2014-08-11 20:50:21 +00:00
sergei
2ee0c8de45 * i386: For integer comparisons with zero, emit "test $-1,%reg" instead of "test %reg,%reg". It is more spilling-friendly, because it transforms into "test $-1,spilltemp" and does not require a register.
* Improved peephole optimizer to remove these instructions if preceded by flag-setting instruction that operates on same location and followed by conditional jump, and change them back into "test %reg,%reg" otherwise.

git-svn-id: trunk@27617 -
2014-04-20 19:16:58 +00:00
sergei
07e90aaa24 + Implemented IEEE 754-compliant checking for unordered results of floating-point compares on x86 targets. Mantis #9362.
git-svn-id: trunk@27581 -
2014-04-14 12:36:11 +00:00
sergei
3e20a136f3 * tx86addnode.second_addfloat: use single and double-precision memory locations without loading them on FPU stack if possible.
git-svn-id: trunk@27558 -
2014-04-13 12:37:30 +00:00
sergei
ebdbf21650 * tx86addnode.second_cmpfloatsse and tx86addnode.second_cmpfloatavx are identical except instruction opcodes -> merged into second_cmpfloatvector, cleaned up, and allowed constant operands at both sides.
git-svn-id: trunk@27314 -
2014-03-28 09:04:28 +00:00
sergei
965540eab3 * Let tx86addnode.check_left_and_right_fpureg() act as when its argument was=true (removed argument and renamed to force_left_and_right_fpureg). Its action when force_fpureg=false is now coded separately.
git-svn-id: trunk@27299 -
2014-03-27 11:42:24 +00:00
Jonas Maebe
4065483a50 * completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg()

git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
sergei
6168f563c2 * x86 compares: compare references with constants directly (without loading to register) if possible, this helps to reduce register pressure.
git-svn-id: trunk@26492 -
2014-01-17 19:42:09 +00:00
nickysn
be5f49b3e5 * tx86addnode.second_cmpfloat: on i8086 only load the high byte of the FPU
status word after fstsw (and before sahf), because 8-bit memory transfers are
  faster on the i8088, due to the 8-bit data bus

git-svn-id: trunk@26245 -
2013-12-16 23:52:28 +00:00
nickysn
ada9ccf6a6 * tx86addnode.second_cmpfloat: do not emit a fwait after fstsw as my own testing
on a true i8087 showed that the fwait isn't necessary

git-svn-id: trunk@26244 -
2013-12-16 23:17:44 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
nickysn
6fdadb6248 * 8087 fixes in tx86addnode.second_cmpfloat:
- use FSTSW instead of FNSTSW
  - insert a FWAIT after the FSTSW, because the value is immediately loaded
    afterwards by the integer unit of the CPU

git-svn-id: trunk@26110 -
2013-11-19 23:22:49 +00:00
florian
3c58cad96b * make use of lea if possible
git-svn-id: trunk@25898 -
2013-11-01 19:01:11 +00:00
sergei
5de4bdac40 * tx86addnode.second_cmpfloat: use getresflags() to reduce code duplication.
git-svn-id: trunk@25443 -
2013-09-09 11:25:49 +00:00
florian
507edb16de * use add/sub instead of inc/dec on modern CPUs when optimizing for speed
git-svn-id: trunk@25057 -
2013-07-07 19:50:13 +00:00
florian
0a84f1f10c + avx uses add to multiply by 2
* formatting

git-svn-id: trunk@24906 -
2013-06-15 21:18:40 +00:00
florian
d8ff85846f * don't reuse mm registers used by child nodes
git-svn-id: trunk@24897 -
2013-06-14 20:52:36 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
nickysn
90ecd72286 * x86_64 compilation fixed after r24752
git-svn-id: trunk@24755 -
2013-06-01 22:38:07 +00:00
nickysn
ec76b2cf40 * refactored the segment-in-integer-register reference support, so it's handled in make_simple_ref, instead of all over the place in the code generator
git-svn-id: trunk@24752 -
2013-06-01 22:18:09 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
nickysn
525246f61b * support i8086 far references in tx86addnode.emit_op_right_left
git-svn-id: trunk@24737 -
2013-06-01 17:51:58 +00:00