Commit Graph

32 Commits

Author SHA1 Message Date
Jonas Maebe
3ac703506c * rest of the previous accidental partial commit
git-svn-id: branches/fixes_3_2@41250 -
2019-02-07 19:56:21 +00:00
Jonas Maebe
fc9e9e804a --- Merging r40512 into '.':
A    tests/webtbs/tw33607.pp
U    compiler/aarch64/hlcgcpu.pas
--- Recording mergeinfo for merge of r40512 into '.':
 U   .
--- Merging r40566 into '.':
U    compiler/aarch64/cpupara.pas
--- Recording mergeinfo for merge of r40566 into '.':
 G   .
--- Merging r40567 into '.':
G    compiler/aarch64/cpupara.pas
--- Recording mergeinfo for merge of r40567 into '.':
 G   .
--- Merging r40573 into '.':
G    compiler/aarch64/cpupara.pas
--- Recording mergeinfo for merge of r40573 into '.':
 G   .
--- Merging r40629 into '.':
U    compiler/ncnv.pas
U    compiler/llvm/nllvmcnv.pas
--- Recording mergeinfo for merge of r40629 into '.':
 G   .
--- Merging r40637 into '.':
U    compiler/ncon.pas
A    tests/webtbs/tw33666.pp
--- Recording mergeinfo for merge of r40637 into '.':
 G   .
--- Merging r40729 into '.':
U    compiler/ncal.pas
U    compiler/jvm/njvminl.pas
U    compiler/ninl.pas
--- Recording mergeinfo for merge of r40729 into '.':
 G   .

git-svn-id: branches/fixes_3_2@40735 -
2019-01-01 16:49:46 +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
Jonas Maebe
b936d8f012 * don't internalerror when performing an LLVM tc_equal conversion from one
TP-style object to another and the sizes differ, at least if they are
    related
  * restructured and commented the LLVM type conversion checks

git-svn-id: trunk@35137 -
2016-12-16 22:38:01 +00:00
Jonas Maebe
f55d962e40 * use system.round() instead of LLVM's fptosui operation for converting a
floating point type to currency, as fptosui is defined as always rounding
    to zero while on other platforms we use the FPU's current rounding mode
    (fixes webtbs/tw21449 for LLVM, and also webtbs/tw24197 because LLVM's
     code generated for fptosui temporarily changes the FPU control word so
     it rounds to zero and also to disable FPU exceptions)

git-svn-id: trunk@35061 -
2016-12-04 11:15:22 +00:00
Jonas Maebe
ee014fa4ff * fixed handling of typed files for LLVM when ISO-like I/O is active: encode
the buffer in the type, and support typecasting the typed file to a
    different size (needed to be able to pass it to the compiler helpers that
    expected a "TypedFile", whose buffer is 0 bytes and which hence will
    always have a smaller size than the original type) (fixes test/tisoext1)

git-svn-id: trunk@35017 -
2016-11-29 21:54:21 +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
8c006f04e2 * don't check type size equality for conversions to formaldef either
git-svn-id: trunk@33987 -
2016-06-15 18:31:37 +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
Jonas Maebe
2d1023140a * don't try to check whether the size of from and to in type conversion nodes
are the same in case of open arrays (their size can't be determined at
    compile time) -- this is just a sanity check, which can't be performed in
    this case

git-svn-id: trunk@33979 -
2016-06-12 20:56:37 +00:00
Jonas Maebe
9d2bba1917 * create a separate type and def for the LLVM "i1" type, because reusing
pasbool8type for this results in too much trouble (we mustn't use i1
    for parameters, because then LLVM will try to apply the ABI convention
    for passing "1 bit" values, or in records because then this may
    result in unwanted bitpacking). Downside: the new LLVMBool1 type is
    also exposed in the system unit, because we need it to define LLVM
    intrinsics...

git-svn-id: trunk@33726 -
2016-05-20 20:51:44 +00:00
Jonas Maebe
49a83b2872 * allow targets to keep certain type conversions for equal types in
inserttypeconv()
   o keep typeconversions between structurally equivalent but semantically
     different procvardefs for LLVM and JVM, because they're different
     types there

git-svn-id: trunk@32904 -
2016-01-10 14:01:46 +00:00
Jonas Maebe
e3d2980c98 * don't load data in a register when converting from void to an integer
type (like with integer(pointer1^):=integer(pointer2^))

git-svn-id: trunk@32743 -
2015-12-26 20:01:44 +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
df9efdeb4c * fixed llvm types for loading the address of a nested routine
git-svn-id: trunk@32594 -
2015-12-05 18:03:45 +00:00
Jonas Maebe
35714e5d50 * don't internallerror when encountering an "absolute" type conversion to
a differently sized def in LLVM

git-svn-id: trunk@32571 -
2015-12-02 22:29:23 +00:00
Jonas Maebe
13cf405f8c * fixed llvm second_int_to_real for comp
git-svn-id: trunk@32464 -
2015-11-22 11:49:11 +00:00
Jonas Maebe
72c7cb2770 * typecast second_proc_to_procvar() results for llvm if the generic code
performed a simple location_copy() from one complex procvar type to
    another

git-svn-id: trunk@32426 -
2015-11-21 12:37:50 +00:00
Jonas Maebe
423eb7ddb6 * fixed int_to_real() conversion llvm destination type when the result is
currency

git-svn-id: trunk@32423 -
2015-11-21 12:37:40 +00:00
Jonas Maebe
bd4787c716 * force complex procvars immediately to memory for llvm, so we don't have to
deal with the hacky register/registerhi complex locations

git-svn-id: trunk@32407 -
2015-11-21 12:36:48 +00:00
Jonas Maebe
4f54f8b3bd * fixed expectloc for llvm bool_2_int typeconversions where the location
doesn't change

git-svn-id: trunk@32248 -
2015-11-04 22:23:50 +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
eae68e86a1 * don't insert a typeconversion from pasbool to int in case the left
location was LOC_JUMP or LOC_FLAGS, as in that case the generic
    code has already done this using location_force_reg()

git-svn-id: trunk@30783 -
2015-05-03 16:51:10 +00:00
Jonas Maebe
f7b5ee64ae * always insert type conversion for pasbool to int on llvm, as pasbool is
represented by i1 while equally sized integers are i8

git-svn-id: trunk@30709 -
2015-04-25 15:50:58 +00:00
Jonas Maebe
0aab46b97f + tllvmtypeconvnode.second_int_to_bool() implementation
git-svn-id: branches/hlcgllvm@28370 -
2014-08-10 19:40:13 +00:00
Jonas Maebe
9fada1a238 * don't internalerror when typecasting voidpointer^ or formaldef
git-svn-id: branches/hlcgllvm@28208 -
2014-07-12 22:42:15 +00:00
Jonas Maebe
27e350fa9a + llvm implementation of second_int_to_real()
git-svn-id: branches/hlcgllvm@28207 -
2014-07-12 22:42:11 +00:00
Jonas Maebe
4746e17be5 * implemented second_int_to_int() for llvm
o the generic implementation ignores the need for bitcasts from pointers to
     ordinals and vice versa, and also hacks around with offsets

git-svn-id: branches/hlcgllvm@28206 -
2014-07-12 22:14:37 +00:00
Jonas Maebe
b494f76b81 * made internalerror unique
git-svn-id: branches/hlcgllvm@28201 -
2014-07-12 22:13:39 +00:00
Jonas Maebe
cdfb23bf6c * converted some leftovers in tcgtypeconvnode.second_int_to_int/
second_real_to_real to thlcgobj
  + added type conversion to second_pointer_to_array for llvm

git-svn-id: branches/hlcgllvm@27000 -
2014-03-06 21:41:27 +00:00
Jonas Maebe
8cc9b64ad7 * don't discard typeconversion nodes that only change the result type when
compiling for llvm, because this type change also needs to be modelled in
    llvm IR

git-svn-id: branches/hlcgllvm@26999 -
2014-03-06 21:41:24 +00:00