Commit Graph

77 Commits

Author SHA1 Message Date
florian
b2f6214b33 + a_bit_scan_reg_reg gets a flag if src cannot be zero: this simplifies the generated code 2025-02-08 14:27:48 +01:00
florian
46dcffed42 * MIPS64: make use of DMTC1 instruction 2024-10-18 21:53:26 +02:00
florian
67d80d414b * do not copy parameters onto the stack using FPU registers if the type is
actually handled by the MM unit, resolves #39567
2022-02-10 22:42:49 +01: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
d7fe9914a7 + introduce tcgobj.a_loadfpu_reg_intreg
+ make use of it in tcgtypeconvnode.second_nothing
  + Xtensa: implementation of a_tcgcpu.a_loadfpu_intreg_reg and tcgcpu.a_loadfpu_reg_intreg

git-svn-id: trunk@46858 -
2020-09-12 21:23:57 +00:00
nickysn
0f6ab0de17 * handle LOC_(C)SUBSETREG/REF in second_NegNot_assign
* changed the way OP_NEG and OP_NOT are handled in op_reg_ref, in order to be
  consistent with op_reg_reg
* introduced op_reg,op_ref,op_subsetreg,op_subsetref and op_loc for the unary
  operations only (OP_NEG,OP_NOT)

git-svn-id: trunk@45302 -
2020-05-07 02:43:02 +00:00
florian
73c8861929 * suppress warning for targets without MM registers
git-svn-id: trunk@42214 -
2019-06-11 20:03:47 +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
Jonas Maebe
f78e2072a1 * fix for r41416: 64 bit values on 32 bit platforms can of course also be
passed in memory

git-svn-id: trunk@41526 -
2019-02-28 20:45:34 +00:00
Jonas Maebe
af36913469 * don't use cg64.a_load64_loc_cgpara() for 64 bit records passed in
non-integer registers

git-svn-id: trunk@41416 -
2019-02-23 15:08:29 +00:00
Jonas Maebe
04d295f186 * first step towards supporting 32 bit targets with the LLVM code generator:
use the generic code in more cases when cpuhighleveltarget is defined

git-svn-id: trunk@41133 -
2019-01-29 21:39:09 +00:00
Jonas Maebe
2b3fb18327 * fixed thlcg2ll.location_force_mmregscalar() after r40633
git-svn-id: trunk@40810 -
2019-01-08 19:23:20 +00:00
Jonas Maebe
377d4e1b58 * make the size parameter of thlcgobj.location_force_mmregscalar() a
var-parameter, as the size sometimes gets changed in this routine and
    high level code generators don't use the location.size but the def

git-svn-id: trunk@40633 -
2018-12-24 22:10:02 +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
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
0afbe85aab * various memory reference alignment fixes
git-svn-id: trunk@34544 -
2016-09-20 21:43:19 +00:00
Károly Balogh
56fea8d047 * have regvars in address registers for defs which are address types. improves code with reference bases in regvars on m68k. and also reduces data register pressure.
git-svn-id: trunk@33591 -
2016-05-01 11:33:37 +00:00
Károly Balogh
5cfdd8fbf5 removed a redundant zero extension from location_force_reg, which occured if the source location was a smaller than 32bit subreg, and the destination was 64bit. hregister is always overwritten in the codepath below anyway.
git-svn-id: trunk@32648 -
2015-12-13 02:08:24 +00:00
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
a02d52f533 * support thlcg2ll.gen_loadfpu_loc_cgpara() from LOC_REGISTER to
LOC_FPUREGISTER (can happen with certain ABIs due to records
    having to be passed in floating point registers)

git-svn-id: trunk@30225 -
2015-03-14 18:36:52 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
2ab7f5c35d * moved x86-specific requirements from the generic bsr/bsf code to the
x86 code generator (register size constraints)

git-svn-id: trunk@29984 -
2015-02-23 22:57:18 +00:00
pierre
0a3f00ef2f Avoid Internal Error 200310121 with -O3 for test/units/system/tabs.pp with ppcarm
git-svn-id: trunk@29123 -
2014-11-23 16:29:09 +00:00
Jonas Maebe
b745dcc64c * moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
for some platforms it depends on that routine

git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
a637fbe596 * moved all g_exception_*() methods to hlcgobj and cleaned them up (no more
hardcoded registers for the most part)
  + added extra g_exception_discard_reason() that can be called when we only
    want to get rid of the currently pushed exception reason, and don't have
    to load it (so it can do nothing on platforms that don't use push/pop)

git-svn-id: branches/hlcgllvm@28481 -
2014-08-19 20:22:24 +00:00
Jonas Maebe
9a683a0288 * converted new_exception to hlcgobj
o also gets rid of the ifdefs

git-svn-id: branches/hlcgllvm@28377 -
2014-08-10 19:40:32 +00:00
Jonas Maebe
7949bebb8d * synchronised with r28168 of trunk
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
sergei
847adff94d * Load double-precision locations from integer registers directly into cgpara if sizes match and destination has a single location.
git-svn-id: trunk@28102 -
2014-06-30 17:50:34 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
3e308e0ad7 * 16/8-bit alu fix in thlcg2ll.location_force_reg for the 32->64 conversion of LOC_CONSTANT sources
git-svn-id: trunk@27654 -
2014-04-25 13:20:18 +00:00
florian
6f14dbdebe * avoid internal error if an empty record is assigned to a function result, resolves #25895
git-svn-id: trunk@27223 -
2014-03-21 16:31:57 +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
Jonas Maebe
81427523ab * pass a list of (pointers to) the paralocs to hlcgobj.a_call/g_call*, as
required for the LLVM support (LLVM parameter support is not yet
    included)
  * always return the function return loc from a_call*, again as required
    for the LLVM support

git-svn-id: branches/hlcgllvm@26992 -
2014-03-06 21:40:57 +00:00
sergei
9c1f917e3a * a_call_ref functionality cannot be implemented efficiently at code generator level, because references need specific preparations at earlier points. Moved this support to tcgcallnode and its x86 descendants, and got rid of all ifdef's around.
+ x86 targets now directly call procedure variables located in references.
- a_call_ref method removed from tcg and thlcgobj.

git-svn-id: trunk@26666 -
2014-02-03 13:28:56 +00:00
nickysn
f69a76b5b1 * generate shorter code on 8-bit and 16-bit CPUs in thlcg2ll.location_force_reg,
when converting a LOC_JUMP location to a (OS_INT<x<=32)-bit reg location
  (the optimization is similar to r26314, but is for non 64-bit destinations).

git-svn-id: trunk@26315 -
2013-12-29 19:07:35 +00:00
nickysn
9ec84d1259 * generate shorter code on 8 and 16-bit CPUs in thlcg2ll.location_force_reg,
when converting a LOC_JUMP location to a 64-bit reg location by only setting
  the low OS_INT-sized register to 0 or 1 in the false/true label parts and then
  initializing the remaining registers (obtainable via GetNextReg()) to 0 in the
  common part after the jumps.

git-svn-id: trunk@26314 -
2013-12-29 17:28:35 +00:00
nickysn
4e795eca99 * fixes for 16 and 8-bit ALUs in thlcg2ll.location_force_reg for the cases when
converting from a LOC_FLAGS or LOC_JUMP location to a 64-bit reg location.
  This fixes test/cg/tcnvint1.pp on i8086 after r26301.

git-svn-id: trunk@26312 -
2013-12-29 14:30:41 +00:00
Jonas Maebe
1b6e4e572f - removed duplicate thlcg2ll a_label method (it's declared the same in
thlcgobj and not virtual in either class)

git-svn-id: trunk@26022 -
2013-11-10 21:32:39 +00:00
Jonas Maebe
7d9f98e516 + def_cgmmsize() that returns a vector tcgsize for arraydefs (as generated
for certain parameter locations in the x86-64 parameter manager)
  * full support for vector types in the high level code generator by
    translating arraydefs passed to a_*mm*() methods into vector tcgsizes

git-svn-id: trunk@24762 -
2013-06-02 10:24:08 +00:00
Jonas Maebe
978b5530ec * renamed getmmcgsize to getintmmcgsize + comment
git-svn-id: trunk@24744 -
2013-06-01 18:32:14 +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
Jonas Maebe
3456f20546 * changed checks for support of opmm* calls in hlcg2ll from mms_movescalar
to whether the argument is a float type (the check is there to determine
    whether def_cgsize() can give us a correct result, which it can for
    floating point types but not yet for arrays used as vectors)

git-svn-id: trunk@24685 -
2013-06-01 08:28:32 +00:00
Jonas Maebe
1551c773e0 - removed no longer necessary thlcg2ll.initialize_regvars override and
commented dummy location_force_mmregscalar (fully implemented in r24661)

git-svn-id: trunk@24663 -
2013-05-31 12:21:53 +00:00
Jonas Maebe
5051453806 + support for LOC_(C)MMREGISTER in hlcg
o migrated location_force_mmregister_scalar from ncgutil to hlcgobj

git-svn-id: trunk@24661 -
2013-05-31 12:05:14 +00:00
nickysn
cbf3b14e20 * yet another 8/16-bit ALU fix in thlcg2ll.location_force_reg
git-svn-id: branches/i8086@23887 -
2013-03-17 12:55:06 +00:00
nickysn
a03f0d84ea high level code generator: const types changed from aint to tcgint to avoid problems on < 32-bit cpus; ppcjvm should also be updated, but isn't yet
git-svn-id: branches/i8086@23761 -
2013-03-09 22:16:03 +00:00
nickysn
27e4048ed6 16-bit and 8-bit alu fix in thlcg2ll.location_force_reg
git-svn-id: branches/i8086@23719 -
2013-03-08 00:10:10 +00:00
florian
d93cee995b * fix register method pointer for ppc64 and x86_64-linux
git-svn-id: trunk@22351 -
2012-09-07 15:15:10 +00:00