florian
ac85d44899
* do OpCmp2OpS optimization also if after cmp follows an appropriate mov
...
git-svn-id: trunk@26801 -
2014-02-16 18:39:55 +00:00
florian
150363c09e
* thlcgobj.a_load_regconst_subsetreg_intern takes care if the whole register is modified
...
git-svn-id: trunk@26799 -
2014-02-16 15:13:43 +00:00
florian
07579cf0b7
* cleanup
...
git-svn-id: trunk@26798 -
2014-02-16 13:15:16 +00:00
florian
3dddd01309
* do not location_force_reg in tcgshlshrnode.second_integer if left is already in a register
...
git-svn-id: trunk@26797 -
2014-02-16 13:15:13 +00:00
svenbarth
ddb78fefdc
Add a modeswitch for type helpers as discussed in core on 24th October 2013. It is disabled by default in all modes (afterall type helper support in Delphi started only beginning with XE3)
...
+ globtype.pas: add new modeswitch to modeswitch enum and name array
* ptype.pas & pdecobj.pas: check for new modeswitch instead of modeswitch class
* ppu.pas: increase ppu version as we've added a new modeswitch which requires correctly compiled units
* adjusted tests to enabled the modeswitch when necessary
+ added three new tests that check for correct functionality of modeswitch typehelpers
git-svn-id: trunk@26796 -
2014-02-16 12:58:24 +00:00
sergei
da910d654c
+ SPARC: two more peephole optimizations
...
git-svn-id: trunk@26795 -
2014-02-16 12:29:31 +00:00
florian
cbefdcf887
* patch by Martin Friebe to avoid wrong debugger output, resolves #25584
...
git-svn-id: trunk@26794 -
2014-02-16 10:11:20 +00:00
nickysn
f04acb2db7
* parse the memory model command line options and define the FPC_MM_* macro
...
in the first pass of reading parameters, so that #ifdefs based on the memory
models can be used in fpc.cfg
git-svn-id: trunk@26793 -
2014-02-16 09:59:21 +00:00
florian
1882ab8d5a
* i8086 has no cpu_capabilites
...
git-svn-id: trunk@26791 -
2014-02-16 08:27:29 +00:00
florian
0d6cc46a5e
+ CPU type corei
...
git-svn-id: trunk@26790 -
2014-02-16 08:27:27 +00:00
florian
84f7f5f934
* popcnt has a separate cpuid flag so we should separate it from sse
...
git-svn-id: trunk@26789 -
2014-02-16 08:27:24 +00:00
florian
75a13f7e47
* do not allow VCOMISD/VCOMISS to use a memory location as target
...
git-svn-id: trunk@26774 -
2014-02-14 21:26:51 +00:00
sergei
df6837fa12
* Fixed cloning of varargs parameters in tcallnode.dogetcopy, resolves #23981 .
...
git-svn-id: trunk@26758 -
2014-02-13 01:12:58 +00:00
sergei
ed1555b918
* Moved generation of .ent/.end directives out of generic code generator.
...
* Generation of .ent/.end directives for Alpha is dropped, but that target has more important issues to solve.
git-svn-id: trunk@26757 -
2014-02-12 17:30:48 +00:00
sergei
e1cf19d05d
+ Require -d and -u command line options to have an argument, Mantis #25082 .
...
+ Check that argument of -d and -u is a Pascal identifier, Mantis #17056 .
git-svn-id: trunk@26755 -
2014-02-12 04:44:35 +00:00
sergei
3c5345cb4e
+ Write 'non-executable stack' marker to object files also on FreeBSD (verified for version 9.0 for i386).
...
+ Write correct ABI value into ELF header for FreeBSD.
git-svn-id: trunk@26745 -
2014-02-10 05:46:46 +00:00
sergei
74089039e7
- Don't output 'begin/end asmlist xxx' comments for empty asmlists.
...
git-svn-id: trunk@26744 -
2014-02-09 21:29:20 +00:00
florian
37b34edbc6
* do not reuse registers when calculating addresses in pic mode
...
git-svn-id: trunk@26743 -
2014-02-09 21:12:07 +00:00
sergei
07ce8f46a4
* loadvmtaddrnode accesses global data only when left.nodetype=typen.
...
git-svn-id: trunk@26742 -
2014-02-09 17:44:14 +00:00
florian
25fc10b556
* do not store references to dyn. arrays
...
git-svn-id: trunk@26741 -
2014-02-09 08:41:51 +00:00
florian
3e4198ea45
* take care of dyn. arrays in cse
...
git-svn-id: trunk@26740 -
2014-02-08 21:47:46 +00:00
florian
a8643410c4
* fix trgx86.do_spill_replace for bmi rotating/shifting instructions
...
git-svn-id: trunk@26739 -
2014-02-08 21:38:23 +00:00
florian
be0a29da95
* fix modification information for bmi instructions
...
git-svn-id: trunk@26738 -
2014-02-08 21:38:21 +00:00
florian
9d84b83475
* fix comment
...
git-svn-id: trunk@26737 -
2014-02-08 21:38:18 +00:00
sergei
d7c7ee2c2a
* MIPS: fixed 8/16 bit arithmetic shifting to be done without using an additional register.
...
git-svn-id: trunk@26736 -
2014-02-08 21:13:58 +00:00
sergei
d29300df13
* tMIPSELnotnode.second_boolean: reuse common handle_locjump method.
...
git-svn-id: trunk@26735 -
2014-02-08 21:10:01 +00:00
yury
e0c8a4701e
* Fixed compilation for mips-linux.
...
git-svn-id: trunk@26732 -
2014-02-08 19:08:21 +00:00
florian
e5aa0e4316
* set pi_uses_exceptions flag only if the try...finally frame is not an implicit frame
...
git-svn-id: trunk@26731 -
2014-02-08 16:43:23 +00:00
florian
1df293679d
* fixed setting of pi_uses_exception flags and unified usage, they should be set in pass_1
...
git-svn-id: trunk@26729 -
2014-02-08 14:59:07 +00:00
florian
53ddaf03ff
* fixes masking error in tx8664shlshrnode.pass_generate_code
...
* cleaned up tx8664shlshrnode.pass_generate_code and fix register loading of the right node, resolves #25664
git-svn-id: trunk@26716 -
2014-02-08 10:15:47 +00:00
florian
1366498255
+ nf_addr_taken: it marks nodes which address is taken
...
+ check if tnodeflags is 4 bytes or less
* do not do cse on expressions which address is taken
git-svn-id: trunk@26713 -
2014-02-07 20:40:42 +00:00
yury
c58340f8dd
* Enabled safecall for mips.
...
git-svn-id: trunk@26709 -
2014-02-07 14:12:33 +00:00
yury
73c26bd6be
* mipsel-android: Regenerated makefiles. From now the mipsel-android target can be built and used.
...
git-svn-id: trunk@26705 -
2014-02-07 12:37:17 +00:00
masta
2d2cab0e7a
Fix some internalerror codes in the ARM CG
...
git-svn-id: trunk@26701 -
2014-02-07 12:15:08 +00:00
florian
30352c7f7b
* fix several issues with loop strength reduction to make it working
...
* debugging code for strength reduction
git-svn-id: trunk@26694 -
2014-02-06 20:48:19 +00:00
florian
c5523fc780
* do not search a node tree which has been found being subject to cse further on
...
git-svn-id: trunk@26691 -
2014-02-06 19:27:11 +00:00
yury
bb269e53ac
* mipsel-android: Don't export local symbols from executable.
...
git-svn-id: trunk@26690 -
2014-02-06 19:11:08 +00:00
yury
56b3287e29
+ Added compiler support for mipsel-android target.
...
git-svn-id: trunk@26686 -
2014-02-06 17:02:43 +00:00
sergei
52af9a2c89
* Changed passing of hidden parameters to constructors of class-style objects: VMT is always passed in the first ('self') parameter, and the second one ('vmt', although this name is now misleading) contains flag specifying the constructor behavior and meaning of 'self'. Together with r26656 this removes methodpointer sharing between two parameter node trees, it becomes possible not to put methodpointer into temp, but use node tree below 'self' parameter to do virtual calls. This also matches behavior of Delphi.
...
git-svn-id: trunk@26683 -
2014-02-06 12:26:47 +00:00
florian
829764e96b
+ replace registers to spill in mov instructions and convert them into ldr/str
...
git-svn-id: trunk@26677 -
2014-02-05 18:19:41 +00:00
sergei
a1dfaa54dd
* Fixed exception handling in constructors of TP-style objects to correctly handle cases of statically allocated objects (must call destructor but do not free memory) and objects without destructor (must free memory if it was allocated dynamically).
...
+ Test extended.
git-svn-id: trunk@26676 -
2014-02-05 18:19:13 +00:00
Jonas Maebe
a1eb9a0f99
* fixed spilling of CMOVcc instruction: it "reads" operand two (in the sense
...
that the value of operand two is used/kept in case the condition is false)
(fixes mantis #25672 )
git-svn-id: trunk@26674 -
2014-02-05 00:27:21 +00:00
Jonas Maebe
ba5297be37
* support disabling the i386 peephole optimizer with -Oonopeephole
...
git-svn-id: trunk@26673 -
2014-02-05 00:27:16 +00:00
florian
9e4c130bc4
* do not allocate unnecessarily an extra pair of registers when multiplying int64s on arm
...
git-svn-id: trunk@26672 -
2014-02-04 22:02:51 +00:00
Jeppe Johansen
6861cbcf16
Allow FoldShiftLdrStr for all sizes of LDR/STR, and disable it for references that post/pre increment the base register on Thumb-2 targets.
...
git-svn-id: trunk@26671 -
2014-02-04 17:29:13 +00:00
masta
a72a3f4e01
Little cleanup after r26669, no functional changes
...
git-svn-id: trunk@26670 -
2014-02-04 08:04:08 +00:00
masta
80d2ee8ad0
Don't reuse registers on ARM 64 bits shift
...
git-svn-id: trunk@26669 -
2014-02-03 23:47:28 +00:00
sergei
9c1f917e3a
* a_call_ref functionality cannot be implemented efficiently at code generator level, because references need specific preparations at earlier points. Moved this support to tcgcallnode and its x86 descendants, and got rid of all ifdef's around.
...
+ x86 targets now directly call procedure variables located in references.
- a_call_ref method removed from tcg and thlcgobj.
git-svn-id: trunk@26666 -
2014-02-03 13:28:56 +00:00
sergei
0d3f36eebf
- Remove references to global variable 'cg' from methods of tcg and some of its descendants.
...
git-svn-id: trunk@26665 -
2014-02-03 12:27:48 +00:00
sergei
7104157a57
* Changed tabstractprocdef.address_size to return the def, which can be used to get other properties like size and alignment. Removes one of i8086 ifdef's.
...
git-svn-id: trunk@26664 -
2014-02-03 10:47:54 +00:00
sergei
53556f529d
* gen_alloc_symtable: don't use current_procinfo.procdef, the necessary procdef is passed in 'pd' parameter.
...
git-svn-id: trunk@26663 -
2014-02-03 10:21:56 +00:00
sergei
949907f1f3
* Don't emit "Temps allocated between..." comment in assembler listing if procedure has no temps.
...
git-svn-id: trunk@26660 -
2014-02-03 09:55:46 +00:00
sergei
e0082262cc
* Don't generate VMT checking code twice (gen_load_vmt_register generates it already).
...
git-svn-id: trunk@26657 -
2014-02-03 00:27:05 +00:00
sergei
a5d5ce8eb2
* TP-style object destructors do not need actual VMT in hidden parameter, a constant flag indicating need to free memory is sufficient.
...
* Destructor called from exception block in constructor must have this flag set in order to free memory.
+ Test.
git-svn-id: trunk@26656 -
2014-02-03 00:20:42 +00:00
Jonas Maebe
868b4f50e9
* use spilling_operation_type() instead of a big table to determine whether
...
instructions overwrite operand 0 (fixes wrongly handled rlwimi and some
others, and also adds support for loads/stores)
git-svn-id: trunk@26653 -
2014-02-02 15:32:54 +00:00
Jonas Maebe
de0ced1522
* A_INSLWI, A_INSLWI_, A_INSRWI, A_INSRWI_ also modify operand 0
...
git-svn-id: trunk@26652 -
2014-02-02 15:32:00 +00:00
Jonas Maebe
6a4afd3a33
* changed uses of "exit" in constructors to if/then constructs, to
...
avoid the constructor result/SSA bug in 2.6.x
git-svn-id: trunk@26651 -
2014-02-02 09:09:51 +00:00
Jonas Maebe
4e9c54278e
* the function result of constructors always is self, always is valid and is
...
not stored in procdef.funcretsym -> fix check so that SSA is not performed
on it in constructors when exit is used
git-svn-id: trunk@26650 -
2014-02-02 09:09:44 +00:00
florian
e6b68d19c8
* reordered decision how arguments for inlining are handled
...
* improved comments for inline argument handling
* replace arguments more aggressively with a copy of their original node tree when inlining
git-svn-id: trunk@26649 -
2014-02-01 22:26:23 +00:00
Jeppe Johansen
07b2982e77
Don't do ARM FoldShiftLdrStr peephole optimization if there's an offset in the reference.
...
Use UXTH+UXTB instructions instead of two shifts on processors that supports that.
Eliminate internalerror when constant pointers are typecast as arrays.
git-svn-id: trunk@26647 -
2014-02-01 13:29:35 +00:00
florian
2a7dcf6c7b
* formatting
...
git-svn-id: trunk@26646 -
2014-02-01 13:08:30 +00:00
florian
e3f9982ee1
* make_not_regable is a matter of code generation so do it in pass_1
...
git-svn-id: trunk@26645 -
2014-02-01 13:08:28 +00:00
florian
fbcfb63826
+ implement tcasenode.pass_typecheck
...
git-svn-id: trunk@26644 -
2014-02-01 13:08:26 +00:00
florian
d71bfe4c6f
* var parameters can be put in registers if the callee is inlined
...
git-svn-id: trunk@26643 -
2014-02-01 13:08:24 +00:00
florian
cd6f4d4469
* fix tsubscriptnode to handle left.location being an fpu or mm register as well.
...
git-svn-id: trunk@26642 -
2014-02-01 13:08:21 +00:00
masta
81517fdf70
Rerun peephole optimizers on the whole block
...
Up until now if a peephole optimizer matched we've only restarted from
the current instruction. This patch restarts optimizations on the whole
block if the previous run had at least one match.
As this can take considerable time this will only be enabled if -O3 or
higher is specified.
git-svn-id: trunk@26640 -
2014-01-31 23:21:52 +00:00
masta
3f8549365a
Don't schedule LDRD on ARM
...
The load scheduler does not handle LDRD correctly right now, but it does
not prevent A_LDR with PF_D set from beeing scheduled.
git-svn-id: trunk@26637 -
2014-01-30 21:53:03 +00:00
florian
28a8dc42c6
* fix tcgx86.a_op_reg_reg on x86-64 and make use of it
...
git-svn-id: trunk@26636 -
2014-01-30 20:24:41 +00:00
florian
7d7bf1d877
+ make use of SHLX/SHRX on CPUs supporting BMI2
...
git-svn-id: trunk@26635 -
2014-01-30 20:24:39 +00:00
florian
8fba876904
* apply cse to static symbols on x86-64 as well, if their address can be stored
...
git-svn-id: trunk@26634 -
2014-01-30 20:24:36 +00:00
florian
d8c0f11ff9
+ cs_userbp optimizer switch, so on x86-64 the compiler can make use of rbp if it is not needed as frame pointer
...
git-svn-id: trunk@26633 -
2014-01-30 19:44:17 +00:00
florian
a3f58e84be
* rbp can be used for normal purpose under certain conditions so it shouldn't interfere with all other registers
...
git-svn-id: trunk@26632 -
2014-01-30 19:44:14 +00:00
florian
546f4a5d46
* force records with LOC_CONSTANT into memory when they are subscripted
...
git-svn-id: trunk@26630 -
2014-01-30 19:44:09 +00:00
florian
1d73f49330
* do not force the index location to a register for vec. nodes if the index is already in a register
...
git-svn-id: trunk@26629 -
2014-01-30 17:34:35 +00:00
florian
cd235d8409
+ simplify shl/shr x, if (x mod bitsizeof(left))=0
...
git-svn-id: trunk@26628 -
2014-01-30 17:34:33 +00:00
florian
b1f54b2853
* indentation fixed
...
git-svn-id: trunk@26627 -
2014-01-30 17:34:31 +00:00
florian
8989a40b4f
* more flags to mark changes fixed
...
git-svn-id: trunk@26626 -
2014-01-30 17:34:28 +00:00
florian
809549a31f
* addr nodes can be also considered in cse
...
git-svn-id: trunk@26625 -
2014-01-30 17:19:06 +00:00
florian
3a11dd1055
* create the addr node for cse with create_internal to avoid errors when taking the address of a temp.
...
git-svn-id: trunk@26624 -
2014-01-30 17:19:04 +00:00
florian
fc7dc9e54c
* do cse after the init/final code has been inserted, this might enable new cse opportunities
...
git-svn-id: trunk@26623 -
2014-01-30 17:19:01 +00:00
Jeppe Johansen
257b1affaa
Fixed previous fix of LsrAnd2Lsr optimization.
...
Added an extra condition for <ARMv6 processors in MLA/MLS optimization.
git-svn-id: trunk@26620 -
2014-01-29 22:22:58 +00:00
Jeppe Johansen
f773334374
Fixed LsrAnd2Lsr peephole optimization for ARM.
...
git-svn-id: trunk@26619 -
2014-01-29 21:35:28 +00:00
Jonas Maebe
859676d7d3
* fixed r26519 for darwin/x86-64, see comments (mantis #25644 )
...
git-svn-id: trunk@26618 -
2014-01-29 21:26:45 +00:00
Jonas Maebe
c05da62b0e
* detect static data use by record methods and methods of nested classes/
...
records, so we avoid inlining them (mantis #25598 )
git-svn-id: trunk@26617 -
2014-01-29 21:26:38 +00:00
Jonas Maebe
b611882337
* some minor formatting fixes
...
git-svn-id: trunk@26616 -
2014-01-29 19:26:17 +00:00
Jonas Maebe
a6d28b5630
* pass on the "eval" state (whether or not subexpressions should be evaluated)
...
when encountering a "(" in a preprocessor expression (broken after r25465,
mantis #25296 )
git-svn-id: trunk@26615 -
2014-01-29 19:26:12 +00:00
Jonas Maebe
2f741121e9
* don't give an internal error when freeing an error token in the preprocessor
...
(mantis #25573 )
git-svn-id: trunk@26614 -
2014-01-29 19:26:03 +00:00
Jeppe Johansen
3b4f59c316
Fixed MLA/MLS peephole optimization and moved it to the generic ARM peephole optimizer.
...
git-svn-id: trunk@26613 -
2014-01-29 17:28:13 +00:00
Jeppe Johansen
184baa3f99
Fixed invalid peephole optimization of ADD/SUB(SP) instructions for ARMv7*M targets.
...
git-svn-id: trunk@26612 -
2014-01-29 17:12:57 +00:00
Jonas Maebe
2adfb6cdda
* don't endlessly recurse when printing the typename of a procvardef that
...
refers to itself via a pointerdef in its parameter or result type(s)
(mantis #25551 )
git-svn-id: trunk@26610 -
2014-01-28 20:14:31 +00:00
Jonas Maebe
6d5bef3e1d
* removed code duplication in tpointerdef.GetTypeName
...
git-svn-id: trunk@26609 -
2014-01-28 20:14:28 +00:00
Jonas Maebe
89d97a3c2e
* only consider tc_pointer_to_array typeconversions to determine whether a
...
pointer->array type conversion implies an implicit dereference operation
(mantis #25622 )
git-svn-id: trunk@26608 -
2014-01-28 20:14:24 +00:00
Jonas Maebe
9c4505045b
* fixed formatting
...
git-svn-id: trunk@26607 -
2014-01-28 20:14:10 +00:00
masta
9e0af11ad8
Rerun the peephole optimizer after removing the current instruction.
...
This lets the optimizer pickup on more possible optimizations.
git-svn-id: trunk@26606 -
2014-01-28 16:00:51 +00:00
masta
57ff589ec7
Always set p to the next instruction after removing p from asml.
...
Some time ago we introduced GetNextInstructionUsingReg, which might
return an instruction a couple of instructions away from our current
location. Most of the code then just returned the new instruction (hp1)
instead of the instruction following p. This could prevent the peephole
optimizer from finding possible optimizations.
git-svn-id: trunk@26605 -
2014-01-28 16:00:47 +00:00
masta
c644503daf
Add MovLdr2Ldr peephole optimizer for ARM
...
The existing LdrLdr2LdrMov optimizer will generate a lot of
sequences like this:
ldr regA, [...]
mov regB, regA
ldr regB, [regB, ...]
this now gets changed to
ldr regA, [...]
ldr regB, [regA, ...]
this saves an instruction and might open up more possibilities for the load scheduler.
git-svn-id: trunk@26603 -
2014-01-28 13:20:35 +00:00
masta
77d12f61a2
Handle LDRD and STRD correctly in RegInInstruction for ARM
...
LDRD and STRD only have the first even numbered register in their instruction operands,
this additional code will also check for the register following it.
Example:
ldrd r0, [r13]
The old code will only detect r0 as in use, not the implicit r1.
git-svn-id: trunk@26602 -
2014-01-28 13:20:26 +00:00
pierre
754790f641
Use new static library not supproted message
...
git-svn-id: trunk@26598 -
2014-01-27 22:29:07 +00:00
pierre
6feab20b01
regenerated after: Add different message for static libraary not supported
...
git-svn-id: trunk@26597 -
2014-01-27 22:28:29 +00:00
pierre
b4d0cf5593
* Add different message for static libraary not supported
...
git-svn-id: trunk@26596 -
2014-01-27 22:26:29 +00:00