Commit Graph

37921 Commits

Author SHA1 Message Date
masta
51af7bd440 Assembly version of fpc_ansistr_incr_ref for ARM
Optimized to minimize load latency and icache usage. Together with the
previous fpc_ansistr_decr_ref optimization this little test programm
runs about 40% faster.

  program stringspeed;

  procedure test(s:string);
  begin
  end;

  var
    s:string;
    i: cardinal;
  begin
    s:='abcd';
    for i:=0 to $FFFFFF do
      test(s);
  end.

Even with s:='' it's about 30% faster.

git-svn-id: trunk@22035 -
2012-08-08 15:29:26 +00:00
masta
b9770519f8 Assembly version of fpc_ansistr_decr_ref for ARM
As fpc_ansistr_decr_ref is a very often called procedure in typical
pascal programs this optimized version will shave off some cycles
compared to the generic one.

It tries to avoid load latencies as much as possible and also uses the
new Z-flag functionality of the InterlockedDecrement from the previous
patch. Also FreeMem is called as a tail-function.

git-svn-id: trunk@22034 -
2012-08-08 06:44:31 +00:00
masta
25e2f5f3fa Small improvement to InterlockedExchange on ARM
Use movs instead of mov when setting the result in r0. This way the Z
flag will be set for the calling function which might allow some smaller
optimizations later on. It does not affect current code in any way,
because flags are not expected to be used across function calls.

git-svn-id: trunk@22033 -
2012-08-08 06:44:26 +00:00
masta
aa21845cd9 Small optimization for OP_AND on ARM
Especially with 64bit operators the CG sometimes generates:
and r0, r1, #0
Which just clears r0 and is equivalent with
mov r0, #0

git-svn-id: trunk@22032 -
2012-08-08 06:44:20 +00:00
michael
8ed3408527 * with statement tests
git-svn-id: trunk@22031 -
2012-08-07 21:16:19 +00:00
michael
874a1f4304 * Use expressions in with statement
git-svn-id: trunk@22030 -
2012-08-07 21:16:01 +00:00
michael
5a57943320 * Tests for loop structures
git-svn-id: trunk@22029 -
2012-08-07 20:58:03 +00:00
michael
e1dead6a1c Conditions in for/while/repeat are now expression elements
git-svn-id: trunk@22028 -
2012-08-07 20:57:35 +00:00
florian
7513291ad8 * generate different code for OS_S8 -> OS_16 conversion which might fold better, idea by Nico Erfurth
git-svn-id: trunk@22027 -
2012-08-07 19:36:46 +00:00
Jonas Maebe
4d31fbc31d * also allow conversion of niln to forward-defined pointerdef
(mantis #22593)

git-svn-id: trunk@22026 -
2012-08-07 11:23:00 +00:00
Jonas Maebe
a63a603cc1 * allow conversion from niln to not-yet-fully-resolved classrefdefs
(mantis #22593)

git-svn-id: trunk@22025 -
2012-08-07 09:56:08 +00:00
masta
6529307d9e Don't emit useless AND/BICs in ARM CG
In certain cases the CG would emit something like
bic r1, r0, #0
As BIC is clearing the specified bits this is equivalent to
mov r1, r0
This patch changes the CG to emit the mov instead which the register
allocator will hopefully remove most of the time.

git-svn-id: trunk@22024 -
2012-08-07 06:46:45 +00:00
masta
9e039936bf Support more operators in FoldShiftProcess on ARM
Now we can also fold shifts into teq, tst, cmp, cmn instructions.

git-svn-id: trunk@22023 -
2012-08-07 06:46:32 +00:00
florian
b20c4cfe87 * replace is_written by using actualtargetnode
git-svn-id: trunk@22022 -
2012-08-06 20:26:23 +00:00
Jonas Maebe
aad3ce960a * give an error when trying to give a parameter of a non-simple type a
default value (mantis #22343)
  * give an error when specifying an invalid default value (e.g. a
    floating point number for a longint parameter)

git-svn-id: trunk@22021 -
2012-08-06 20:13:20 +00:00
Jonas Maebe
ebda98deec * give (w)string tconstsyms a def, so all constsyms always have a def
git-svn-id: trunk@22020 -
2012-08-06 20:13:15 +00:00
Jonas Maebe
be2c757aad * don't crash in getarraydef/getpointerdef if localsymtable is still nil
git-svn-id: trunk@22019 -
2012-08-06 20:13:11 +00:00
Jonas Maebe
c25d9d5e06 * do not search for overloaded operators while parsing constant declarations,
since they require function calls and it's not possible to call functions
    inside constant blocks (and because current_procinfo is not necessarily
    valid when a constant block is parsed, this moreover crashes the compiler)

git-svn-id: trunk@22018 -
2012-08-06 20:13:06 +00:00
florian
405a80066e + cse across assignment operator fixed and enabled
git-svn-id: trunk@22017 -
2012-08-05 20:37:18 +00:00
florian
f619a1aaf6 * fld/fst can have a base register+offset
git-svn-id: trunk@22016 -
2012-08-05 18:34:13 +00:00
florian
df01717c38 * mov x, %treg; mov %treg, y might be only optimized if y does not use treg
git-svn-id: trunk@22015 -
2012-08-05 17:48:28 +00:00
Jonas Maebe
3c1b82f9a0 * don't add value transformations for internal type casts from/to currency
(mantis #22561)

git-svn-id: trunk@22014 -
2012-08-05 15:36:44 +00:00
florian
e81ba0f82e + make use of the armv6+ sign/zero extension instructions if appropriate
git-svn-id: trunk@22013 -
2012-08-05 14:04:11 +00:00
florian
eb1efdff8a + introduce cstylearrayofconst because pocall_mwcall was forgotten at several places
git-svn-id: trunk@22012 -
2012-08-05 08:48:23 +00:00
florian
ad3aa937d3 * respect Dontlinkstdlibpath when adding a default library search path
git-svn-id: trunk@22011 -
2012-08-04 17:29:07 +00:00
florian
19ed835f2b * don't generate an extra indirection when loading vfp constants
git-svn-id: trunk@22010 -
2012-08-04 17:01:57 +00:00
masta
8a684c1f10 Don't generate IT instruction in second_cmp64bit for Thumb-2
Currently the register spiller can not handle the "bond" between IT* and
a following instruction, sometimes breaking them apart, which breaks the
build or worse the result.

So for now we're not emitting A_IT* in second_cmp64bit anymore but use a
conditional jump instead.

This fixes Mantis #22520

git-svn-id: trunk@22009 -
2012-08-04 16:55:58 +00:00
florian
49b03ea350 * readme updated
git-svn-id: trunk@22008 -
2012-08-04 09:50:13 +00:00
florian
89980e21f3 + binary objects for armhf
git-svn-id: trunk@22007 -
2012-08-04 09:47:37 +00:00
michael
2889f22b40 * IF condition expression is now a real expression, not a string
git-svn-id: trunk@22006 -
2012-08-04 09:16:54 +00:00
michael
b867010691 * Test cases for types, var, const, resource string. Start of statement tests
git-svn-id: trunk@22005 -
2012-08-04 08:48:23 +00:00
florian
2b6fc9b1ee + at least raspian has no soft links in /usr/lib to crt*.o, so add their location to the search path
git-svn-id: trunk@22004 -
2012-08-04 08:16:02 +00:00
masta
e4a719fcff Fix ARM SwapEndian on armv6+ for compilation with FPC 2.6
We're currently using rev for armv6+, but FPC 2.6 could not handle the
instruction. So if somebody wants to build trunk it can't be for armv6+.

We'll circumvent the problem by always using the the generic code when
build with FPC 2.6.

git-svn-id: trunk@22003 -
2012-08-03 22:38:07 +00:00
florian
291157330e * fix setjump for arm<=armv5 with vfp
git-svn-id: trunk@22002 -
2012-08-03 22:04:22 +00:00
marco
f52c55ea59 * fixed a copy and paste typo as indicated by Ocean Mantis #22559
git-svn-id: trunk@22001 -
2012-08-03 12:24:11 +00:00
marco
666fecb6df * workaround for unsupported construct in fpdoc. (enum declared nested in class)
git-svn-id: trunk@21999 -
2012-08-02 13:01:27 +00:00
sergei
c1e7e9c85e * TObjData.symbolref: don't lose the weak binding of asm symbol. This fixes tests/tweaklib*.pp at least for Linux x86 targets with internal assembler.
* Enabled weak linking for Linux targets.

git-svn-id: trunk@21998 -
2012-08-02 12:15:55 +00:00
masta
1c51b8d906 Disable 64bit shifts for thumb2 - Fix for Mantis #22520
In r21686 I've introduced optimized 64bit shifts for ARM. But the
methods did not check for which machine it has to generate the code.

This patch disables the optimized code for now if the target is in
cpu_thumb2 and falls back to the generic code.

There are 2 problems with the current code:

1.) Thumb-2 does not support shift by register on all data instruction
as ARM does.
2.) The code does not generate the required IT-block for the conditional
executed code.

git-svn-id: trunk@21997 -
2012-08-02 00:56:21 +00:00
masta
c16871e129 Generate better code in Tthumb2cgarm.g_flags2reg
The old code generated a strange IT-sequence:

IT EQ
MOVEQ r0, #1
IT NE
MOVNE r0, #1

Now we generate:

ITE EQ
MOVEQ r0, #1
MOVNE r0, #1

IT stands for IfThen, ITE for IfThenElse it has a couple of other forms
where the instruction gets extended to handle more of the following
instructions. So we have ITEE, ITETE etc, up to 4 instructions can be
handled.

git-svn-id: trunk@21996 -
2012-08-02 00:56:15 +00:00
masta
2e0203b7a2 Improved Move implementation on ARM
This adds some small improvements to Move_pld and Move_blended.

1.) Overlapping memory is handled as "unusual" and the code is placed at
the end of the function for better icache/bpu performance
2.) Fused the overlap check into 3 instructions with a single jump
instead of 5 instructions with 2 jumps.
2.) Use ldmia/stmia with 2 registers instead of ldr/str for faster
copying.
3.) Some code cleanup

git-svn-id: trunk@21992 -
2012-08-01 11:15:20 +00:00
mazen
f6deb01295 * Removed error thrown when trying to build help index if the documentation is installed on a read only file system and tries to store the index file in current directory. (Closes Debian bug#662814)
git-svn-id: trunk@21990 -
2012-07-31 10:37:03 +00:00
sergei
944189f046 - don't supply sh_link and sh_info members to TElfObjSection.create_ext.
+ Dedicated constructor TElfObjSection.create_reloc for relocation sections.
+ pass symbol name offset separately to TElfSymtab.writeSymbol, this is necessary for two-pass writing of dynamic symbol tables.

git-svn-id: trunk@21989 -
2012-07-31 07:44:10 +00:00
sergei
d4b7a6a9bd + Added some more ELF definitions
* Factored telfreloc.info calculation into separate function

git-svn-id: trunk@21988 -
2012-07-31 07:11:10 +00:00
paul
1af45d7ec0 rtl: don't perform unneeded string conversions if string codepage matches codepage to convert (thanks to Sergey)
git-svn-id: trunk@21987 -
2012-07-31 01:24:36 +00:00
florian
562a45f2e1 * try to transform the tree to be able to do better cse
git-svn-id: trunk@21986 -
2012-07-29 21:29:07 +00:00
florian
a27cc3e5f2 + be able to handle CSE's of records/arrays/objects
* consider static array/records/object variables during CSE determination on non x86 CPUs

git-svn-id: trunk@21985 -
2012-07-29 17:17:12 +00:00
florian
89ec13deeb * improved complexity estimation for subscript nodes
git-svn-id: trunk@21984 -
2012-07-29 17:12:54 +00:00
svenbarth
360592d1f4 Some corrections after the loosening of operator overloads:
* check "A op B" and "B op A" again for operators that can be commutative (all binary ones except shl, shr, div, mod, **, / and -)
* also check for Nil for classrefdefs if left side is a pointer (allows "TClass var" <>/= Nil again, after the above changes)
* don't allow overloads for "implicit pointer type <>/= pointer" and the other way around (this fixes non compiling Objective Pascal test tobjc21.pp and also the new toperator87.pp test)
* some formating corrections

+ added test for "TObject <> Pointer"
+ added test for "TClass <>/= Nil"

git-svn-id: trunk@21983 -
2012-07-29 12:38:09 +00:00
florian
df83d96559 + patch by CA Gorski adding missing 'kernel32' strings
git-svn-id: trunk@21982 -
2012-07-29 10:34:03 +00:00
florian
023d632f44 * optimize also lsr/asr, lsl, lsr/asr sequences on arm
git-svn-id: trunk@21981 -
2012-07-28 22:30:11 +00:00