Commit Graph

41 Commits

Author SHA1 Message Date
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
31ef82b9c6 * constrained sitofp is not yet supported in LLVM for all targets
git-svn-id: trunk@43885 -
2020-01-07 20:22:17 +00:00
Jonas Maebe
32be078ab8 * fixed for targets where currency is implemented via int64 after r43829
git-svn-id: trunk@43882 -
2020-01-07 20:22:06 +00:00
Jonas Maebe
1f5efe2a95 * support for constrained sitofp/uitofp with (the upcoming) LLVM 10.0
(fixes most of test/units/math/troundm, although there's still an LLVM
     optimizer/code generation bug that breaks some qword -> double
     conversions)

git-svn-id: trunk@43829 -
2019-12-31 18:05:54 +00:00
Jonas Maebe
67dbd0cdb3 * support nf_internal to ignore currency conversion adjustments also on
platforms that implement currency using a floating point type

git-svn-id: trunk@43817 -
2019-12-30 15:05:02 +00:00
Jonas Maebe
cdafe680c2 * different definitions for the same Objective-C class (can happen with
external class declarations) need a type conversion in LLVM (because
    they're represented by different LLVM types)

git-svn-id: trunk@42970 -
2019-09-09 18:33:37 +00:00
Jonas Maebe
f1b66a9741 * fixed LLVM type checking of typed files in ISO mode (fixes webtbs/tw34848)
git-svn-id: branches/debug_eh@42205 -
2019-06-10 13:36:57 +00:00
Jonas Maebe
3bee9ab9da * two different specialisations with the same types from different units
still need a type conversion with llvm, as their type identifiers will
    be different

git-svn-id: branches/debug_eh@42097 -
2019-05-18 18:49:05 +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
f3d831b480 * fixed result cgsize of LLVM's second_nothing type conversion node (new
size instead of original size, which can be different in case of going
    from void to something else)

git-svn-id: trunk@40632 -
2018-12-24 22:09:58 +00:00
Jonas Maebe
dd29088430 * simplify all type conversions for formal constants even for LLVM and JVM
(since these happen at compile time and don't result in generated code,
     they never need extra type conversions in the code)

git-svn-id: trunk@40629 -
2018-12-24 22:09:48 +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