Commit Graph

600 Commits

Author SHA1 Message Date
pierre
04ebdf8df8 Fix compilation for x86_64 llvm variant
git-svn-id: trunk@49477 -
2021-06-05 06:47:46 +00:00
pierre
aadcb00977 Add -march option to clang call for llvm target
git-svn-id: trunk@49475 -
2021-06-04 21:14:34 +00:00
florian
fe57cd3536 * fix LLVM after r48828
* global gotos really use the return type of fpc_setjmp to test where we come from

git-svn-id: trunk@48835 -
2021-02-27 22:07:58 +00:00
Jonas Maebe
80282d6eff * llvm: only set custom parameter alignments for byval parameters, the rest
is handled automatically by llvm (and since llvm 11.0 you get an error if
    you specify an alignment for them anyway)

git-svn-id: trunk@48100 -
2021-01-06 22:35:40 +00:00
Jonas Maebe
c3e2285c45 * when getting an llvm temporary recorddef, recurse into arrays rather than
treating them as opaque defs. This is required to ensure that the temporary
    recorddef for all x86-64 function results are the same on the caller and
    callee side, as we allocate new arrays when generating them

git-svn-id: trunk@47584 -
2020-11-25 18:44:44 +00:00
pierre
96f2e683e7 Also accept s80bit real constants when FPC_SOFT_FPUX80 macro is defined
git-svn-id: trunk@47557 -
2020-11-24 15:31:26 +00:00
Jonas Maebe
6d0ce1c4b6 * LLVM: ensure that the parameter types are processed of procdefs that are
declared when they get first called
   o fixes compilation of several tests/test/tobjc* tests after r46675

git-svn-id: trunk@47160 -
2020-10-23 15:09:34 +00:00
Jonas Maebe
080d8c28f7 * LLVM 11.0 support
git-svn-id: trunk@47121 -
2020-10-17 14:59:04 +00: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
Jonas Maebe
3208929e17 * add Xcode-11.0 as LLVM target version versin
git-svn-id: trunk@46676 -
2020-08-23 21:11:13 +00:00
Jonas Maebe
453bfcd370 * emit the correct declaration for procdefs used to force a procname in LLVM
o fixes lazarus startup on macOS/AArch64 when compiled with the LLVM cg

git-svn-id: trunk@46675 -
2020-08-23 21:11:09 +00:00
yury
6e777d8967 * ait_comment,ait_regalloc,ait_tempalloc,ait_varloc instructions produce only comments in the external assembler output. Moved handling of these instructions to TExternalAssembler.WriteComments().
This eliminates code duplication and improves maintainability.

git-svn-id: trunk@46550 -
2020-08-22 19:53:39 +00:00
yury
5ec489c018 * ait_varloc instructions are handled and removed by Trgobj.translate_registers() and never left for an assembler.
git-svn-id: trunk@46541 -
2020-08-22 10:58:21 +00:00
yury
764227193a * Added on option to implement library based smartlinking of the dead stripable vectorized lists (e.g. resource strings index). By default smartlinking of such lists only supported when the section based smartlinking (tf_smartlink_sections) is enabled for a target.
git-svn-id: trunk@46479 -
2020-08-18 11:31:39 +00:00
Jonas Maebe
86d55055df * made internalerror unique
git-svn-id: trunk@46236 -
2020-08-04 21:12:06 +00:00
Jonas Maebe
3047ce71bc * fixed LLVM register allocator after r46199
git-svn-id: trunk@46212 -
2020-08-03 20:36:02 +00:00
Jonas Maebe
a5bad32b7c - removed no longer used -target $TARGET parameter (triplet is used instead)
git-svn-id: trunk@45853 -
2020-07-25 16:11:54 +00:00
Jonas Maebe
eb7ba1690e * mark all external assemblers using an LLVM tool using af_llvm
+ added support for constructing target triplets
  * pass "-target triplet" when using an LLVM assembler
   o removed no longer needed $DARWINVERSION and $ARCH parameters
  * consistently use as_clang_gas when clang is used to assembler GAS-style
    assembly, and rename as_llcm_clang to as_clang_llvm (for consistency)
  * support pipe assembling when using clang on *nix in all cases

git-svn-id: trunk@45807 -
2020-07-19 14:30:35 +00:00
Jonas Maebe
e7d1a77f9a * rename the ARM/AArch64-Darwin targets to ARM/AArch64-iOS
* rename the m68k/PowerPC-MacOS targets to m68k/PowerPC-MacOSClassic
  * repurpose the AArch64/Darwin target for AArch64/macOS
   o make AArch64-Darwin default target for a hosted AArch64-Darwin compiler

git-svn-id: trunk@45758 -
2020-07-10 21:52:24 +00:00
Jonas Maebe
4caa471a24 * implemented a_load_undefined_cgpara for LLVM, fixes LLVM code generator
after the changes to optimize unused parentfp parameters

git-svn-id: trunk@45456 -
2020-05-21 10:56:39 +00:00
yury
627fcb4354 * Do not use the LOC_VOID location to indicate unused parameters.
* Added the tprocdef.parentfpsym property. Set parentfpsym.varstate to vs_read instead of using the pio_needs_parentfp flag.
* Replaced tcgcallparanode.push_zero_sized_value_para by tparamanager.has_strict_proc_signature.

git-svn-id: trunk@45454 -
2020-05-21 09:36:40 +00:00
marcus
589b2b956f Fixed LLVM compilation after r45143
git-svn-id: trunk@45155 -
2020-04-28 18:41:45 +00:00
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