Commit Graph

578 Commits

Author SHA1 Message Date
nickysn
3d81dd0b00 * ReplaceForbiddenAsmSymbolChars renamed ApplyAsmSymbolRestrictions, because now it also applies the
label length limit

git-svn-id: branches/z80@45085 -
2020-04-26 10:42:07 +00:00
nickysn
a8fe46c0f5 + introduced labelmaxlen in tasminfo and added code in ReplaceForbiddenAsmSymbolChars that limits the
output label to that length

git-svn-id: branches/z80@45066 -
2020-04-25 12:59:25 +00:00
Jonas Maebe
d5de84c6c5 * use typenames in more cases in the generated LLVM IR (results in smaller
IR in textual form)

git-svn-id: trunk@44518 -
2020-04-02 21:21:44 +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
4ba19f5418 * add support for creating non-address-only procvars to
cprocvar.getreusableprocaddr()

git-svn-id: trunk@44516 -
2020-04-02 21:21:36 +00:00
Jonas Maebe
79974a9671 + -XlS<x> option to specify a suffix for externally called LLVM utilities,
e.g. -XlS-7 to call clang-7 instead of clang)
  * IMPORTANT: changed the -CL llvm code generation options to -Cl, for
    consistency with the new -Xl option (-XL was already taken)

git-svn-id: trunk@44436 -
2020-03-30 19:58:49 +00:00
Jonas Maebe
523ebb42cf * fix LLVM backend compilation (mantis #36833)
git-svn-id: trunk@44374 -
2020-03-27 21:26:39 +00:00
Jonas Maebe
3188dc18d4 * fixed tdel1/2 tests again for AArch64/LLVM
git-svn-id: trunk@44195 -
2020-02-16 16:58:25 +00:00
Jonas Maebe
254b85c352 + new pio_inline_forbidden flag to indicate that while parsing the
implementation the compiler determined the routine must never be
    inlined
   o difference with po_noinline: can also be set in the implementation
   o difference with pio_inline_not_possible: it indicates that e.g.
     LLVM must not inline the routine either

git-svn-id: trunk@44065 -
2020-01-29 22:21:17 +00:00
Jonas Maebe
08f9ec98e5 * use same Windows platform name as clang
git-svn-id: trunk@44063 -
2020-01-29 22:21:10 +00:00
Jonas Maebe
df6516c29f * fix internalerror if adding the object info for LLVM requires creating new defs
git-svn-id: trunk@44061 -
2020-01-29 22:21:03 +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
9462d6b1ea * handle non-smallset sets in registers in LLVM like arrays and records
git-svn-id: trunk@43884 -
2020-01-07 20:22:13 +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
f659e91a95 * fixed LLVM compilation after r43860
git-svn-id: trunk@43862 -
2020-01-05 13:15:10 +00:00
Jonas Maebe
044d946782 * fixed missing sign extension when adding a signed integer variable with
size < sizeof(pointer) to a pointer for LLVM (fixes tfmtbcd)

git-svn-id: trunk@43833 -
2020-01-01 19:19:12 +00:00
Jonas Maebe
ec0d98156c * use maytrap instead of strict FP exception behaviour in LLVM, so constant
propagation is still allowed

git-svn-id: trunk@43832 -
2020-01-01 19:19:08 +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
9b53ed53e3 * the llvm.experimental.constrained.fpext intrinsic doesn't have a rounding
mode parameter

git-svn-id: trunk@43828 -
2019-12-31 18:05:50 +00:00
Jonas Maebe
3885ce98ac * fix LLVM code generator after r43808
o share the high/length code for LLVM rather than duplicating it, since
      LLVM will optimize away the minor inefficiencies
    o removed temp reference in the old code, as it was useless (it doesn't
      prevent spilling to get to an SSA representation since the same
      register is written at least twice in all cases)

git-svn-id: trunk@43821 -
2019-12-30 15:05:17 +00:00
Jonas Maebe
a6a17efa42 * use LLVM constrained fpext/fptrunc intrinsics when fastmath is not enabled
for accurate exception behaviour

git-svn-id: trunk@43820 -
2019-12-30 15:05:13 +00:00
Jonas Maebe
797077855e * use constrained LLVM fp intrinsics for add/sub/mul/slash/fma/sqrt
operations when fastmath is not enabled

git-svn-id: trunk@43819 -
2019-12-30 15:05:09 +00:00
Jonas Maebe
b355ba3d39 * record whether a function uses fastmath, and define the function as
strictfp if it doesn't (so LLVM doesn't perform transformations that can
    change the fp/exception behaviour)

git-svn-id: trunk@43818 -
2019-12-30 15:05:06 +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
9bd33f7a45 + support for LLVM metadata constant string parameters
o they are implemented as a new metadata register class, whereby the
     subregister indicates the metadata type (currently always a string)
     and the superregister is an index in the metadata array (which
     contains the strings). LLVM metadata can only be passed as parameters
     to intrinsics in bitcode, so moves of metadata into other registers
     triggers internal errors and when moving them into parameters, we
     replace the parameter's register with the metadata register (and look
     up the corresponding string when writing out the bitcode)

git-svn-id: trunk@43816 -
2019-12-30 15:04:57 +00:00
Jonas Maebe
6d51c69dbe * fixed writing of calling convention for function declarations/definitions
in LLVM

git-svn-id: trunk@43785 -
2019-12-24 22:12:40 +00:00
Jonas Maebe
96dfe3d03a * LLVM support for writing vector types
git-svn-id: trunk@43783 -
2019-12-24 22:12:34 +00:00
Jonas Maebe
1e3f72403e * renamed getintparaloc to getcgtempparaloc
o it can be used for more than integer parameters

git-svn-id: trunk@43781 -
2019-12-24 22:12:25 +00:00
Jonas Maebe
0f57151d36 + recognise LLVM 9.0 (no changes needed compared to LLVM 8.0)
git-svn-id: trunk@43686 -
2019-12-14 17:15:27 +00:00
Jonas Maebe
c477816100 - removed LLVM support for clang < 7.0 and Xcode < 10.0: those versions
contain various bugs and can't even complete "make all", so there is no
    point in keeping them
   o changed default LLVM target version to 7.0

git-svn-id: trunk@43682 -
2019-12-14 14:59:05 +00:00
Jonas Maebe
a352a12bb4 * use value_real rather than value_curency when writing currency
realconstnodes (fixes tcurrency1, tw33439 and tw36179 with LLVM)
   o we need to load the fpu representation of the currency values,
     not the scaled currency value

git-svn-id: trunk@43681 -
2019-12-14 14:11:12 +00:00
Jonas Maebe
e775ecdc43 * cleaned up safecall support: use a hidden localvarsym instead of result
register hacking
   o this also allowed fixing/adding safecall support for LLVM

git-svn-id: trunk@43578 -
2019-11-24 20:23:22 +00:00
Jonas Maebe
49026e1261 * add "readonly" attribute for constant pointer parameters on LLVM
git-svn-id: trunk@43089 -
2019-09-29 10:29:57 +00:00
Jonas Maebe
b99323bb19 * fix LLVM compilation after r43076
git-svn-id: trunk@43088 -
2019-09-29 10:29:54 +00:00
Jonas Maebe
9678542ba6 + add "thunk" attribute for stubs/thunks and emit it for LLVM
- also removed wrong "noreturn" attribute for interface thunks generated
     for high level code generator targets

git-svn-id: trunk@43018 -
2019-09-15 20:43:12 +00:00
Jonas Maebe
ff2d718699 * fixed occasional rounding error with currency constants on the LLVM targets
(fixes test/tcustomattr13.pp)

git-svn-id: trunk@43017 -
2019-09-15 20:43:09 +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
dcf4e4cb2c * support taking the address of labels defined in assembler blocks in the
LLVM code genrator (for the rtti unit's thunk hacking)

git-svn-id: trunk@42969 -
2019-09-09 18:33:33 +00:00
Jonas Maebe
e7fbebfef5 * fixed field alignment when reusing an anonymous recorddef for LLVM and
the LLVM layout of an instance does not match the original one
    (e.g. because it contains procdefs of procedures with different
     signatures)

git-svn-id: trunk@42477 -
2019-07-21 11:06:54 +00:00
Jonas Maebe
145f4299b4 * search dynamic string data record in correct symtable in
tllvmtai_typedconstbuilder.emit_string_offset
   o fixes LLVM internalerror 2014080406 for test/tcustomattr14

git-svn-id: trunk@42464 -
2019-07-20 12:08:59 +00:00
Jonas Maebe
d8903ce6b3 - removed maxcrecordalign parameter/field from recordsymtables, as this value
cannot be modified in the settings (so we can directly use the one from
    current_settings)

git-svn-id: trunk@42447 -
2019-07-14 19:24:32 +00:00
Jonas Maebe
3fee990218 * on Mach-O, PECOFF and ELF platforms, write local symbols as hidden/
private_extern (or plain global in case of PECOFF, as the effect is
    the same there): visible across object files, but they become local
    when linked into a binary/library. This enables cross-unit inlining
    of functions accessig implementation-only symbols.

git-svn-id: trunk@42340 -
2019-07-07 21:33:43 +00:00
Jonas Maebe
789f13eb24 * LLVM-specific support for popcnt
git-svn-id: trunk@42311 -
2019-06-30 15:23:36 +00:00
Jonas Maebe
0a91fcb44f * LLVM-specific support for bsr*/bsf*
git-svn-id: trunk@42309 -
2019-06-29 16:27:18 +00:00
Jonas Maebe
c425c51963 * simplify and optimize generated LLVM code for case statements
git-svn-id: trunk@42305 -
2019-06-29 12:17:49 +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
3f2578a3e3 * don't quote LLVM calling convention name (that will cause it to be ignored)
o fixes tasm10a and tx64ccnv.ll with LLVM

git-svn-id: branches/debug_eh@42193 -
2019-06-08 17:11:20 +00:00
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
Jonas Maebe
1dee4c41dd - removed "cmp 0/1, pasbool1" optimization for llvm because this discards
the upper 7 bits of the boolean, while other platforms take it into
    account (even though they're technically always required to be 0, and
    the value is undefined if they're not)

git-svn-id: trunk@42189 -
2019-06-07 18:17:55 +00:00
Jonas Maebe
5473f4fc44 + LLVM support for library init/fini routines
git-svn-id: branches/debug_eh@42108 -
2019-05-19 19:26:59 +00:00