Commit Graph

193 Commits

Author SHA1 Message Date
Jinyang He
12c4290ffe Add loongarch64 architecture support to compiler 2023-02-05 19:18:48 +00:00
Yuriy Sydorov
940ac567a5 * Patch by J. Gareth "Kit" Moreton (issue #39343). Added missing allocation
of flags in tx86typeconvnode.second_int_to_bool and in generic
  tcgtypeconvnode.second_int_to_bool. This fixes random failures of the
  tcnvint1 test and some other tests when compiled with -O2.
2021-09-07 19:50:28 +03: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
florian
ba3de67f3b + Xtensa: the boolean extension is used as flags
git-svn-id: trunk@44538 -
2020-04-03 20:15:22 +00:00
Jonas Maebe
afd0ae44ee * use tprocvardef.getreusableprocaddr also for non-address-only copies of
proc(var)defs

git-svn-id: trunk@44517 -
2020-04-02 21:21:40 +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
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
acf02ab64b * when creating wrappers, add a prefix to parameter names to prevent them
hiding the method name of the wrapped routine
   o also add a few more '&' prefixes to the generated wrapper code to
     prevent issues when keywords are used as identifiers

git-svn-id: trunk@40634 -
2018-12-24 22:10:06 +00:00
Jonas Maebe
b1b559f283 * fixed used resulttype of char-to-shortstring typeconversion in case the
shortstring type is smaler than 255 chars

git-svn-id: trunk@40628 -
2018-12-24 22:09:45 +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
e1d0e7572e * i8086 TP7 compatibility fixes, related to obtaining procedure addresses:
o The @ and Addr() operators in TP or Delphi mode can now be applied to both
    near and far procedures and they always produce a CodePointer, regardless of
    the call model of the procedure.
  o Ofs() and Seg() can now also be applied to both near and far procedures.
  o The @ and Addr() operators in non-TP/Delphi modes, as well as the procedure
    name itself in TP/Delphi modes now can be applied to both near and far
    procedures and produce a near or a far procvar.

git-svn-id: trunk@38691 -
2018-04-05 15:09:12 +00:00
nickysn
0b66419e8b * use tasbtractprocdef(resultdef).addresstype instead of voidcodepointertype in
tcgtypeconvnode.second_proc_to_procvar. In the future (it's not implemented
  yet), this will allow taking the address of near procedures (which would then
  produce a near procvar) in i8086 far code memory models.

git-svn-id: trunk@38644 -
2018-03-29 15:11:14 +00:00
florian
28cfa838b5 + support for the different flag registers of sparc
* fixing 64 bit cmp operations on sparc64

git-svn-id: trunk@36638 -
2017-07-03 20:49:05 +00:00
florian
b1dff29cbf * removed unused units
git-svn-id: trunk@36165 -
2017-05-09 19:53:14 +00:00
florian
0cf5ef459d + tcgtypeconvnode.second_class_to_intf supports LOC_CONSTANT as well, resolves #31596
git-svn-id: trunk@35655 -
2017-03-25 10:27:29 +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
florian
000cffa8e3 * make more use of nf_internal to avoid range check errors
git-svn-id: trunk@34793 -
2016-11-05 23:05:51 +00:00
svenbarth
a2bf4efce2 * use indirect imports for FPC_EMPTYCHAR if necessary
* make not of FPC_EMPTYCHAR as external assembler symbol

git-svn-id: trunk@34292 -
2016-08-12 14:20:17 +00:00
Jonas Maebe
017d4edbbb * fixed memory typecast of complex procdef to simple procvar: left.resultdef
is a procdef, but after the load was finished it's actually already a
    (complex) procvar. And since it's a memory location, the result of the
    typecast is a pointer to the typeconvnode's resultdef (fixes
    tests/tbs/tb0594.pp and others for llvm)

git-svn-id: trunk@34151 -
2016-07-19 14:30:30 +00:00
Jonas Maebe
3f01efbee0 * adapted tcgtypeconvnode.second_int_to_int() to work with high level cpu
targets, and removed the (buggy) LLVM-specific version

git-svn-id: trunk@33980 -
2016-06-12 20:56:40 +00:00
svenbarth
9d4e322cd0 Add AT_FUNCTION or AT_DATA to calls to (Weak)RefAsmSymbol. powerpc-macos needs them.
git-svn-id: trunk@33287 -
2016-03-19 12:29:21 +00:00
Jonas Maebe
a9498b6735 * fixed the parameter order for thlcgobj.g_load_const_field_by_name()
git-svn-id: trunk@32595 -
2015-12-05 18:03:48 +00:00
Jonas Maebe
4821fa7c67 * fixed second_proc_to_procvar for 8086 after r32553
git-svn-id: trunk@32592 -
2015-12-05 18:03:40 +00:00
Jonas Maebe
d6fb458129 * made second_proc_to_procvar type safe
git-svn-id: trunk@32553 -
2015-11-29 21:46:00 +00:00
Jonas Maebe
64c4e16f8b * converted last part of second_real_to_real() to the high level code
generator

git-svn-id: trunk@32546 -
2015-11-27 14:44:37 +00:00
Jonas Maebe
a55e9a8b0a * fixed type in second_class_to_intf if the class was in a LOC_REGISTER
git-svn-id: trunk@32422 -
2015-11-21 12:37:36 +00:00
Jonas Maebe
d444b365e1 * finished conversion of second_class_to_intf to the high level code
generator after r32301

git-svn-id: trunk@32313 -
2015-11-13 17:48:16 +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
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
Jonas Maebe
b9c9422fa7 * fixed type of reference used to store an ansichar that was converted
inline to a shortstring

git-svn-id: trunk@31049 -
2015-06-13 22:48:05 +00:00
Jonas Maebe
582aee4d90 * fixed the type of FPC_EMPTYCHAR when referencing it
git-svn-id: trunk@30785 -
2015-05-03 16:51:16 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Károly Balogh
0021ad714f * fixed some ancient code behind cpu_uses_separate_address_registers define to at least compile again, for some m68k experiment
git-svn-id: trunk@30130 -
2015-03-07 22:11:43 +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
2c3aa7cee0 * give an internal error in second_int_to_bool() if left.expectloc was not
in [LOC_FLAGS,LOC_JUMP], but it's actual location is one of those

git-svn-id: trunk@29587 -
2015-01-30 19:31:31 +00:00
Jonas Maebe
3a78f4f580 * use the correct destination def for loading a simple proc2procvar
git-svn-id: branches/hlcgllvm@28479 -
2014-08-19 20:22:19 +00:00
Jonas Maebe
5c75b6dd6b * synchronised with trunk up till r28402
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
Jonas Maebe
2c7a1b4e91 * fixed optimisation from r25067 for the generic case where a signed value
is converted to a larger unsigned value (e.g. OS_S16 -> OS_32)

git-svn-id: trunk@28251 -
2014-07-23 14:06:06 +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
04eb925776 * tcgtypeconvnode.second_int_to_int: disabled optimization from r25067 for m68k, because reg_cgsize() does not return expected values on that target.
git-svn-id: trunk@28093 -
2014-06-27 19:49:18 +00:00
nickysn
cb05907e18 * fixed the global function to nested procvar conversion in the i8086 far data
memory models

git-svn-id: trunk@27814 -
2014-05-23 20:59:07 +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
4ab9c6f206 + fixed tcgtypeconvnode.second_class_to_intf for i8086 far data memory models
git-svn-id: trunk@27692 -
2014-04-30 14:05:35 +00:00
nickysn
a17c04c3e0 * fixed array to pointer conversion in i8086 far data memory models
git-svn-id: trunk@27683 -
2014-04-28 12:36:38 +00:00
nickysn
e8b9d9bf41 * converted tcgtypeconvnode.second_nil_to_methodprocvar to the high level code
generator, so it handles i8086 near and far pointers generically
- removed t8086typeconvnode.second_nil_to_methodprocvar, since it's no longer
  necessary

git-svn-id: trunk@27678 -
2014-04-28 01:05:14 +00:00
nickysn
187c2af20e * tcgtypeconvnode.second_proc_to_procvar converted to the high level code
generator, so it can now handle i8086 near and far pointers generically
- removed almost all of t8086typeconvnode.second_proc_procvar, since it's no
  longer needed. Only a few assertions are left there to ensure that we don't
  accidentally attempt to take the address of a near procedure in a far code
  memory model, because the calling conventions are incompatible.

git-svn-id: trunk@27677 -
2014-04-27 23:18:05 +00:00
florian
0a7b795744 * fix for the regressions caused by r27417
git-svn-id: trunk@27433 -
2014-04-01 19:34:21 +00:00
florian
73cf0b62f2 * relaxed conditions for floats in int registers, this improved softfloat code significantly
git-svn-id: trunk@27417 -
2014-03-31 21:14:16 +00:00
nickysn
0aab7fcc9c * fixed tcgtypeconvnode.second_cstring_to_pchar for i8086 far data memory models by using the high level code generator
git-svn-id: trunk@27324 -
2014-03-28 18:36:14 +00:00
nickysn
2644d7566c * refactored tcgtypeconvnode.second_pointer_to_array to use
hlcg.reference_reset_base, which removes the need for i8086-specific ifdefs

git-svn-id: trunk@27311 -
2014-03-28 00:10:29 +00:00