sergei
5b6e50c9da
* It is incorrect to use var_align() in linker code: it depends on current_settings.alignment, which is valid only while compiling, not while linking. Replaced with size_2_align().
...
git-svn-id: trunk@25182 -
2013-07-29 15:51:30 +00:00
sergei
e7f6b06969
+ MIPS internal linker: support TLS IE/LE and GPREL32 relocations, is now able to link tw14265.
...
git-svn-id: trunk@25181 -
2013-07-29 09:30:40 +00:00
sergei
11b72b5515
x86_64 internal ELF linker:
...
* Split generation of regular and TLSIE GOT entries. Although code for both is similar to some extent, mixing them in a single method turns it into spaghetti.
* Several fixes to content and dynamic relocations of TLSIE entries.
git-svn-id: trunk@25180 -
2013-07-29 08:34:00 +00:00
florian
c2f7ccb253
* coalesce more aggressive
...
git-svn-id: trunk@25177 -
2013-07-26 19:06:20 +00:00
sergei
70dda94474
* x86_64-win64: don't allocate outgoing parameter area in nostackframe procedures, it fails compilation if range/overflow/etc checking is enabled (which always sets pi_do_call) due to check introduced in r22677.
...
git-svn-id: trunk@25176 -
2013-07-26 10:24:31 +00:00
svenbarth
53ea24a0b1
Correctly specialize generics if locally declared types are used (e.g. two procedures could both define a different "TRec" type which is used to specialize a generic inside the procedures).
...
symtype.pas, tdef:
+ add method "fullownerhierarchyname" which allows to retrieve the owner hierarchy name including procedure/function/method names
+ add method "fulltypename" which uses "fullownerhierarchyname" to return a full type name
symdef.pas, tstoreddef:
* implement "fullownerhierarchyname" (including caching of the result)
pgenutil.pas, parse_generic_specialization_types_internal:
* use "tdef.fulltypename" instead of "tdef.typename" to have unique values for each parsed type and thus for the specialization itself
+ tests
git-svn-id: trunk@25175 -
2013-07-26 09:02:24 +00:00
florian
6f5bcaae2b
* UMUL et al. have only register restrictions on arm below v6
...
git-svn-id: trunk@25171 -
2013-07-24 20:18:12 +00:00
sergei
404c3efa58
* MIPS: handle get_frame internally, so it sets pi_needs_stackframe flag on current procedure. This makes possible not to force pi_needs_stackframe on every procedure and thus omit saving/restoring $fp register when it is not necessary.
...
git-svn-id: trunk@25170 -
2013-07-24 15:25:12 +00:00
Jonas Maebe
35b771e421
* previously, we preferred pchar->shortstring to pchar->ansistring in
...
case of {$h-}. Now this is no longer done because it caused
pchar->ansistring and pchar->unicodestring to have the same
overload preference, which regularly caused problems with the
added unicodestring overloads in the RTL in the cpstrrtl branch.
* fixed tw3328.pp (it was missing a {$mode delphi}), which failed
before this patch but compiles new
+ extra variants of that test for the compiler changes
git-svn-id: trunk@25164 -
2013-07-24 09:39:34 +00:00
Jeppe Johansen
d89b9a4311
Add support in ARM assembler reader for ldr reg, =literal syntax
...
git-svn-id: trunk@25157 -
2013-07-21 16:06:57 +00:00
Jeppe Johansen
fdcc68cfd7
Disabled preindex/postindexed peephole optimizations for Thumb and Thumb2
...
git-svn-id: trunk@25156 -
2013-07-21 14:21:16 +00:00
Jeppe Johansen
0977d76f42
Mark global symbols with assembler references as non-regable
...
git-svn-id: trunk@25155 -
2013-07-21 13:41:10 +00:00
sergei
dddc78514d
* Internal ELF linker: for MIPS targets, place .got section after .data. This corresponds to behavior of ld, and reduces amount of processing when adding GOT slots for local symbols (which requires re-doing layout for all sections that come after .got)
...
git-svn-id: trunk@25154 -
2013-07-21 13:10:57 +00:00
nickysn
2e97de9522
+ added an i8086 specific override of thlcgcpu.location_force_mem, which handles 6-byte (medium/compact memory model) method pointers
...
git-svn-id: trunk@25151 -
2013-07-20 19:40:27 +00:00
nickysn
f5a0702f9a
+ added i8086 specific implementation of Tcgtypeconvnode.second_nil_to_methodprocvar, which supports memory models with far code and/or far data
...
git-svn-id: trunk@25150 -
2013-07-20 16:58:41 +00:00
nickysn
91d7b2bc94
+ added i8086 medium/compact model 6-byte (mixed near + far) method pointer support in tcgloadnode and tcgassignmentnode
...
git-svn-id: trunk@25149 -
2013-07-20 15:06:14 +00:00
sergei
8e6d4b41e2
+ MIPS: started the peephole optimizer.
...
git-svn-id: trunk@25148 -
2013-07-20 13:44:21 +00:00
sergei
9494fadf08
* MIPS: set pi_do_call flag for assembler procedures with stackframes, so in PIC mode it further receives pi_needs_got in PIC mode and allocates the GP save temp.
...
* Deallocate GP save temp in epilogue to avoid warnings when compiled with -dEXTDEBUG
* g_concatcopy: don't check alignment, this allows single byte or word locations to be copied with 2 instructions. Larger unaligned references are supposed to be handled in g_concatcopy_unaligned instead.
git-svn-id: trunk@25147 -
2013-07-20 13:42:41 +00:00
sergei
f80ce76a69
+ MIPS: emulate "flags", i.e. support LOC_FLAGS location. This allows to generate differently optimized code for branching and for conversion to register, typically saving a register and instruction per compare.
...
git-svn-id: trunk@25131 -
2013-07-19 14:06:47 +00:00
sergei
9a6edd0fb8
* MIPS: handle restoring GP after calls without GAS macro processing, removes ugly workaround for GAS bug.
...
git-svn-id: trunk@25130 -
2013-07-19 08:04:06 +00:00
nickysn
4b93fa1323
* set all the i8086 calling conventions' volatile registers to be the same as the 'pascal' calling convention; this should make cdecl compatible with 16-bit C compilers
...
git-svn-id: trunk@25128 -
2013-07-18 21:01:41 +00:00
sergei
dffe9cbc55
* Output sizes in map files without truncation and without leading zeros, plus a few more tweaks to make it look more like map files generated by ld. Resolves #24747 .
...
git-svn-id: trunk@25127 -
2013-07-17 14:52:02 +00:00
sergei
8b1463aedc
* tprocdef.customprocname: fixed bug introduced in r21069 that was causing result to always contain 'procedure' or 'function' word. These should be included only if pno_proctypeoption flag is given. Resolves #24640 .
...
git-svn-id: trunk@25126 -
2013-07-17 12:41:55 +00:00
sergei
f49be98507
* MIPS: avoid temp if possible also when converting unsigned 32-bit integers to real.
...
git-svn-id: trunk@25123 -
2013-07-17 11:19:19 +00:00
sergei
c3350d13f9
* MIPS: floating point parameters on stack should be loaded to/from FPU registers directly, without using temp.
...
git-svn-id: trunk@25122 -
2013-07-17 11:00:46 +00:00
nickysn
2a64ba0ad3
* do a 32-bit comparison on far and huge pointers
...
git-svn-id: trunk@25110 -
2013-07-16 07:57:49 +00:00
nickysn
7a0bf4fa54
* the change in r25067 disabled for 16-bit and 8-bit CPUs, because it relies on reg_cgsize, which gives wrong results on archs that use GetNextReg()
...
git-svn-id: trunk@25086 -
2013-07-11 12:28:26 +00:00
sergei
e82ecd66f3
- MIPS: removed target-specific real_to_real conversion, generic code handles it just well.
...
git-svn-id: trunk@25083 -
2013-07-11 08:28:24 +00:00
sergei
ac2006898f
* Mark procedures with shortstring value parameters as non-leaf, because such parameters generate a call (to fpc_shortstr_assign).
...
git-svn-id: trunk@25082 -
2013-07-11 08:21:45 +00:00
sergei
1ca2a253e8
MIPS, improved integer to real conversions:
...
* Use fpc_[int64|qword]_to_double instead of [int64|qword]_to_float64, makes RTL no longer dependent on softfloat code.
* Move 32-bit values from integer registers to FPU registers without using memory.
* Fixed branching, was still using a macro and delay slot was missing.
git-svn-id: trunk@25071 -
2013-07-09 14:17:51 +00:00
svenbarth
6b34c84704
nadd.pas, taddnode.create_internal:
...
* Fix formatting of parameters
git-svn-id: trunk@25070 -
2013-07-09 08:51:49 +00:00
svenbarth
fc79d47b09
Fix for Mantis #24651 . Allow pointer comparison for internal expressions (in this case check for valid VMT).
...
nadd.pas, taddnode:
+ add new constructor "create_internal" which adds "nf_internal" to the node's "flags"
* pass_typecheck_internal: allow pointer comparisons other than "=" and "<>" for nodes which have "nf_internal" set
psub.pas, generate_bodyentry_block:
* create the addnode using "create_internal" instead of "create" to allow the pointer comparison
+ added test
git-svn-id: trunk@25069 -
2013-07-09 08:04:11 +00:00
svenbarth
407e9d173b
Fix for Mantis #17598 . When extended syntax is off allow the result of constructors to be dropped when the constructor is called as an instance method instead of a class method.
...
pstatmnt.pas, statement:
* check whether the constructor is called as an instance or class method
nflw.pas, tlabelnode.pass_1:
* don't check the owner of the labelsym when there is none (happens with internally created labels like for e.g. exception handling)
+ added test
git-svn-id: trunk@25068 -
2013-07-09 07:56:45 +00:00
sergei
f3a1c749fb
* tcgtypeconvnode.second_int_to_int: reuse 8 and 16-bit-sized register locations on targets with 32-bit-only registers when casting to larger size (except ShortInt to Word cast). This is possible because upper bits of such registers are always kept valid by code generators (see 'maybeadjustresult' method in cgcpu.pas). Removes a lot of useless register moves.
...
git-svn-id: trunk@25067 -
2013-07-08 13:27:03 +00:00
sergei
faa778b6c7
* MIPS: div/mod and 32-bit shifts: don't bother reusing argument locations, always allocate new register and emit 3-address instructions.
...
* Fixed possible overwrite of LOC_CREGISTER numerator in optimized division by power of 2.
git-svn-id: trunk@25066 -
2013-07-08 11:51:39 +00:00
sergei
9e4cc57768
* MIPS: handle 8 and 16-bit arithmetic shifts internally, by shifting argument left by 24/16 bits, followed with 32-bit arithmetic shift right by appropriately adjusted amount.
...
This approach should be usable for other non-x86 targets as well.
git-svn-id: trunk@25062 -
2013-07-08 08:45:16 +00:00
florian
58610af9f0
* adapt max_linear_list on x86-64 as well
...
git-svn-id: trunk@25060 -
2013-07-07 20:01:10 +00:00
florian
d0db391d7c
* cleanup of unused units
...
git-svn-id: trunk@25059 -
2013-07-07 20:00:33 +00:00
florian
91138a535a
* default value for max_linear_list on i386
...
git-svn-id: trunk@25058 -
2013-07-07 19:51:25 +00:00
florian
507edb16de
* use add/sub instead of inc/dec on modern CPUs when optimizing for speed
...
git-svn-id: trunk@25057 -
2013-07-07 19:50:13 +00:00
florian
2cdb4adf39
+ tai_const.Create_type_name and tai_const.Create_pint_unaligned
...
* some locations fixed, where dwarf generated assembler for aligned data accidently
git-svn-id: trunk@25054 -
2013-07-07 15:09:36 +00:00
florian
963a488ca2
* handle also LOC_CREGISTER/LOC_CMMREGISTER in tcgvecnode.pass_generate_code, resolves #24705
...
git-svn-id: trunk@25039 -
2013-07-04 19:36:28 +00:00
sergei
59d6df4fca
* MIPS: replaced opcode mapping functions with array, much shorter that way. Separate "overflow" mapping is also no longer needed.
...
* Use SRAV/SRLV/SLLV opcodes for shifts by variable amount.
git-svn-id: trunk@25038 -
2013-07-04 14:26:44 +00:00
sergei
1c84c3edbf
* Fixed label optimizer to work with MIPS, and enabled level 1 optimization for MIPS targets.
...
The difference in branch instruction formats is isolated in function JumpTargetOp, it is a plain function rather than a virtual method, so it can be easily inlined and, after inlining, produces the same code for non-MIPS targets as it was before change.
git-svn-id: trunk@25033 -
2013-07-03 14:40:24 +00:00
sergei
8823574fe2
* MIPS: get rid of DIV and DIVU macros.
...
git-svn-id: trunk@25030 -
2013-07-02 14:28:10 +00:00
sergei
d0ae800da6
+ MIPS: Use INS and EXT instructions for bit manipulations when target CPU type is set to mips32r2.
...
git-svn-id: trunk@25029 -
2013-07-02 14:21:29 +00:00
pierre
eb1ff90de1
Fix jvm compiler compilation failure after rev 25013
...
git-svn-id: trunk@25028 -
2013-07-02 12:52:32 +00:00
sergei
828309e61d
- MIPS: removed opcodes that are not in any known documentation.
...
git-svn-id: trunk@25023 -
2013-07-01 06:09:53 +00:00
florian
6ab95815d8
* try to optimze (p-/+const)^ by putting const into the offset of the generated reference
...
git-svn-id: trunk@25014 -
2013-06-29 22:20:34 +00:00
florian
be2ab84474
* make actualtargetnode a normal procedure using pointers to node so it can be used also when replacing nodes
...
+ replacenode to replace nodes inline
git-svn-id: trunk@25013 -
2013-06-29 22:20:30 +00:00