Commit Graph

402 Commits

Author SHA1 Message Date
florian
367bc18bc5 * cfa for x86-64 fixed
git-svn-id: branches/debug_eh@41563 -
2019-03-02 23:03:32 +00:00
Jonas Maebe
50c82b6468 * synchronised with trunk till r41537
git-svn-id: branches/debug_eh@41538 -
2019-03-01 16:20:22 +00:00
yury
a04e4971fc * i386: Do not request GOT for every function call. GOT is requested only for external calls in thlcgcpu.a_call_name(). Local calls are always PC relative.
git-svn-id: trunk@41464 -
2019-02-25 15:48:41 +00:00
florian
db6916453d * warning fixed
git-svn-id: branches/debug_eh@41452 -
2019-02-24 20:03:23 +00:00
florian
18fb53e012 * set cfa offset always properly
git-svn-id: branches/debug_eh@41413 -
2019-02-22 22:00:20 +00:00
florian
a8c8cc1890 * create proper cfi, when registers are pushed
git-svn-id: branches/debug_eh@41382 -
2019-02-19 22:16:39 +00:00
florian
3567d01ee4 * improved CFI
git-svn-id: branches/debug_eh@41356 -
2019-02-17 20:26:32 +00:00
florian
72a02b467c + generate more cfi on x86
git-svn-id: branches/debug_eh@41287 -
2019-02-10 18:00:24 +00:00
florian
597a23d278 + tls support for x86_64-linux (not yet enabled by default)
git-svn-id: trunk@41081 -
2019-01-27 09:37:25 +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
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
c6977a0a7a Explicitly disable range checking
git-svn-id: trunk@40026 -
2018-10-24 21:37:22 +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
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
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +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
381cf78ff1 * there is no vmovq for mmx registers
git-svn-id: trunk@38208 -
2018-02-11 17:50:41 +00:00
florian
31f78ea2b6 + implementation of the vectorcall calling convention by J. Gareth Moreton
+ tests

git-svn-id: trunk@38206 -
2018-02-11 17:50:37 +00:00
florian
092223f400 * comment links to test now
git-svn-id: trunk@38204 -
2018-02-11 16:38:33 +00:00
florian
e5ebc65cce * if si and di are allocated on i8086, using an index in references is not possible anymore
git-svn-id: trunk@38203 -
2018-02-11 15:54:37 +00:00
nickysn
b3f7bce3a6 * check for CPUX86_HAS_SSE2 instead of CPUX86_HAS_SSEUNIT in Tcgx86.g_concatcopy
git-svn-id: trunk@37327 -
2017-09-26 16:05:23 +00:00
florian
dba1761a76 + tcgx86.a_load_reg_ref cuts data if the ref. size is smaller than the reg. size
git-svn-id: trunk@36953 -
2017-08-20 16:45:02 +00:00
nickysn
7b70848d83 + allow the src register size to be different from the op size or the dst
register size for OP_SHR/OP_SHL/OP_SAR/OP_ROL/OP_ROR in tcgx86.a_op_reg_reg().
  This is required for the in_[shr/shl/sar/rol/ror]_assign_x_y inline nodes.

git-svn-id: trunk@36251 -
2017-05-19 14:03:13 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
5c2c5d72a2 * use avx for copying data only on i386 for 8 byte chunks
git-svn-id: trunk@36149 -
2017-05-07 16:18:42 +00:00
nickysn
ec11864272 * use a native sized int register for the shift count in in_sar_assign_x_y,
in_shl_assign_x_y,in_shr_assign_x_y,in_rol_assign_x_y,in_ror_assign_x_y

git-svn-id: trunk@35857 -
2017-04-20 12:38:54 +00:00
nickysn
16af6f03fb + support OP_SHR/OP_SHL/OP_SAR/OP_ROL/OP_ROR in tcgx86.a_op_reg_ref
git-svn-id: trunk@35837 -
2017-04-18 15:14:28 +00:00
nickysn
256dc546ac + implemented the in_neg_assign_x and in_not_assign_x inline nodes, which will
be used (TBD in a future commit) for optimizing x:=-x and x:=not x on CPUs
  that support performing these operations directly in memory (such as x86)

git-svn-id: trunk@35749 -
2017-04-07 16:02:40 +00:00
florian
1e374df5b8 * correctly calculate the bit mask in thlcgobj.a_load_regconst_subsetreg_intern, resolves #31042
* convert immediates on x86 always to 32 (x86-64, i386) or 16 bit (i8086) signed values

git-svn-id: trunk@35082 -
2016-12-07 20:08:22 +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
svenbarth
c8202061dc * get rid of addr_load_indirect again by having tcgx86 provide an internal implementation of both make_simple_ref() and a_load_ref_reg() so that make_direct_ref() can call the latter (and the latter the former) without fear of inifinite recursive calls due to the symbol; a_load_ref_reg() is additionally declared as "final" as a_load_ref_reg_internal() needs to be overloaded instead (which is the case for tcg8086)
git-svn-id: trunk@34579 -
2016-09-30 14:01:02 +00:00
svenbarth
89f7da58ea * fix tcgx86.make_direct_ref: we need to use the register in which we loaded the symbol and combine that with the base register (if it is set) without using an ADD
git-svn-id: trunk@34557 -
2016-09-23 15:37:28 +00:00
Jonas Maebe
27bb656cec * replaced "in_make_direct_ref" field with a trefaddr flag
git-svn-id: trunk@34548 -
2016-09-20 21:43:52 +00:00
Jonas Maebe
e8c9541c04 * don't use ADD in make_direct_ref(), as the flags may be live
git-svn-id: trunk@34547 -
2016-09-20 21:43:45 +00:00
Jonas Maebe
a9073cb50b * don't overwrite the flags in make_simple_ref() if the reference
has no scalefactor (fixup for r14871)

git-svn-id: trunk@34546 -
2016-09-20 21:43:39 +00:00
Jonas Maebe
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
pierre
fb50d0860b Use BX register instead of AX to reload DS at proc entry if register convention is used
git-svn-id: trunk@34024 -
2016-06-29 20:48:51 +00:00
nickysn
c78f406d99 + implemented proper stack checking for the i8086
git-svn-id: trunk@33787 -
2016-05-24 23:57:47 +00:00
florian
d2b74be153 * always use vmov variants of instructions if avx is enabled
git-svn-id: trunk@33554 -
2016-04-24 20:03:15 +00:00
florian
a742df9035 * reverse merged r33524 as it is not safe as test results showed
--- Reverse-merging r33524 into '.':
U    compiler\i386\popt386.pas
U    compiler\x86\cgx86.pas
--- Recording mergeinfo for reverse merge of r33524 into '.':
 U   .

git-svn-id: trunk@33527 -
2016-04-17 11:33:29 +00:00
florian
f576b0c01b * make use of xor reg,reg by generating it directly instead of hoping for the peephole
optimizer which cannot do this properly due to missing information about flags. By doing
  so the size of the compiler executable gets reduced by ~1 %

git-svn-id: trunk@33524 -
2016-04-15 19:27:22 +00:00
nickysn
c4343c1a2d * don't call make_simple_ref in tcgx86.g_concatcopy on i8086, because that
screws up the handling of segmented references badly and breaks the large,
  compact and huge memory models completely

git-svn-id: trunk@33314 -
2016-03-22 13:56:10 +00:00
yury
3c6d4f1ee2 * Removed unused vars.
git-svn-id: trunk@33308 -
2016-03-21 09:21:24 +00:00
svenbarth
f297b00f5b Extend the x86 targets by the ability to handle indirect symbols.
x86/cgx86.pas, tcgx86:
  + new method make_direct_ref() which is used to convert an indirect reference into a direct one (uses the boolean field in_make_direct_ref to avoid recursive calls)
  * make_simple_ref: call make_direct_ref() before anything else
  * a_loadaddr_ref_ref: call make_direct_ref() (the loading could probably be folded into the loadaddr method, but for now that is sufficent)
i386/cgcpu.pas, tcg386:
  * a_loadaddr_ref_cgpara: call make_direct_ref(); the same remark as for a_loadaddr_ref_ref() applies here

git-svn-id: trunk@33280 -
2016-03-18 21:45:41 +00:00
svenbarth
77ede2ac9f i386/cgcpu.pas, tcg386:
* a_load_ref_cgpara: call make_simple_ref() before calling the base a_load_ref_cgpara()
x86/cgx86.pas, tcgx86:
  * a_loadfpu_ref_reg, a_loadfpu_reg_ref, g_concatcopy: call make_simple_ref() on the passed references

git-svn-id: trunk@33277 -
2016-03-18 21:22:04 +00:00
sergei
1b965e6766 * x86: Don't save/restore integer registers that are volatile per calling convention of current procedure. It implies that nothing will be saved for procedures with OLDFPCCALL, FAR16 and PASCAL and calling conventions. OLDFPCCALL restores behavior that was in effect before r25224.
git-svn-id: trunk@32542 -
2015-11-27 05:48:49 +00:00