Commit Graph

1581 Commits

Author SHA1 Message Date
florian
4fb7b5d3ff * fix MovOpMov2MovOp optimization if no -Cpcoreavx2 is used
git-svn-id: trunk@40979 -
2019-01-21 21:57:07 +00:00
florian
4f0da5fcc3 + patch by Marģers to support the x86 assembler instructions blsi, blsr, blsmsk, adcx, adox, movbe, pclmulqdq, resolves #34815 and #34799
+ avxopcodes tests also movbe and pclmulqdq

git-svn-id: trunk@40951 -
2019-01-20 18:50:12 +00:00
florian
75a89d2115 * fix and enable MovOpMov2MovOp optimization on x86-64
git-svn-id: trunk@40941 -
2019-01-20 17:00:43 +00:00
florian
94d7a02fae * modified patch by Gareth Moreton to pool TmpUsedRegs in the assembler optimizers, resolves #34679
git-svn-id: trunk@40938 -
2019-01-20 14:16:38 +00:00
florian
b223d1c304 * modified patch by Gareth Moreton to make ie unique, resolves #34849
git-svn-id: trunk@40849 -
2019-01-12 14:44:54 +00:00
Károly Balogh
2f7fe0e737 haiku-x86_64: add target to the compiler and ppudump, enable it in fpmake and fpcmake
git-svn-id: trunk@40753 -
2019-01-04 02:16:24 +00:00
florian
a2cee252e8 * when optimizing range checks in case nodes, unsigned comparisions must be used, resolves #34782
git-svn-id: trunk@40721 -
2019-01-01 01:11:13 +00:00
florian
bd4b7a6bc4 * more case fixes
git-svn-id: trunk@40706 -
2018-12-29 21:53:52 +00:00
florian
f6e32ae90e * (modified) path by Gareth Moreton to fix case handling
git-svn-id: trunk@40686 -
2018-12-28 20:56:43 +00:00
florian
7f5c2fa3aa * (modified) patch by Gareth Moreton: Speed improvement in case blocks, resolves #0034762
This patch improves the compiler where "case" statements are concerned, using jump tables more often and creating more efficient machine code in some situations:
  * If a case block only contains one branch (not including the else block), the initial range check is removed, since this becomes wasted effort.
  * If the else block is empty, the else label is set to the end label - though this doesn't decrease the code size, it takes a bit of strain off the peephole optimizer.
  * On -O2 and above, some node analysis is now done on the branch labels. Most of the time this just redirects it to the end
    label for empty blocks, but if the block contains a goto statement, it will redirect it to its destination instead,
    thus increasing performance by not having multiple jumps (this won't get picked up by the peephole optimiser if the label addresses are in a jump table).
  * Some checks now use what I call the 'true count' rather than the 'label count'. The true count includes each
    individual value in a range - for example, 0..2 counts as 3. This increases the chance that a jump table will be
    utilised in situations where it is more efficient than a linear list.
  * For jump tables, if the case block almost covers the entire range (32 entries or fewer from full coverage),
    the initial range check is removed and the gaps included in the jump table (pointing to the else label).

git-svn-id: trunk@40676 -
2018-12-27 18:31:55 +00:00
Jonas Maebe
122d0d36d6 + volatile() expression that marks an expression as volatile
* disable matching volatile references in the assembler optimisers, so they
    can't be removed (more conservative than needed, but better than removing
    too many)
   o the CSE optimiser will ignore them by default, because they're an unknown
     inline node for it
  * also removed no longer used fpc_in_move_x and fpc_in_fillchar_x inline node
    identifiers from rtl/inc/innr.inc, and placed fpc_in_unaligned_x at the
    right place

git-svn-id: trunk@40465 -
2018-12-04 19:53:20 +00:00
florian
c43cae9231 * disable MovOpMov2MovOp optimization on x86-64 for now as it seems to break
git-svn-id: trunk@40361 -
2018-11-21 21:22:54 +00:00
florian
477d7be651 * building on i386-linux fixed
git-svn-id: trunk@40360 -
2018-11-21 19:19:24 +00:00
florian
ac37a54d79 + MovOpMov2MovOp optimization
git-svn-id: trunk@40359 -
2018-11-20 22:20:43 +00:00
florian
6dbde11f5a * three operand shl for shifting by 2, 4 or 8 can be simulated by lea
git-svn-id: trunk@40337 -
2018-11-17 15:08:22 +00:00
florian
6a6ea6729f * i8086 compiler fixed, resolves #34552
git-svn-id: trunk@40316 -
2018-11-14 18:05:35 +00:00
florian
72416edcc4 + support for tlsm_general on i386-linux
git-svn-id: trunk@40281 -
2018-11-11 17:32:20 +00:00
florian
e157939b41 * compilation on x86-64 and i8086 fixed
git-svn-id: trunk@40275 -
2018-11-08 18:45:16 +00:00
florian
063415fa72 + i386-linux support for tls-based threadvars
git-svn-id: trunk@40272 -
2018-11-07 22:03:02 +00:00
pierre
8d5cfa8731 Disable range checking in rax86int unit
git-svn-id: trunk@40237 -
2018-11-06 07:41:15 +00:00
yury
30d64cec68 * Removed unused local vars.
git-svn-id: trunk@40185 -
2018-11-02 18:51:19 +00:00
yury
4357caaad8 * Removed unused local vars.
git-svn-id: trunk@40183 -
2018-11-02 18:44:29 +00:00
florian
59d5d6ec95 + factored out TX86AsmOptimizer.PrePeepholeOptIMUL, used now by x86-64 and i386
* generalized and simplified the code

git-svn-id: trunk@40162 -
2018-11-01 20:49:20 +00:00
florian
cdce68451a - x86 align does not use a register anymore, code removed
git-svn-id: trunk@40157 -
2018-11-01 20:49:15 +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
pierre
e5dffebdc7 Avoid range check error in MaskLength evaluation
git-svn-id: trunk@40110 -
2018-10-31 14:51:23 +00:00
pierre
d26fb3b663 Try to fix compilation error after commit #40027
git-svn-id: trunk@40028 -
2018-10-25 06:39:42 +00:00
pierre
740a26d879 Fix compilation of RTL for watcom target
git-svn-id: trunk@40027 -
2018-10-24 21:37:54 +00:00
pierre
c6977a0a7a Explicitly disable range checking
git-svn-id: trunk@40026 -
2018-10-24 21:37:22 +00:00
pierre
92acd38f40 Fix for bug report #34380
git-svn-id: trunk@39986 -
2018-10-18 20:21:54 +00:00
florian
9805214d34 * properly take care of register allocations between the first and second instruction for the FoldLea optimization
* check for ait_instruction after a GetNextInstruction function call
* cosmetics

git-svn-id: trunk@39983 -
2018-10-18 18:28:03 +00:00
yury
4643a0b1ff * Register external gas assembler for aarch64-android and x86_64-android.
git-svn-id: trunk@39969 -
2018-10-18 11:48:27 +00:00
Jonas Maebe
0b246f3dbd * converted Boolean8 to an internal type, and mapped Boolean to the
new internal pasbool1(type) (part of mantis #34411)
   o apply the _Bool x86-64 parameter passing rules only to pasbool1

git-svn-id: trunk@39949 -
2018-10-16 21:14:18 +00:00
florian
8943c0584e + patch by J. Gareth Moreton to support BMI2 instructions
+ extended avx test generator with the newly added BMI2 instructions

git-svn-id: trunk@39875 -
2018-10-07 10:10:19 +00:00
florian
49e7e5f512 * support aitconst_*bit_unaligned in the intel assembler writer, resolves #34222
git-svn-id: trunk@39761 -
2018-09-16 15:27:03 +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
florian
5782acc32d * patch by J. Gareth Moreton to fix 33909
git-svn-id: trunk@39353 -
2018-07-01 12:54:30 +00:00
florian
78943ea843 + patch by J. Gareth Moreton: x86 optimisations for Jcc and SETcc, resolves #33899
* optimization also added for i386

git-svn-id: trunk@39307 -
2018-06-25 20:40:05 +00:00
florian
1472a81768 * patch by J. Gareth Moreton to unify the x86 assembler optimizer method headers, resolves #33908
git-svn-id: trunk@39305 -
2018-06-25 20:13:34 +00:00
nickysn
45337b67fe + when using the i8086 with section based smartlinking, create OMF section
groups, named 'CGROUP' or 'CGROUP_UNITNAME', which include all the code
  sections, that need to be put in the same segment

git-svn-id: trunk@39277 -
2018-06-22 15:02:39 +00:00
nickysn
ab47c8b899 + introduce the omf_section_primary_group function. Use it instead of
section_belongs_to_dgroup, to allow sections to belong to groups, other than
  dgroup.

git-svn-id: trunk@39268 -
2018-06-21 13:21:53 +00:00
nickysn
1631d9ac0a + support segments (sections) with a primary group, other than 'DGROUP' in the
NASM assembler writer

git-svn-id: trunk@39246 -
2018-06-20 16:14:41 +00:00
florian
0d168796d7 * patch by J. Gareth Moreton: More Peephole optimizations for AND and MOV
git-svn-id: trunk@39242 -
2018-06-18 20:50:08 +00:00
florian
a0b343a787 * patch by J. Gareth Moreton for less invasive DEBUG_AOPTCPU
git-svn-id: trunk@39239 -
2018-06-17 14:56:19 +00:00
nickysn
49b414ffee + support ugly constructs like 'DD BYTE PTR 5' in the x86 intel syntax inline
assembler; these are TP7 and Delphi compatible

git-svn-id: trunk@39143 -
2018-05-29 15:43:08 +00:00
nickysn
e5de7d0eac * set all 16/32-bit specific stabs/dwarf register numbers of x86_64-only
registers to -1 in x86reg.dat. The values that used to be there weren't used
  at all (most were just copies of the 32-bit version of the register). This can
  be easily demonstrated by the fact that running 'make regdat' in the compiler
  directory doesn't change any of the generated files for i8086/i386/x86_64.

git-svn-id: trunk@39098 -
2018-05-23 15:29:33 +00:00