Commit Graph

19804 Commits

Author SHA1 Message Date
florian
1e374df5b8 * correctly calculate the bit mask in thlcgobj.a_load_regconst_subsetreg_intern, resolves #31042
* convert immediates on x86 always to 32 (x86-64, i386) or 16 bit (i8086) signed values

git-svn-id: trunk@35082 -
2016-12-07 20:08:22 +00:00
sergei
8173efff3e * x86 asm reader: Don't copy operand size to instruction size for MOVSS and VMOVSS, because it is different for source and destination. Fixes breakage caused by fixing memory size of those instructions (Mantis #29954 and Mantis #29957).
+ Tests are extended to check that both OPR_LOCAL and OPR_REF memory operands compile without warnings as source and destination, in both Intel and AT&T syntax.

git-svn-id: trunk@35081 -
2016-12-07 14:08:28 +00:00
svenbarth
a23cfd9a85 * regenerate msgidx.inc and msgtxt.inc after r35079; thankfully that didn't break the build this time since it was merely a text change ^.^'
git-svn-id: trunk@35080 -
2016-12-07 07:38:01 +00:00
svenbarth
d499163ef5 * provisional fix for Mantis #31076: fail gracefully instead of with an internal error if a generic method is declared inside a generic class or record. This will change once we support nested generics however.
* adjusted error message to reflect that we're not only dealing with generic classes
+ added test; note: it's added in webtbs, cause the test will loose its %FAIL attribute in the future

git-svn-id: trunk@35079 -
2016-12-06 22:26:53 +00:00
svenbarth
70817baf98 * since we already allow inline specializations in mode ObjFPC due to generic functions it's only consequential to also allow specializations after pointers (they are already allowed in mode Delphi).
+ added tests
* tgeneric87.pp and tgeneric88.pp are no longer considered as tests that should fail

git-svn-id: trunk@35078 -
2016-12-06 21:37:22 +00:00
Károly Balogh
788c622307 amiga: pascal startup code for 68k and buildrtl refactor
git-svn-id: trunk@35068 -
2016-12-04 18:21:24 +00:00
marcus
bebef242d4 AROS: Initial ABIv1 Support
git-svn-id: trunk@35066 -
2016-12-04 15:41:35 +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
8b1c90124e * support encoding helper types for LLVM (encode the same type as the
extended class) (fixes webtbs/tw21457 for LLVM)

git-svn-id: trunk@35060 -
2016-12-04 11:15:19 +00:00
Jonas Maebe
a0b537bc7b * fixed typed constants that use an integer number to initialise a procvar or
pointer on LLVM (fixes webtbs/tw21267)

git-svn-id: trunk@35059 -
2016-12-04 11:15:15 +00:00
Jonas Maebe
2e9c6f35ae - disable -Ooregvar for the LLVM-based x86-64 code generator, as it causes
internalerrors there and fixing it doesn't make sense since LLVM will take
    care of that anywaya

git-svn-id: trunk@35058 -
2016-12-04 11:15:12 +00:00
Jonas Maebe
a2017b2327 * don't keep tc_equal type conversions for LLVM in case the resultdef doesn't
change, since then we definitely don't have to insert a type conversion at
    the LLVM level either (fixes webtbs/tw1901 for LLVM)

git-svn-id: trunk@35057 -
2016-12-04 11:15:09 +00:00
Jonas Maebe
a8e107bb4b * fix memory leak: free rg[R_MMREGISTER]
git-svn-id: trunk@35056 -
2016-12-04 11:15:05 +00:00
Károly Balogh
f3e33a9dde morphos: new pascal-written internal startup code. also refactored the rtl build process for morphos
git-svn-id: trunk@35054 -
2016-12-04 00:15:41 +00:00
Károly Balogh
8c4e5e0610 bump PPU version due to the latest syscall changes
git-svn-id: trunk@35048 -
2016-12-03 19:01:11 +00:00
Károly Balogh
0cb555c07c syscalls: move the reference implementation of parseparaloc to paramgr. removes two identical copies from CPU specific code and enables basereg convention for AROS/x86_64. also, other minor fixes and cleanups in related code.
git-svn-id: trunk@35047 -
2016-12-03 19:00:41 +00:00
Jonas Maebe
ba33da711a * fixed compilation after r35034
- removed commented-out uses statement

git-svn-id: trunk@35046 -
2016-12-03 08:48:01 +00:00
Jonas Maebe
8c167f4e40 * handle already quoted symbol names for LLVM (like for Objective-C)
git-svn-id: trunk@35045 -
2016-12-02 18:04:14 +00:00
Jonas Maebe
876e5eab56 * fixed "smart linking" parameters to llc
git-svn-id: trunk@35044 -
2016-12-02 17:45:12 +00:00
Jonas Maebe
f26ed10ba1 * same as r27223 for hlcgobj (fixes webtbs/tw25895 for llvm)
git-svn-id: trunk@35043 -
2016-12-02 17:45:09 +00:00
Jonas Maebe
02e4a27a35 * print internalerrors in case we still encounter stray constants not part of
a typed constants
  * don't print superfluous newlines in typed constant definitions

git-svn-id: trunk@35042 -
2016-12-02 12:33:09 +00:00
Jonas Maebe
db40e1575d + support for handling the tcalo_no_dead_strip flag when targeting LLVM:
add such symbols to the pseudo-arrays llvm.compiler.used or llvm.used
    depending on their nature (fixes compiling Objective-C programs with
    optimization, and keeps the FPC ident in the linked binary)

git-svn-id: trunk@35041 -
2016-12-02 12:33:05 +00:00
Jonas Maebe
e62cb7917e + support for setting the "appending" flag of declaration generated via an
LLVM typed constant builder through a new appendingdef property

git-svn-id: trunk@35040 -
2016-12-02 12:33:02 +00:00
Jonas Maebe
97d6f17cc8 + add support for marking an LLVM definition as using "appending" linkage
git-svn-id: trunk@35039 -
2016-12-02 12:32:58 +00:00
Jonas Maebe
d328d7d95d * don't write an alignment for symbols in internal llvm sections (sections
whose name starts with 'llvm.')

git-svn-id: trunk@35038 -
2016-12-02 12:32:54 +00:00
Jonas Maebe
d99d18e258 - removed useless empty asmwrite statement
git-svn-id: trunk@35037 -
2016-12-02 12:32:51 +00:00
Jonas Maebe
827e980351 * fixed comment typo
git-svn-id: trunk@35036 -
2016-12-02 12:32:48 +00:00
Károly Balogh
02d145233d add m68k atari to the list of platforms which support syscalls
git-svn-id: trunk@35035 -
2016-12-02 09:33:05 +00:00
Károly Balogh
f5f895e2a3 syscalls: unify call reference creation across 4 different CPU archs. less copypasted code, brings x86_64 AROS support up to speed
git-svn-id: trunk@35034 -
2016-12-02 09:29:09 +00:00
florian
c2af5a104e * patch by Emelyanov Roman to allow 64 byte alignment in the $codealign directive, resolves #30934
git-svn-id: trunk@35033 -
2016-12-01 21:21:42 +00:00
florian
0954e09834 * correctly handle 16 bit signed operations on AVRs without mul instruction, resolves #31036
git-svn-id: trunk@35031 -
2016-12-01 21:01:47 +00:00
marcus
b02d541e78 AROS: x86_64 needs also BINCOMPAT, TTask fixed type for 64 bit
git-svn-id: trunk@35028 -
2016-12-01 17:22:11 +00:00
svenbarth
d9ea6aae4d * fix for Mantis #30761: always return the symbol found in the helper instead of doing this dependant on the presence of the overload attribute; for this the collection of all suitable overloads is done in tcallcandidates instead.
+ added test

git-svn-id: trunk@35024 -
2016-11-30 17:52:25 +00:00
Jonas Maebe
1afab1ab69 * moved the floating point constant range checking code from
pass_generate_code to pass_typecheck, so that it's also used by targets
    that override pass_generate_code (fixes webtbs/tw16315b for LLVM)

git-svn-id: trunk@35021 -
2016-11-29 21:54:33 +00:00
Jonas Maebe
006c7e1ccf * apply localalignmin/max to local variables for LLVM (fixes webtbs/tw15582)
git-svn-id: trunk@35020 -
2016-11-29 21:54:30 +00:00
Jonas Maebe
7af2663ed1 * fixed writing the VMT field of TP-style objects for typed constants if it
comes after the last defined field (previously, we emitted a bunch of
    superfluous zero-bytes after that field due to bad accounting regarding
    the last emitted field)
   o fixes webtbs/tw1365.pp for LLVM, and removes junk bytes for all targets

git-svn-id: trunk@35019 -
2016-11-29 21:54:27 +00:00
Jonas Maebe
8cd84bd8e8 * stop updating llvmnextfieldindex once we have established that the current
typed constant does not match the equivalent LLVM definition (it's only
    used to check whether any emitted data's type differs from the LLVM
    definition's field types)
   o fixed a potential out-of-bounds access related to this: the index of the
     equivalent LLVM field kept getting increased and at some point we checked
     whether the current emitted data's type was different from the LLVM field
     type without verifying first that the LLVM equivalent field index was not
     yet beyond the number of LLVM equivalent fields

git-svn-id: trunk@35018 -
2016-11-29 21:54:25 +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
florian
d0b2701693 * similiar fix for i386 as done in r34984 for x86-64
git-svn-id: trunk@35016 -
2016-11-29 20:41:33 +00:00
svenbarth
6ba85c2a70 * second fix for Mantis #30626: also search in parent classes for a suitable pre-existing specialization
+ added test

git-svn-id: trunk@35014 -
2016-11-29 17:04:07 +00:00
svenbarth
0a1e080089 * only create a new procsym for a specialization if it's indeed needed
git-svn-id: trunk@35013 -
2016-11-29 14:13:06 +00:00
svenbarth
ebfeb5b62a * fix for Mantis #30830: also remove unregistered specializations from the procsym's deflist when they're removed to avoid an access to freed data
+ added tests (adjusted original test plus a mode Delphi variant)

git-svn-id: trunk@35012 -
2016-11-29 14:12:02 +00:00
svenbarth
a535d54bcb * fix for Mantis #30939: Rework generation of the generic name to be less relying on the type hierarchy as a specialization inside the parameter declaration would want to have the full name of the procdef including its parameters, but those are still parsed at that stage (the pretty name is still a topic onto itself however...)
+ added tests (original test was only mode fpc, test for mode delphi is added as well)

git-svn-id: trunk@35010 -
2016-11-28 18:16:49 +00:00
svenbarth
ee466b9a28 * extend tdef.fullownerhierarchyname() with a parameter that skips the inclusion of a procdef's parameter declaration using the new pno_noparams option
git-svn-id: trunk@35009 -
2016-11-28 18:06:35 +00:00
svenbarth
930070a8ca + new tprocnameoption pno_noparams to prohibit tprocdef.customprocname() from adding the procdef's parameters
git-svn-id: trunk@35008 -
2016-11-28 18:01:53 +00:00
svenbarth
3f77ce3b12 * leave parse_proc_head() (with some error recovery) if the interface could not be found instead of running straight into an access violation
+ added test

git-svn-id: trunk@35007 -
2016-11-28 17:54:48 +00:00
Jonas Maebe
1c820e9c8e * similar change as in r34976 for the generic code: don't assume that if
a load node for a procsym has a self pointer, that we have to create
    a procvar with a self pointer (e.g. when loading the address of a
    static class method). Avoids the generation of superfluous code to
    load self which is then not used afterwards

git-svn-id: trunk@35005 -
2016-11-27 21:54:50 +00:00
Jonas Maebe
26f9dabf56 * write the volatile flag for LLVM load/store operations if set
git-svn-id: trunk@35004 -
2016-11-27 21:44:32 +00:00
Jonas Maebe
4d951780d1 + support for LLVM 3.8 and LLVM 3.9 IR to the llvm assembler writer
git-svn-id: trunk@35003 -
2016-11-27 21:44:29 +00:00
Jonas Maebe
3ea976fd2d * fixed compilation of llvm compiler after r34996
git-svn-id: trunk@35002 -
2016-11-27 21:44:26 +00:00