florian
53ea4fb7d4
* unify x86 peephole optimizer helpers
...
git-svn-id: trunk@31843 -
2015-09-27 09:36:39 +00:00
svenbarth
529677cc79
ncal.pas:
...
* extend tcallnode with the ability to pass a tspecializationcontext so that tcallcandidates can do a final specialization
* the final procdef is registered at the end of tcallnode.pass_typecheck
git-svn-id: trunk@31763 -
2015-09-18 14:48:54 +00:00
Jonas Maebe
3c6aa91a96
* factored out the loading of threadvars in its own method, and put the
...
x86-specific part in nx86ld
git-svn-id: trunk@31639 -
2015-09-12 23:32:53 +00:00
sergei
e542800ea9
* Win64 SEH: Track control flow out of unwind-protected regions in a more precise way and don't generate expensive calls to __fpc_local_unwind when not necessary.
...
git-svn-id: trunk@31582 -
2015-09-09 18:43:46 +00:00
Jeppe Johansen
3cb9be73bc
Moved tcontrollerdatatype out into cpuinfo.
...
Added cputype and fputype info to tcontrollerdatatype arrays.
git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
Jonas Maebe
0fc1fd6ac1
* replaced current_procinfo.currtrue/falselabel with storing the true/false
...
labels of LOC_JUMP in the node's location. This generates some extra jumps
for short circuit boolean and/or-expressions if optimizations are off, but
with optimisations enabled the generated code is the same (except for JVM
because the jump threading optimisation isn't enabled there yet).
git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +00:00
Jonas Maebe
f402b0d7df
* changed getpointerdef() into a tpointerdef.getreusable() class method
...
o allows removing the ugly x86 hacks
git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
956883b0c7
* pass dyn. arrays in registers when i386 register calling conventions are used
...
git-svn-id: trunk@30870 -
2015-05-16 20:27:09 +00:00
Jonas Maebe
a04cae2c4b
- removed partial Alpha, IA64 and vis backends since they were never nor
...
will likely ever be finished
git-svn-id: trunk@30836 -
2015-05-09 17:25:11 +00:00
Jonas Maebe
1b43930749
- removed long deprecated/buggy assembler cse optimiser for i386
...
o bumped ppu version because optimiser settings can be embedded in generic
token streams
git-svn-id: trunk@30835 -
2015-05-09 17:25:07 +00:00
florian
9f587625e7
+ handle not and neg in isFoldableArithOp as well
...
git-svn-id: trunk@30767 -
2015-05-02 17:20:20 +00:00
florian
7dd1d6aa77
o fixes handling of iso i/o parameters/program parameters:
...
* explicit reset is needed
* variable must be declared again
git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
Jonas Maebe
bd203a5b57
* synchronised with trunk till r30240
...
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
3d9713b9c8
* has_single_field() now looks recursively into fields that are aggregate
...
types until it finds a non-aggregate type, and then returns "true" if
that aggregate (record or array) contains one element
* it now also returns the type of that element directly rather than a
tfieldvarsym, since we only care about the type and in case of an array
there is no field
git-svn-id: trunk@30205 -
2015-03-14 18:35:53 +00:00
Jeppe Johansen
914e9e7b49
Merged from trunk
...
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
Jonas Maebe
67b8aceaee
* synchronized with privatetrunk till r30095
...
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
florian
99635658ec
* corrects change flags for VSQRTSD
...
git-svn-id: trunk@30037 -
2015-02-28 22:42:25 +00:00
florian
de17e9fa1c
+ cpu capability CPUX86_HAS_CMOV
...
git-svn-id: trunk@29776 -
2015-02-21 20:47:40 +00:00
florian
d6e4af8279
+ applied remaining patches of Torsten Grundke: adds gather instructions of avx2
...
git-svn-id: trunk@29745 -
2015-02-17 21:43:46 +00:00
Jeppe Johansen
47dbec3111
Rebase to trunk revision
...
git-svn-id: branches/laksen/armiw@29708 -
2015-02-15 16:08:18 +00:00
Tomas Hajny
cfd4252ec3
* EMX should be treated the same way as OS/2 with regard to cdecl (the same C compiler is used)
...
git-svn-id: trunk@29660 -
2015-02-09 22:52:06 +00:00
florian
06fd4223e9
+ optimization setting level4
...
+ change tail calls into jmp if a ret without constant follows
git-svn-id: trunk@29653 -
2015-02-08 11:24:30 +00:00
florian
35a04ad095
* modified patch of Paul W to replace leave by mov/pop, resolves #26455
...
git-svn-id: trunk@29633 -
2015-02-05 20:51:12 +00:00
pierre
56f53176e7
Add freebsd, openbsd and OS2 to the list of i386 targets handling records with only one float as normal float
...
git-svn-id: trunk@29570 -
2015-01-27 22:52:00 +00:00
sergei
ed4e876f4f
* Generate exception filters data on i386-win32 and x86_64-win64 without using global labels.
...
git-svn-id: trunk@29512 -
2015-01-20 13:52:19 +00:00
Jeppe Johansen
901275b4a1
Switch back to emitting BLX instructions and fix calculation of constant offsets(should rarely/never happen).
...
Add missing fields to other elf targets.
git-svn-id: branches/laksen/armiw@29286 -
2014-12-14 16:28:35 +00:00
florian
5c67fcc43f
+ change always floating point divisions into multiplications if they are a power of two,
...
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications
git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744
* boolean constant instead of IFDEFs for detection of microcontroller support
...
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
Jonas Maebe
8244d366d0
- moved deallocation of NR_PIC_OFFSET_REG from the x86_64 to the i386 code
...
generator (as it's also allocated for i386 rather than for x86_64)
git-svn-id: trunk@28928 -
2014-10-25 17:47:44 +00:00
Tomas Hajny
09e0734b7c
* fix working with short record function results under OS/2
...
git-svn-id: trunk@28885 -
2014-10-20 15:40:17 +00:00
pierre
aa6b62cf4c
Add new procedure option: po_syscall_has_libsym,
...
include this option only of libsym field
is non NIL.
Use this option to only write redef of libsym if needed.
Adapt ppudump source to this new procedure option.
git-svn-id: trunk@28732 -
2014-10-03 19:26:16 +00:00
sergei
5479b6e722
* Provide initialization of all variables, fixes cycling with OPT="-dTEST_WIN32_SEH -OoDFA".
...
git-svn-id: trunk@28622 -
2014-09-08 18:08:12 +00:00
Károly Balogh
07ad2a04ac
* fix warnings when compiling the compiler with DFA optimizer enabled on i386
...
git-svn-id: trunk@28497 -
2014-08-20 12:28:44 +00:00
Jonas Maebe
b18ba8e85b
* syncrhonised with trunk up till r28471
...
git-svn-id: branches/hlcgllvm@28495 -
2014-08-19 20:23:11 +00:00
Jonas Maebe
b745dcc64c
* moved g_external_wrapper() to the hlcg, and also g_intf_wrapper() because
...
for some platforms it depends on that routine
git-svn-id: branches/hlcgllvm@28492 -
2014-08-19 20:22:54 +00:00
Jonas Maebe
a637fbe596
* moved all g_exception_*() methods to hlcgobj and cleaned them up (no more
...
hardcoded registers for the most part)
+ added extra g_exception_discard_reason() that can be called when we only
want to get rid of the currently pushed exception reason, and don't have
to load it (so it can do nothing on platforms that don't use push/pop)
git-svn-id: branches/hlcgllvm@28481 -
2014-08-19 20:22:24 +00:00
Károly Balogh
4ee15b84da
AROS: syscall (library call) support for based on the Amiga/68k and MorphOS/PPC versions
...
git-svn-id: trunk@28463 -
2014-08-19 00:39:18 +00:00
Károly Balogh
74581a07af
AROS: assembler fixes
...
git-svn-id: trunk@28439 -
2014-08-18 11:25:55 +00:00
Károly Balogh
4431ba2c08
merged/updated AROS/i386 target to trunk from AROS branch, to support Marcus Sackrow's work on AROS support which will hopefully benefit all Amiga-like targets (classic, MorphOS) on the long run. Compiler only, RTL comes in the next run.
...
git-svn-id: trunk@28432 -
2014-08-17 18:18:07 +00:00
Jonas Maebe
5c75b6dd6b
* synchronised with trunk up till r28402
...
git-svn-id: branches/hlcgllvm@28403 -
2014-08-13 16:04:30 +00:00
nickysn
94bcb9878a
* reimplemented r28329 in a different way, as suggested by Jonas
...
git-svn-id: trunk@28332 -
2014-08-07 19:36:52 +00:00
sergei
a0934e897e
* i386: improvements to 64-bit comparison code, also serves as a good base for m68k target:
...
* Better handling of LOC_CREGISTER locations.
+ Support direct compares of constants with references.
+ Optimize away comparison of low dword when its result is constant (cases of "less" and "greater or equal" comparing against a constant with zero low dword).
git-svn-id: trunk@28263 -
2014-07-25 13:21:44 +00:00
Jonas Maebe
7949bebb8d
* synchronised with r28168 of trunk
...
git-svn-id: branches/hlcgllvm@28169 -
2014-07-05 21:30:28 +00:00
Jonas Maebe
1516661249
+ new chlcgobj class reference variable that can be used to call thlcg*
...
virtual methods even when hlcg doesn't contain a valid instance
git-svn-id: branches/hlcgllvm@28143 -
2014-07-03 22:28:31 +00:00
sergei
5356f17fa5
* i386: switch the div/mod node to shared code, leaving in place the specific optimization for division by power of 2.
...
git-svn-id: trunk@27975 -
2014-06-15 16:20:53 +00:00
sergei
dc628b8969
* x86: Completely skip instructions that do not exist for target CPU bit width. The existing behavior of writing mnemonics and properties but no encoding allows an invalid instruction to be recognized by assembler reader or even generated by compiler, but it but won't assemble anyway.
...
git-svn-id: trunk@27934 -
2014-06-11 22:31:40 +00:00
sergei
ed46a07f62
* Using x86-specific capability of shifting with carry flag helps to reduce amount of instructions.
...
git-svn-id: trunk@27899 -
2014-06-08 14:01:41 +00:00
sergei
92cf25b9a5
* Reworked i386 division by constant optimization to reuse code from powerpc64. The algorithm is slightly different, signed version is one instruction shorter, unsigned one is one instruction longer (typically). The new algorithm is easily scalable for x86_64 target, unlike the old one.
...
git-svn-id: trunk@27884 -
2014-06-07 00:20:05 +00:00
Jonas Maebe
bacd303208
* synchronized with trunk up to r27758
...
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
sergei
2ee0c8de45
* i386: For integer comparisons with zero, emit "test $-1,%reg" instead of "test %reg,%reg". It is more spilling-friendly, because it transforms into "test $-1,spilltemp" and does not require a register.
...
* Improved peephole optimizer to remove these instructions if preceded by flag-setting instruction that operates on same location and followed by conditional jump, and change them back into "test %reg,%reg" otherwise.
git-svn-id: trunk@27617 -
2014-04-20 19:16:58 +00:00
florian
d88d644925
+ support for FMA intrinsic: if there is no hardware support, the compiler throws an error.
...
Currently it is implemented only for x86-CPUs supporting the FMA extension. While it would
be possible to implement it in software or simulate fma(<single>,<single>,<single>) using
double operations, it makes no sense in my opinion to do so.
git-svn-id: trunk@27564 -
2014-04-13 19:21:54 +00:00
nickysn
d404d15c1e
* forgot to commit the changes to i386/symcpu.pas in r27549
...
git-svn-id: trunk@27563 -
2014-04-13 18:44:35 +00:00
svenbarth
02495c17bd
Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
...
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
Jonas Maebe
d452686c39
* moved pbestrealtype from symdef to symcpu
...
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
338c064beb
* moved x86-specific tpointerdef functionality to architecture-specific
...
descendants
git-svn-id: trunk@27397 -
2014-03-30 21:04:36 +00:00
Jonas Maebe
dae5d1ff62
+ added class reference types of the architecture-specific t*def/t*sym
...
classes
git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
Jonas Maebe
4a79481c51
* isolated segment-related functionality of tabsolutevarsym into i386/i8086-
...
specific descendent classes and moved the code that deals with this in the
code generator also to target-specific classes -> only ifdefs left in
pdecvar
git-svn-id: trunk@27379 -
2014-03-30 15:42:53 +00:00
Jonas Maebe
b57c95043f
+ support overriding tdef/tsym methods with target-specific functionality:
...
o made all (non-abstract) tdef and tsym constructors virtual
o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
class
o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
class from the base classes, and initialises the c*def/c*sym classes with
them. This is done so that the llvm target will be able to derive from
the tcpu*def/sym classes without umpteen ifdefs, and it also means that
the WPO can devirtualise everything because the c* variables are only
initialised with one class type
o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
calls
git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +00:00
nickysn
26b53607f8
+ added method reference_reset_base with support for different pointer types to
...
the high level code generator. All hlcg code, except for the jvm code
generator, updated to use the new method. I didn't update jvm (it still uses
the method from cgutils), because I'm not familiar with that platform, so I
might get the types wrong.
git-svn-id: trunk@27309 -
2014-03-28 00:01:18 +00:00
sergei
31edfdc05f
* i386: push references with size OS_F64 using less instructions.
...
git-svn-id: trunk@27300 -
2014-03-27 14:48:23 +00:00
florian
842e027a9f
+ prove of concept how FMA4 could be supported in inline assembler
...
git-svn-id: trunk@27214 -
2014-03-20 21:25:38 +00:00
florian
a79be2b05c
+ support for FMA instructions in inline assembler
...
+ extended avx test code with FMA
git-svn-id: trunk@27209 -
2014-03-20 20:06:56 +00:00
florian
aa107b914c
* merged avx2 branch, developed by Torsten Grundke
...
git-svn-id: trunk@27200 -
2014-03-20 12:03:52 +00:00
sergei
c003f934c5
* Included cs_opt_peephole into genericlevel1optimizerswitches, so it is re-enabled for all targets after r27106.
...
- Removed cs_opt_peephole from level1optimizerswicthes on i386 and i8086, it is redundant due to the above change.
git-svn-id: trunk@27147 -
2014-03-15 21:23:29 +00:00
Jonas Maebe
e9268a0a14
* synchronised with trunk up till r26975
...
git-svn-id: branches/hlcgllvm@26976 -
2014-03-06 21:36:58 +00:00
sergei
46f8e78d1f
+ Support GOT/gp-relative constants in GAS and internal assemblers, MIPS and i386.
...
* Change MIPS jump tables in PIC mode to use gp-relative constants, making them ABI-compliant and not requiring dynamic relocations.
git-svn-id: trunk@26886 -
2014-02-26 14:54:47 +00:00
sergei
2c02e8a726
- i386, x86_64, SPARC: removed paramanager.getintparaloc overrides, it is handled by generic implementation since r24716.
...
(This probably can be removed for all targets, but I don't want to do it without prior testing).
git-svn-id: trunk@26870 -
2014-02-24 16:01:14 +00:00
florian
13cb468a8e
* fixed modification information for some avx instructions
...
git-svn-id: trunk@26840 -
2014-02-22 15:52:33 +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
florian
0d6cc46a5e
+ CPU type corei
...
git-svn-id: trunk@26790 -
2014-02-16 08:27:27 +00:00
florian
be0a29da95
* fix modification information for bmi instructions
...
git-svn-id: trunk@26738 -
2014-02-08 21:38:21 +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
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
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
florian
8989a40b4f
* more flags to mark changes fixed
...
git-svn-id: trunk@26626 -
2014-01-30 17:34:28 +00:00
florian
060aa2a7fe
+ SSE and AVX unit cpu flags
...
git-svn-id: trunk@26587 -
2014-01-26 12:37:52 +00:00
florian
2ec5a649d7
* set Ch_* for more operations
...
* Ch_* flags for VMOVSD and VMOVSS are now set for the 2 operand variants
git-svn-id: trunk@26586 -
2014-01-26 12:37:50 +00:00
pierre
1cec09f979
Add -Caoldwin32gnu ABI option to cope with 'ret $4' issues in old GNU mingw32 C compiler (version below 4.7)
...
git-svn-id: trunk@26536 -
2014-01-20 22:47:46 +00:00
florian
a752e3542d
+ more x86 cpu flags
...
git-svn-id: trunk@26513 -
2014-01-18 21:03:09 +00:00
nickysn
1de847c754
* fixed error in comment
...
git-svn-id: trunk@26507 -
2014-01-18 17:00:10 +00:00
florian
7028210817
+ tzcnt assembler instruction
...
git-svn-id: trunk@26506 -
2014-01-18 12:11:50 +00:00
sergei
3a3197ae9c
+ i386: inline 64-bit multiplications if overflow checking is disabled and not optimizing for size. Rough testing on Core 2 Duo shows speed improvement by factor of 5, even despite inlined code does not check for zero upper dwords.
...
git-svn-id: trunk@26504 -
2014-01-18 11:41:55 +00:00
nickysn
5d75bf4f92
* always use IMUL instead of MUL on i386, when doing a 32->32 multiplication
...
without overflow checking
git-svn-id: trunk@26498 -
2014-01-18 02:56:51 +00:00
florian
e210d5f30e
+ cpu_capabilites for x86_64 and i386
...
* take advantage of bmi2 instruction rorx
git-svn-id: trunk@26482 -
2014-01-16 21:47:28 +00:00
sergei
75894722d4
* Factored a reusable piece of code into separate method.
...
git-svn-id: trunk@26481 -
2014-01-16 16:43:06 +00:00
sergei
f2096de53a
* tcg386.g_proc_exit: instead of recalculating stack size, use current_procinfo.final_localsize which was calculated in g_proc_entry.
...
* tcgx86.g_proc_entry: don't over-allocate stack in SEH finalizer procedures.
git-svn-id: trunk@26251 -
2013-12-19 10:32:32 +00:00
sergei
179586f589
+ SEH support for Win32. Enable by cycling with OPT=-dTEST_WIN32_SEH.
...
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.
git-svn-id: trunk@26225 -
2013-12-12 12:43:46 +00:00
florian
4d5119bf1c
* fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
...
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
nickysn
85e1f444c5
* is_ecx_used modified to only check the callee side, but after a call to
...
init_paraloc_info to ensure that the callee side paraloc info is created.
git-svn-id: trunk@26103 -
2013-11-17 15:46:56 +00:00
nickysn
fbca7ee2cb
* check callerside if calleeside isn't available in is_ecx_used. Based on the
...
patch by Do-wan Kim, mantis #25269 .
git-svn-id: trunk@26101 -
2013-11-16 19:39:15 +00:00
Jonas Maebe
99de108c68
* renamed all paramanagers to tcpuparamanager so the llvm paramanager can
...
derive from them without ifdefs
git-svn-id: branches/hlcgllvm@26039 -
2013-11-11 11:15:27 +00:00
Jonas Maebe
0302453912
* disabled the lea->add transformation added in r25907 because it breaks
...
webtbs/tw15694.pp. Such transformation require liveness analysis of
the flags
git-svn-id: trunk@26001 -
2013-11-09 18:42:23 +00:00
florian
1843ed59b5
* set p to a valid instruction
...
git-svn-id: trunk@25912 -
2013-11-01 20:09:28 +00:00
florian
f132a804d6
+ handle 32 bit references on x86-64 so lea can be used for 32 bit arithmetics
...
git-svn-id: trunk@25909 -
2013-11-01 19:01:39 +00:00
florian
a16ceb6cdf
* replace lea by add if possible
...
git-svn-id: trunk@25907 -
2013-11-01 19:01:33 +00:00
florian
80f8f66c6e
* set file positions correctly in PeepHoleOptPass1
...
git-svn-id: trunk@25906 -
2013-11-01 19:01:31 +00:00
florian
4148637c8c
* fold mov/lea/mov as well if possible
...
git-svn-id: trunk@25905 -
2013-11-01 19:01:29 +00:00
florian
524cde8140
+ MatchReference
...
* refactored some code
git-svn-id: trunk@25904 -
2013-11-01 19:01:26 +00:00
florian
440cb33e80
* continue to use lea to adjust the stack pointer, it is the recommended way
...
git-svn-id: trunk@25903 -
2013-11-01 19:01:24 +00:00
florian
5eb578a44c
* generate sub instead of add from lea if appropriate
...
git-svn-id: trunk@25902 -
2013-11-01 19:01:22 +00:00
florian
d575a435c3
* some debugging infrastructure
...
git-svn-id: trunk@25900 -
2013-11-01 19:01:17 +00:00
florian
bfbb0c5b9d
* optimize mov/lea
...
git-svn-id: trunk@25899 -
2013-11-01 19:01:14 +00:00
nickysn
f288859fba
* i386 optimization - remove the test/or %y, %y instruction in the sequence:
...
shl/sal/shr/sar $x, %y
test/or %y, %y
jz/jnz/setz/setnz/cmovz/cmovnz ...
git-svn-id: trunk@25881 -
2013-10-29 17:34:32 +00:00
sergei
66e82f1655
+ i386: generate optimized code for 64-bit arithmetic shifts by constant amount. Shifts by 63 and by less than 32 take just two instructions, shifts by 32..62 bits are done with 3 instructions.
...
git-svn-id: trunk@25880 -
2013-10-29 16:10:13 +00:00
nickysn
a0723ccfd5
* also check if ECX is nonvolatile in is_ecx_used. Not strictly necessary for the current set of i386 calling conventions, but good as an extra safety precaution in case new calling conventions are added or the code is adapted and used on other platforms.
...
git-svn-id: trunk@25839 -
2013-10-21 16:48:58 +00:00
nickysn
378afb69b2
* optimization in tcg386.g_intf_wrapper: use the much more efficient case 1
...
for virtual methods, that use the register calling convention, but have at
least one free register (i.e. not used as a parameter and not required to be
preserved by the function)
git-svn-id: trunk@25830 -
2013-10-19 17:40:38 +00:00
nickysn
aca22a59f7
* optimizations in tcg386.g_copyvaluepara_openarray in order to avoid the
...
second IMUL
git-svn-id: trunk@25828 -
2013-10-19 12:56:58 +00:00
nickysn
0f69362edd
- rm LEA reg,imm from x86ins.dat, as that's not a valid x86 instruction,
...
using it in inline asm causes an internal error and removing it didn't show
any regressions after running the testsuite on i386-linux.
git-svn-id: trunk@25827 -
2013-10-18 23:26:58 +00:00
nickysn
4aa010eedc
+ support LEA with 16-bit operand size
...
git-svn-id: trunk@25808 -
2013-10-17 16:11:08 +00:00
nickysn
f6e846c574
+ added the NEC V20/V30 instructions
...
git-svn-id: trunk@25750 -
2013-10-11 21:27:56 +00:00
svenbarth
c48d572996
Implement support for saving and restoring address registers.
...
cgobj.pas, tcg:
* g_save_registers: add the amount of used address registers to size as well
* g_save_registers: save all used address registers
* g_restore_registers: restore all stored address registers
m68k/cpubase.pas:
* rename saved_standard_address_registers to saved_address_registers
all other platform's cpubase.{inc,pas} (except alpha, ia64 and vis which are not up to date):
* add a saved_address_registers variable with one entry of RS_INVALID
At least a "make fullcycle" did complete.
git-svn-id: trunk@25664 -
2013-10-05 21:43:42 +00:00
sergei
5af873ee5b
* x86 targets: Profiling shows that quite a bit of time is spent in findreg_by_number(), despite it uses binary search. Worse, it is repeated for every piece of register information. Trying to get rid of some of these calls: rearranged registers so that their "opcode" matches 3 LSBs of superregister number (with a few exceptions described at the beginning of x86reg.dat). This allows to lookup opcodes in regval() with O(1) complexity, and removes need in rXXXop.inc files.
...
git-svn-id: trunk@25627 -
2013-10-03 08:08:04 +00:00
nickysn
bd0585274e
* tsettings.enablecld converted to a targetswitch ts_cld
...
git-svn-id: trunk@25592 -
2013-09-28 13:41:58 +00:00
nickysn
52fcc0a407
+ added a new x86-specific compiler option 'enablecld', which controls whether
...
the compiler should emit a CLD before using the x86 string instructions.
git-svn-id: trunk@25590 -
2013-09-28 11:54:02 +00:00
nickysn
5c46e6f474
* emit a cld instruction before the rep movsXX in tcg386.g_copyvaluepara_openarray
...
git-svn-id: trunk@25555 -
2013-09-24 20:07:53 +00:00
sergei
5c4abfa75a
+ Implemented saving/restoring registers using PUSH/POP instructions on i386 targets with non-fixed stack. Provides some advantage in code size (e.g. the compiler becomes about 20KBytes smaller).
...
* This should be applicable to i8086 targets as well (but needs testing), by copying changes from i386/cgcpu.pas to i8086/cgcpu.pas and removing "$ifdef i386" lines in cgx86.pas.
git-svn-id: trunk@25224 -
2013-08-07 09:59:07 +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
94cf650d9a
* use lea to adjust stack pointer, this is equal or faster on all modern CPUs than add/sub
...
git-svn-id: trunk@25010 -
2013-06-28 17:06:57 +00:00
florian
9b6094a58c
+ added a few BMI instructions to see if they can be encoded
...
git-svn-id: trunk@24907 -
2013-06-16 09:35:21 +00:00
florian
e81d2d1f3b
* basic avx support for floating point operations (use -Cfavx to activate)
...
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
Jonas Maebe
7f2750f188
* missing part of r24776, using a build server also has pitfalls :/
...
git-svn-id: trunk@24777 -
2013-06-02 14:35:29 +00:00
Jonas Maebe
9938169d2c
* don't use the paracgsize in get_paraloc_def(), because it generally
...
contains the tcgsize of the entire parameter rather than only of
what is left (-> calculate it from the remaining parameter length)
git-svn-id: trunk@24776 -
2013-06-02 14:05:07 +00:00
Jonas Maebe
7566ddcc8f
* add a tdef to each parameter location and set it for all target
...
backends (not yet used, will be used in high level code generator)
git-svn-id: trunk@24761 -
2013-06-02 10:24:02 +00:00
nickysn
125a6a8720
* register id of (e)flags changed, so it doesn't overlap with dr0
...
git-svn-id: trunk@24647 -
2013-05-30 16:40:59 +00:00
nickysn
b0f7786782
+ added support for special versions of near data pointers associated with a x86 segment register. They are supported on all x86 platforms: i8086, i386 and x86_64
...
git-svn-id: trunk@24453 -
2013-05-05 17:22:37 +00:00
yury
e88bc322bc
+ Merge the targetandroid branch. Support for arm and i386 android targets.
...
***************************************************************************
Revision: 23518
Author: yury
Date: 25 Jan 2013 0:14:31
Message:
* Build databases support for Android.
----
Modified : /branches/targetandroid/packages/dblib/fpmake.pp
Modified : /branches/targetandroid/packages/fcl-db/fpmake.pp
Revision: 23516
Author: yury
Date: 24 Jan 2013 23:08:12
Message:
* again made less complex for arm and sparc so it compiles there too without running out of registers.
----
Modified : /branches/targetandroid/tests/webtbs/tw2242.pp
Revision: 23515
Author: yury
Date: 24 Jan 2013 23:01:36
Message:
* Disabled the test for Android.
----
Modified : /branches/targetandroid/tests/webtbs/tw4038.pp
Revision: 23514
Author: yury
Date: 24 Jan 2013 22:32:39
Message:
* Disabled the test for Android.
----
Modified : /branches/targetandroid/tests/test/packages/webtbs/tw14265.pp
Revision: 23512
Author: yury
Date: 24 Jan 2013 12:30:07
Message:
* Allow passing of double quoted paths in TEST_OPT.
----
Modified : /branches/targetandroid/tests/Makefile
Modified : /branches/targetandroid/tests/Makefile.fpc
Revision: 23511
Author: yury
Date: 24 Jan 2013 12:29:01
Message:
* Fixed building of packages when cross-testing. Pass CROSSOPT to build packages in such case, otherwise options specified in TEST_OPT are used to build fpmake. The source compiler not always accepts target options. For example -Cfsoft option, often used for arm compiler, is not accepted by x86 compiler.
----
Modified : /branches/targetandroid/tests/tstunits/Makefile
Modified : /branches/targetandroid/tests/tstunits/Makefile.fpc
Revision: 23497
Author: yury
Date: 22 Jan 2013 19:10:54
Message:
* Reverted r23400 and r23401. Tomas has promised to commit more correct fix to trunk.
----
Modified : /branches/targetandroid/rtl/inc/fexpand.inc
Modified : /branches/targetandroid/tests/test/units/dos/tfexpand.pp
Revision: 23496
Author: yury
Date: 22 Jan 2013 19:05:51
Message:
* Disabled the test for Android.
----
Modified : /branches/targetandroid/tests/webtbs/tw0876.pp
Revision: 23495
Author: yury
Date: 22 Jan 2013 18:58:30
Message:
* Add %delfiles for proper clean-up.
----
Modified : /branches/targetandroid/tests/tbs/tb0582.pp
Modified : /branches/targetandroid/tests/test/tweaklib2.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704b.pp
Modified : /branches/targetandroid/tests/webtbs/tw13628b.pp
Modified : /branches/targetandroid/tests/webtbs/tw14798.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949b.pp
Modified : /branches/targetandroid/tests/webtbs/tw2812.pp
Modified : /branches/targetandroid/tests/webtbs/tw3082.pp
Modified : /branches/targetandroid/tests/webtbs/tw3402.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6822b.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730d.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089c.pp
Revision: 23492
Author: yury
Date: 22 Jan 2013 16:43:42
Message:
* Turn off special handling of interrupt calling convention for i386-android.
----
Modified : /branches/targetandroid/compiler/i386/n386cal.pas
Modified : /branches/targetandroid/compiler/x86/cgx86.pas
Revision: 23491
Author: yury
Date: 22 Jan 2013 16:34:32
Message:
* Added %delfiles for proper clean-up.
----
Modified : /branches/targetandroid/tests/test/targ1b.pp
Modified : /branches/targetandroid/tests/test/tlib1b.pp
Modified : /branches/targetandroid/tests/test/tlib2b.pp
Modified : /branches/targetandroid/tests/test/tlibrary2.pp
Modified : /branches/targetandroid/tests/test/tlibrary3.pp
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp
Revision: 23490
Author: yury
Date: 22 Jan 2013 16:28:00
Message:
* These libs are for tests, that run only on windows. Mark libs for windows only as well.
----
Modified : /branches/targetandroid/tests/test/library/tlib3a.pp
Modified : /branches/targetandroid/tests/test/library/tlib3b.pp
Revision: 23489
Author: yury
Date: 22 Jan 2013 16:18:56
Message:
* Do not copy a library to a remote target if this library name is specified using %DELFILES directive.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp
Revision: 23488
Author: yury
Date: 22 Jan 2013 15:47:52
Message:
* Implemented { %DELFILES file1 file2 ... } directive for tests. Primarily it is needed to delete shared libraries used by tests when TEST_DELTEMP=1. When testing on a real Android device, it is not good to run tests on flash memory partitions. Android devices have 1Mb RAM based tempfs partition for /tmp folder, which is ideal for running tests. Since 1Mb is very small size these days, it is needed to clean all test leftovers. Test shared libraries are the biggest leftovers and this new DELFILES directive will help to delete them.
* During remote execution, use && as a command separator after important commands such as CD to ensure that the command succeeded before running other commands. Group other commands using curly braces { }.
----
Modified : /branches/targetandroid/tests/readme.txt
Modified : /branches/targetandroid/tests/utils/dotest.pp
Modified : /branches/targetandroid/tests/utils/testu.pp
Revision: 23487
Author: yury
Date: 22 Jan 2013 13:16:22
Message:
* Define CExtended and clongdouble as double for Android.
----
Modified : /branches/targetandroid/compiler/psystem.pas
Modified : /branches/targetandroid/rtl/inc/ctypes.pp
Revision: 23486
Author: yury
Date: 22 Jan 2013 13:14:36
Message:
* Fixed compilation for case when extended <> cextended.
----
Modified : /branches/targetandroid/tests/test/cg/tcalext6.pp
Revision: 23485
Author: yury
Date: 22 Jan 2013 12:41:43
Message:
* More correct comparison of long double values for case when long double=double in C.
----
Modified : /branches/targetandroid/tests/test/cg/tcalext.pp
Revision: 23484
Author: yury
Date: 22 Jan 2013 11:53:41
Message:
* Do not pass -f switch for rm when testing via adb, since default android shell do not support -f switch.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp
Revision: 23483
Author: yury
Date: 22 Jan 2013 11:47:31
Message:
* Added ICU version of Android 4.1.
* Increment by 2 when finding an unknown ICU version.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23479
Author: yury
Date: 21 Jan 2013 14:29:40
Message:
* Add define for android.
----
Modified : /branches/targetandroid/tests/test/cg/tcalcst6.pp
Modified : /branches/targetandroid/tests/test/cg/tcalvar6.pp
Revision: 23478
Author: yury
Date: 21 Jan 2013 14:22:06
Message:
+ Added C object files for android-i386.
----
Added : /branches/targetandroid/tests/test/cg/obj/android/i386
Modified : /branches/targetandroid/tests/test/cg/obj/readme.txt
Revision: 23477
Author: yury
Date: 21 Jan 2013 14:08:25
Message:
* Add missing checks for android target.
----
Modified : /branches/targetandroid/compiler/aasmdata.pas
Modified : /branches/targetandroid/compiler/aggas.pas
Modified : /branches/targetandroid/compiler/expunix.pas
Modified : /branches/targetandroid/compiler/ncgld.pas
Modified : /branches/targetandroid/compiler/ogelf.pas
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/x86/agx86att.pas
Modified : /branches/targetandroid/compiler/x86/cgx86.pas
Modified : /branches/targetandroid/compiler/x86/rax86.pas
Revision: 23475
Author: yury
Date: 21 Jan 2013 13:51:09
Message:
* Set android-i368 stack alignment to 16.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Revision: 23474
Author: yury
Date: 21 Jan 2013 13:45:29
Message:
* Removed -z relro linker option, since it causes problems.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Revision: 23451
Author: yury
Date: 19 Jan 2013 1:32:26
Message:
* Pass some security switches to LD. They are passed by GCC.
* Removed unused function.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Revision: 23450
Author: yury
Date: 19 Jan 2013 1:27:45
Message:
* Fixed file description.
----
Modified : /branches/targetandroid/rtl/android/arm/dllprt0.as
Revision: 23449
Author: yury
Date: 19 Jan 2013 1:27:02
Message:
* Simplify arm startup code.
----
Modified : /branches/targetandroid/rtl/android/arm/prt0.as
Revision: 23448
Author: yury
Date: 19 Jan 2013 1:25:58
Message:
* Fixed file description.
----
Modified : /branches/targetandroid/rtl/android/i386/dllprt0.as
Modified : /branches/targetandroid/rtl/android/i386/prt0.as
Revision: 23447
Author: yury
Date: 19 Jan 2013 1:19:29
Message:
* Rewrite initialization code for i386-android. i386-android works.
----
Modified : /branches/targetandroid/rtl/android/i386/dllprt0.as
Modified : /branches/targetandroid/rtl/android/i386/prt0.as
Revision: 23441
Author: yury
Date: 18 Jan 2013 16:51:09
Message:
* Add android to supported targets for assemblers. It fixes assembling for i386-android.
----
Modified : /branches/targetandroid/compiler/arm/agarmgas.pas
Modified : /branches/targetandroid/compiler/i386/cpuelf.pas
Modified : /branches/targetandroid/compiler/x86/agx86att.pas
Revision: 23435
Author: yury
Date: 18 Jan 2013 0:46:23
Message:
* Enable safecall exception handling for arm-android.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Revision: 23434
Author: yury
Date: 18 Jan 2013 0:28:59
Message:
* Removed leftover from my experiments (calling directly pascal main).
----
Modified : /branches/targetandroid/rtl/android/arm/prt0.as
Revision: 23433
Author: yury
Date: 17 Jan 2013 23:43:09
Message:
* Uses SysUtils to make executable bigger. Otherwise string pointers for FindResource can be less than $10000. They are treated as IDs in such case and the test will fail.
----
Modified : /branches/targetandroid/tests/test/units/system/tres.pp
Revision: 23429
Author: yury
Date: 17 Jan 2013 18:49:23
Message:
* Thread safety.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23427
Author: yury
Date: 17 Jan 2013 14:48:03
Message:
* Skip this test for android.
----
Modified : /branches/targetandroid/tests/test/textthr.pp
Revision: 23426
Author: yury
Date: 17 Jan 2013 14:21:51
Message:
* Fixed ifdefs linux to unix.
----
Modified : /branches/targetandroid/tests/test/tstring10.pp
Modified : /branches/targetandroid/tests/test/units/classes/tsetstream.pp
Modified : /branches/targetandroid/tests/test/units/dos/tdos.pp
Modified : /branches/targetandroid/tests/test/units/dos/tidos.pp
Revision: 23425
Author: yury
Date: 17 Jan 2013 14:20:56
Message:
* Enable more tests for android.
----
Modified : /branches/targetandroid/tests/test/packages/webtbs/tw14265.pp
Modified : /branches/targetandroid/tests/test/testfpuc.pp
Modified : /branches/targetandroid/tests/test/textthr.pp
Modified : /branches/targetandroid/tests/test/tlib2a.pp
Modified : /branches/targetandroid/tests/test/tlib2b.pp
Modified : /branches/targetandroid/tests/test/tpoll.pp
Modified : /branches/targetandroid/tests/test/tsafecall1.pp
Modified : /branches/targetandroid/tests/test/tsafecall2.pp
Modified : /branches/targetandroid/tests/test/tsafecall3.pp
Modified : /branches/targetandroid/tests/test/tsafecall4.pp
Modified : /branches/targetandroid/tests/test/units/system/tres.pp
Modified : /branches/targetandroid/tests/test/units/system/tres2.pp
Modified : /branches/targetandroid/tests/test/units/system/tres3.pp
Revision: 23424
Author: yury
Date: 17 Jan 2013 14:02:35
Message:
* Fixed AnsiStrLComp() and AnsiStrLIComp().
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23423
Author: yury
Date: 17 Jan 2013 13:49:55
Message:
* Fixed stupid copy-paste error.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23409
Author: yury
Date: 16 Jan 2013 16:46:02
Message:
* Fixed conflict of native android and java android targets.
----
Modified : /branches/targetandroid/utils/fpcm/fpcmake.inc
Modified : /branches/targetandroid/utils/fpcm/fpcmake.ini
Revision: 23406
Author: yury
Date: 16 Jan 2013 15:33:50
Message:
* Set stackalign field.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Revision: 23404
Author: yury
Date: 16 Jan 2013 12:57:51
Message:
* Enable more tests for android.
----
Modified : /branches/targetandroid/tests/webtbs/tw0876.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704a.pp
Modified : /branches/targetandroid/tests/webtbs/tw12704b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263a.pp
Modified : /branches/targetandroid/tests/webtbs/tw16263b.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949a.pp
Modified : /branches/targetandroid/tests/webtbs/tw16949b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586a.pp
Modified : /branches/targetandroid/tests/webtbs/tw6586b.pp
Modified : /branches/targetandroid/tests/webtbs/tw6822c.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838a.pp
Modified : /branches/targetandroid/tests/webtbs/tw7838b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730a.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730b.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730c.pp
Modified : /branches/targetandroid/tests/webtbs/tw8730d.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089a.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089b.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089c.pp
Modified : /branches/targetandroid/tests/webtbs/tw9089d.pp
Modified : /branches/targetandroid/tests/webtbs/uw2364.pp
Revision: 23402
Author: yury
Date: 16 Jan 2013 12:50:52
Message:
* Use collation when comparing strings.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23401
Author: yury
Date: 16 Jan 2013 12:41:32
Message:
* If there is no HOME directory, the current dir must be used.
----
Modified : /branches/targetandroid/tests/test/units/dos/tfexpand.pp
Revision: 23400
Author: yury
Date: 16 Jan 2013 12:40:25
Message:
* Fixed expanding ~ if there is no HOME env var set.
----
Modified : /branches/targetandroid/rtl/inc/fexpand.inc
Revision: 23391
Author: yury
Date: 15 Jan 2013 14:12:56
Message:
* Make sure that the thread has been started, before destroying the event.
----
Modified : /branches/targetandroid/tests/test/tbrtlevt.pp
Revision: 23390
Author: yury
Date: 15 Jan 2013 13:55:24
Message:
* Do not use DOS code pages for Android. Now all CP string tests pass on Android.
----
Modified : /branches/targetandroid/tests/test/tcpstr17.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcat3.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcatmulti.pp
Modified : /branches/targetandroid/tests/test/tcpstrconcatmulti2.pp
Revision: 23389
Author: yury
Date: 15 Jan 2013 13:53:50
Message:
* Use more common code pages 1251 and 1252 instead of old DOS code pages (not available on Android). There is Euro symbol character that has different code in 1251 and 1252 code pages. Use it for tests.
----
Modified : /branches/targetandroid/tests/test/tcpstr1.pp
Modified : /branches/targetandroid/tests/test/tcpstransistrcompare.pp
Modified : /branches/targetandroid/tests/test/tcpstransistrcompareequal.pp
Revision: 23386
Author: yury
Date: 15 Jan 2013 10:22:30
Message:
* Skip 2 tests for android, since they require local execution.
----
Modified : /branches/targetandroid/tests/test/tcpstr19.pp
Modified : /branches/targetandroid/tests/test/tcpstr9.pp
Revision: 23385
Author: yury
Date: 15 Jan 2013 10:20:43
Message:
* Fixed running library tests on android.
----
Modified : /branches/targetandroid/tests/utils/dotest.pp
Revision: 23382
Author: yury
Date: 14 Jan 2013 16:20:44
Message:
* Implemented Unicode string manager for Android. It uses ICU library libicuuc.so. Note: ICU on Android has limited number of code pages. So don't expect support for DOS code pages or other exotic code pages.
----
Modified : /branches/targetandroid/rtl/android/cwstring.pp
Revision: 23301
Author: yury
Date: 2 Jan 2013 20:47:09
Message:
* I've found that libc on Android does not implement widechar case functions such as towupper(). Such functions are just wrappers over regular char functions. Therefore the whole cwstring unit is useless for Android. For now I've added stub cwstring unit for Android and reverted all Android specific changes in unix/cwstring.pp. Later, Unicode manager for Androud should be implemented using libicuuc, which is default Android lib.
----
Added : /branches/targetandroid/rtl/android/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Revision: 23299
Author: yury
Date: 2 Jan 2013 19:38:08
Message:
* Android does not have libiconv, so don't use it in cwstring unit. For now support only UTF-8 code page in ansistrings. Later it is possible to use libicuuc for code page conversions on Android.
----
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Revision: 23298
Author: yury
Date: 2 Jan 2013 17:41:36
Message:
* Added uuchar unit to build for android.
----
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Revision: 23289
Author: yury
Date: 2 Jan 2013 2:53:36
Message:
* Always specify dynamic linker name for executables.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Revision: 23288
Author: yury
Date: 2 Jan 2013 2:04:41
Message:
* Updated Makefile
----
Modified : /branches/targetandroid/rtl/android/Makefile
Revision: 23287
Author: yury
Date: 2 Jan 2013 2:03:42
Message:
* cprt0.as is not needed, since we link to libc always.
----
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Revision: 23286
Author: yury
Date: 2 Jan 2013 2:01:43
Message:
* cprt0.as is not needed, since we link to libc always.
----
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Deleted : /branches/targetandroid/rtl/android/arm/cprt0.as
Deleted : /branches/targetandroid/rtl/android/i386/cprt0.as
Revision: 23285
Author: yury
Date: 2 Jan 2013 1:59:48
Message:
* libctype is not needed, since only bionic is supported anyway.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Revision: 23284
Author: yury
Date: 2 Jan 2013 1:49:12
Message:
* Rework of Android startup code. It is needed to always link to libc on android to implement finalization and environment variables in shared libraries.
* Cleanup of Android linker.
* Use only INSERT command in the linker script to inject custom .fpc sections. Whole linker script duplication is nor needed anymore.
* Use BFD linker, since GOLD linker does not support INSERT command. Other incompatibilities may also exist.
* Enable tf_smartlink_sections for i386-android.
* i386-android is broken after this commit. Will be fixed later.
----
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Modified : /branches/targetandroid/rtl/android/arm/dllprt0.as
Modified : /branches/targetandroid/rtl/android/arm/prt0.as
Revision: 23283
Author: yury
Date: 2 Jan 2013 1:48:07
Message:
* Enable weak externals for android.
----
Modified : /branches/targetandroid/compiler/systems.pas
Revision: 23236
Author: yury
Date: 28 Dec 2012 12:42:27
Message:
* Oops, wrong commit r23235. Reverted. Now correct: Fixed lineinfo for Android.
----
Modified : /branches/targetandroid/rtl/inc/exeinfo.pp
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp
Revision: 23235
Author: yury
Date: 28 Dec 2012 11:38:04
Message:
* Fixed lineinfo for Android.
----
Modified : /branches/targetandroid/tests/test/units/sysutils/texec2.pp
Revision: 23232
Author: yury
Date: 27 Dec 2012 22:52:26
Message:
* Fixed the test for android.
----
Modified : /branches/targetandroid/tests/test/units/dos/tdos2.pp
Revision: 23231
Author: yury
Date: 27 Dec 2012 22:51:32
Message:
+ Added C object files for arm-android.
----
Added : /branches/targetandroid/tests/test/cg/obj/android
Added : /branches/targetandroid/tests/test/cg/obj/android/arm
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/cpptcl1.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/cpptcl2.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/ctest.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext3.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext4.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext5.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm/tcext6.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/cpptcl1.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/cpptcl2.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/ctest.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext3.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext4.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext5.o
Added : /branches/targetandroid/tests/test/cg/obj/android/arm-eabi/tcext6.o
Revision: 23226
Author: yury
Date: 27 Dec 2012 10:17:06
Message:
* Support for running tests on a remote Android device using ADB.
----
Modified : /branches/targetandroid/tests/Makefile
Modified : /branches/targetandroid/tests/Makefile.fpc
Modified : /branches/targetandroid/tests/readme.txt
Modified : /branches/targetandroid/tests/tstunits/Makefile
Modified : /branches/targetandroid/tests/utils/dotest.pp
Revision: 22048
Author: tom_at_work
Date: 9 Aug 2012 17:13:51
Message:
re-apply the changes of r22045 to correct files after recent revert
----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Added : /branches/targetandroid/rtl/android/i386
Added : /branches/targetandroid/rtl/android/i386/cprt0.as
Added : /branches/targetandroid/rtl/android/i386/dllprt0.as
Added : /branches/targetandroid/rtl/android/i386/prt0.as
Revision: 22047
Author: tom_at_work
Date: 9 Aug 2012 16:57:34
Message:
- revert r22045: applied changes to wrong files, i.e. linux system files, instead of android ones
----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Modified : /branches/targetandroid/rtl/linux/i386/cprt0.as
Added : /branches/targetandroid/rtl/linux/i386/cprt21.as
Added : /branches/targetandroid/rtl/linux/i386/gprt21.as
Revision: 22045
Author: tom_at_work
Date: 9 Aug 2012 11:05:38
Message:
Made cprt0 startup files to compile. Static executables using them likely do not work though.
Removed obsolete startup files (?prt21*).
----
Modified : /branches/targetandroid/rtl/android/arm/cprt0.as
Modified : /branches/targetandroid/rtl/linux/i386/cprt0.as
Deleted : /branches/targetandroid/rtl/linux/i386/cprt21.as
Deleted : /branches/targetandroid/rtl/linux/i386/gprt21.as
Revision: 22044
Author: tom_at_work
Date: 9 Aug 2012 11:00:16
Message:
Updated systems/t_android to only recognize the "bionic" libc as valid libc.
Fix uninitialized defdynlinker variable when compiling i386-android causing garbage in the linker script.
----
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Revision: 21296
Author: tom_at_work
Date: 15 May 2012 0:14:12
Message:
* basic android/x86 support
----
Modified : /branches/targetandroid/Makefile
Modified : /branches/targetandroid/compiler/Makefile
Modified : /branches/targetandroid/compiler/i386/cputarg.pas
Modified : /branches/targetandroid/compiler/systems/i_android.pas
Modified : /branches/targetandroid/compiler/systems/t_android.pas
Modified : /branches/targetandroid/compiler/systems.inc
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/utils/Makefile
Modified : /branches/targetandroid/compiler/utils/ppudump.pp
Modified : /branches/targetandroid/ide/Makefile
Modified : /branches/targetandroid/ide/compiler/Makefile
Modified : /branches/targetandroid/installer/Makefile
Modified : /branches/targetandroid/packages/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile
Modified : /branches/targetandroid/rtl/Makefile
Modified : /branches/targetandroid/rtl/aix/Makefile
Modified : /branches/targetandroid/rtl/amiga/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Modified : /branches/targetandroid/rtl/beos/Makefile
Modified : /branches/targetandroid/rtl/darwin/Makefile
Modified : /branches/targetandroid/rtl/embedded/Makefile
Modified : /branches/targetandroid/rtl/emx/Makefile
Modified : /branches/targetandroid/rtl/freebsd/Makefile
Modified : /branches/targetandroid/rtl/gba/Makefile
Modified : /branches/targetandroid/rtl/go32v2/Makefile
Modified : /branches/targetandroid/rtl/haiku/Makefile
Modified : /branches/targetandroid/rtl/linux/Makefile
Modified : /branches/targetandroid/rtl/macos/Makefile
Modified : /branches/targetandroid/rtl/morphos/Makefile
Modified : /branches/targetandroid/rtl/nativent/Makefile
Modified : /branches/targetandroid/rtl/nds/Makefile
Modified : /branches/targetandroid/rtl/netbsd/Makefile
Modified : /branches/targetandroid/rtl/netware/Makefile
Modified : /branches/targetandroid/rtl/netwlibc/Makefile
Modified : /branches/targetandroid/rtl/openbsd/Makefile
Modified : /branches/targetandroid/rtl/os2/Makefile
Modified : /branches/targetandroid/rtl/palmos/Makefile
Modified : /branches/targetandroid/rtl/solaris/Makefile
Modified : /branches/targetandroid/rtl/symbian/Makefile
Modified : /branches/targetandroid/rtl/unix/x86.pp
Modified : /branches/targetandroid/rtl/wii/Makefile
Modified : /branches/targetandroid/rtl/win32/Makefile
Modified : /branches/targetandroid/rtl/win64/Makefile
Modified : /branches/targetandroid/rtl/wince/Makefile
Modified : /branches/targetandroid/utils/Makefile
Modified : /branches/targetandroid/utils/dxegen/Makefile
Modified : /branches/targetandroid/utils/fpcm/Makefile
Modified : /branches/targetandroid/utils/fpcm/fpcmmain.pp
Modified : /branches/targetandroid/utils/fpcmkcfg/Makefile
Modified : /branches/targetandroid/utils/fpcres/Makefile
Modified : /branches/targetandroid/utils/fpcreslipo/Makefile
Modified : /branches/targetandroid/utils/fpdoc/Makefile
Modified : /branches/targetandroid/utils/fpmc/Makefile
Modified : /branches/targetandroid/utils/fppkg/Makefile
Modified : /branches/targetandroid/utils/fprcp/Makefile
Modified : /branches/targetandroid/utils/h2pas/Makefile
Modified : /branches/targetandroid/utils/importtl/Makefile
Modified : /branches/targetandroid/utils/instantfpc/Makefile
Modified : /branches/targetandroid/utils/rmwait/Makefile
Modified : /branches/targetandroid/utils/tply/Makefile
Revision: 21066
Author: tom_at_work
Date: 26 Apr 2012 22:05:06
Message:
fix pthreads use with Android: it does not provide some functions. This patch is partially based on the bug report 0021525. Further, fix use of sem_timedwait in cthreads.pp since Android supports it.
----
Modified : /branches/targetandroid/rtl/linux/pthread.inc
Modified : /branches/targetandroid/rtl/unix/cthreads.pp
Revision: 21065
Author: tom_at_work
Date: 26 Apr 2012 16:15:52
Message:
bugfixes:
- do not compile ipc unit for android, not supported
- fix geterrnolocation external name
- implement dummy getdomainname; does not exist in android
- remove wrong 'if defined(android)' clauses
----
Modified : /branches/targetandroid/rtl/android/Makefile
Modified : /branches/targetandroid/rtl/android/Makefile.fpc
Modified : /branches/targetandroid/rtl/fpmake.pp
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/initc.pp
Modified : /branches/targetandroid/rtl/unix/ipc.pp
Modified : /branches/targetandroid/rtl/unix/unix.pp
Revision: 21063
Author: tom_at_work
Date: 26 Apr 2012 12:53:37
Message:
- missing makefile
----
Added : /branches/targetandroid/rtl/android/Makefile
Revision: 21062
Author: tom_at_work
Date: 26 Apr 2012 12:41:13
Message:
- commit missing new files
----
Added : /branches/targetandroid/compiler/systems/i_android.pas
Added : /branches/targetandroid/compiler/systems/t_android.pas
Added : /branches/targetandroid/rtl/android
Added : /branches/targetandroid/rtl/android/Makefile.fpc
Added : /branches/targetandroid/rtl/android/arm
Added : /branches/targetandroid/rtl/android/arm/cprt0.as
Added : /branches/targetandroid/rtl/android/arm/dllprt0.as
Added : /branches/targetandroid/rtl/android/arm/prt0.as
Revision: 21061
Author: tom_at_work
Date: 26 Apr 2012 12:36:42
Message:
- initial support for the android/arm target in the compiler; resulting .so's can be used for Android/ARM app development.
- basic rtl support using system calls
- fp(c)make/fppkg/makefile support
todo:
- revisit systems/t_android.pas: mostly duplicate with t_linux.pas, containing
lots of unnecessary code
- revisit rtl changes
- android ndk header translation import
- better app build/packaging support
- android/x86 support
----
Modified : /branches/targetandroid/Makefile
Modified : /branches/targetandroid/compiler/Makefile
Modified : /branches/targetandroid/compiler/aggas.pas
Modified : /branches/targetandroid/compiler/arm/cputarg.pas
Modified : /branches/targetandroid/compiler/compiler.pas
Modified : /branches/targetandroid/compiler/systems.inc
Modified : /branches/targetandroid/compiler/systems.pas
Modified : /branches/targetandroid/compiler/utils/Makefile
Modified : /branches/targetandroid/compiler/utils/ppudump.pp
Modified : /branches/targetandroid/ide/Makefile
Modified : /branches/targetandroid/ide/compiler/Makefile
Modified : /branches/targetandroid/installer/Makefile
Modified : /branches/targetandroid/packages/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile
Modified : /branches/targetandroid/packages/fpmkunit/Makefile.fpc
Modified : /branches/targetandroid/packages/fpmkunit/src/fpmkunit.pp
Modified : /branches/targetandroid/packages/fppkg/src/fpmkunitsrc.inc
Modified : /branches/targetandroid/packages/gnome1/fpmake.pp
Modified : /branches/targetandroid/packages/gtk1/fpmake.pp
Modified : /branches/targetandroid/packages/gtk2/fpmake.pp
Modified : /branches/targetandroid/packages/imlib/fpmake.pp
Modified : /branches/targetandroid/packages/opengl/fpmake.pp
Modified : /branches/targetandroid/packages/sdl/fpmake.pp
Modified : /branches/targetandroid/rtl/Makefile
Modified : /branches/targetandroid/rtl/Makefile.fpc
Modified : /branches/targetandroid/rtl/aix/Makefile
Modified : /branches/targetandroid/rtl/amiga/Makefile
Modified : /branches/targetandroid/rtl/beos/Makefile
Modified : /branches/targetandroid/rtl/darwin/Makefile
Modified : /branches/targetandroid/rtl/embedded/Makefile
Modified : /branches/targetandroid/rtl/emx/Makefile
Modified : /branches/targetandroid/rtl/freebsd/Makefile
Modified : /branches/targetandroid/rtl/gba/Makefile
Modified : /branches/targetandroid/rtl/go32v2/Makefile
Modified : /branches/targetandroid/rtl/haiku/Makefile
Modified : /branches/targetandroid/rtl/linux/Makefile
Modified : /branches/targetandroid/rtl/macos/Makefile
Modified : /branches/targetandroid/rtl/morphos/Makefile
Modified : /branches/targetandroid/rtl/nativent/Makefile
Modified : /branches/targetandroid/rtl/nds/Makefile
Modified : /branches/targetandroid/rtl/netbsd/Makefile
Modified : /branches/targetandroid/rtl/netware/Makefile
Modified : /branches/targetandroid/rtl/netwlibc/Makefile
Modified : /branches/targetandroid/rtl/openbsd/Makefile
Modified : /branches/targetandroid/rtl/os2/Makefile
Modified : /branches/targetandroid/rtl/palmos/Makefile
Modified : /branches/targetandroid/rtl/solaris/Makefile
Modified : /branches/targetandroid/rtl/symbian/Makefile
Modified : /branches/targetandroid/rtl/unix/cwstring.pp
Modified : /branches/targetandroid/rtl/unix/initc.pp
Modified : /branches/targetandroid/rtl/unix/ipc.pp
Modified : /branches/targetandroid/rtl/unix/unix.pp
Modified : /branches/targetandroid/rtl/wii/Makefile
Modified : /branches/targetandroid/rtl/win32/Makefile
Modified : /branches/targetandroid/rtl/win64/Makefile
Modified : /branches/targetandroid/rtl/wince/Makefile
Modified : /branches/targetandroid/utils/Makefile
Modified : /branches/targetandroid/utils/dxegen/Makefile
Modified : /branches/targetandroid/utils/fpcm/Makefile
Modified : /branches/targetandroid/utils/fpcm/fpcmake.inc
Modified : /branches/targetandroid/utils/fpcm/fpcmake.ini
Modified : /branches/targetandroid/utils/fpcm/fpcmmain.pp
Modified : /branches/targetandroid/utils/fpcmkcfg/Makefile
Modified : /branches/targetandroid/utils/fpcmkcfg/fppkg.inc
Modified : /branches/targetandroid/utils/fpcres/Makefile
Modified : /branches/targetandroid/utils/fpcreslipo/Makefile
Modified : /branches/targetandroid/utils/fpdoc/Makefile
Modified : /branches/targetandroid/utils/fpmc/Makefile
Modified : /branches/targetandroid/utils/fppkg/Makefile
Modified : /branches/targetandroid/utils/fppkg/fppkg.pp
Modified : /branches/targetandroid/utils/fprcp/Makefile
Modified : /branches/targetandroid/utils/h2pas/Makefile
Modified : /branches/targetandroid/utils/importtl/Makefile
Modified : /branches/targetandroid/utils/instantfpc/Makefile
Modified : /branches/targetandroid/utils/rmwait/Makefile
Modified : /branches/targetandroid/utils/tply/Makefile
git-svn-id: trunk@23604 -
2013-02-13 12:00:15 +00:00
svenbarth
7bad1763b8
Decrease amount of code duplication regarding handling of safecall and record constructors.
...
paramgr.pas, tparamanager:
+ add new method "handle_common_ret_in_param"
* extract common code (safecall + record constructor handling) from "ret_in_param" to "handle_common_ret_in_param" and call the latter in "ret_in_param"
[aarch64,arm,avr,i386,x86_64]/cpupara.pas, tCPUparamanager.ret_in_param:
* call "handle_common_ret_in_param" instead of implementing the same check again and again
ncgcal.pas, tcgcallnode.handle_return_value:
* move the check for (record) constructors to "tparamanager.handle_common_ret_in_param"
git-svn-id: trunk@23520 -
2013-01-25 20:39:28 +00:00
yury
e13e2e1697
* Turn off special handling of interrupt calling convention for i386-android.
...
git-svn-id: branches/targetandroid@23492 -
2013-01-22 14:43:42 +00:00
yury
c2fed960c9
* Add android to supported targets for assemblers. It fixes assembling for i386-android.
...
git-svn-id: branches/targetandroid@23441 -
2013-01-18 14:51:09 +00:00
yury
d26f0552a0
* Sync with trunk r23404.
...
* Regenerated makefiles.
git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
paul
b2a613c17f
compiler: implement record constructors + tests
...
git-svn-id: trunk@23395 -
2013-01-16 02:07:42 +00:00
paul
51825b6f2e
compiler: change ret_in_param to accept tabstractprocdef instead of tproccalloption to allow check more options (required for record constructor implementation)
...
git-svn-id: trunk@23394 -
2013-01-16 01:14:23 +00:00
sergei
af4935e346
+ Support dynamic copy relocations.
...
* For unresolved weak symbols, provide dynamic binding only if they are referenced via GOT or PLT (ld-compatible behavior).
* Made more TElfExeOutput properties/methods usable by descendant classes.
* x86_64/cpuelf.pas: some refactoring, handle DTPOFF relocations, prohibit TPOFF relocations in shared objects.
* i386/cpuelf.pas: set symref_from_text flags for copy relocations to work correctly.
git-svn-id: trunk@23375 -
2013-01-13 17:44:14 +00:00
Jonas Maebe
69c29a415f
* pass the procdef to getintparaloc instead of only the proccalloption, so
...
that the type of the parameters can be determined automatically
o added compilerproc declarations for all helpers called in the compiler
via their assembler name, so we can look up the corresponding procdef
git-svn-id: trunk@23325 -
2013-01-06 15:05:40 +00:00
pierre
eaeb63f86d
FreeBSD and OpenBSD also seem to use eax:edx for small strcut returns
...
git-svn-id: trunk@23253 -
2012-12-29 22:03:17 +00:00
sergei
0aa7204707
+ Added codes of dynamic relocations to TElfTarget; since most targets use similar dynamic relocation model differing only in code values, this will allow to do majority of handling in the base class.
...
git-svn-id: trunk@23154 -
2012-12-16 09:36:34 +00:00
florian
2ea6979277
* handle Movzl/Op/Mov optimization correctly, resolves #23431
...
git-svn-id: trunk@23128 -
2012-12-09 21:27:05 +00:00
sergei
c4d8396158
* Function RelocName made a member of TElfTarget, so it can be used outside of TElfExeOutput class.
...
* Methods ReportNonDSOReloc and ReportRelocOverflow moved to TElfExeOutput, they are applicable to all target-specific descendants.
git-svn-id: trunk@23094 -
2012-12-02 13:05:53 +00:00
sergei
d79761c607
* Changed TElfTarget from class to record, so it can contain data members while remaining statically allocated.
...
* Moved target-dependent constants into ElfTarget records, eliminates a lot of $ifdef's in ogelf.pas.
+ Added TElfTarget.loadsection hook and pass unknown sections to it.
git-svn-id: trunk@23090 -
2012-12-02 11:15:35 +00:00
sergei
a730830c19
* Factored code for allocating GOT slots into TElfExeOutput.AllocGOTSlot.
...
* Changed signature of GOTRelocPass1 to pass relocation index instead of relocation itself, because sometimes (e.g. when doing TLS relaxation) we need to process several subsequent relocations at once.
git-svn-id: trunk@23077 -
2012-11-29 06:37:28 +00:00
sergei
8ff1d76239
+ x86_64/cpuelf.pas: Support writing RELATIVE relocations separately from other ones.
...
+ i386/cpuelf.pas: Support R_386_TLS_IE and R_386_TLS_LE relocations.
git-svn-id: trunk@22961 -
2012-11-09 14:22:37 +00:00
sergei
12ad6704f6
- Removed a number of unused variables, reduces noise at compilation.
...
git-svn-id: trunk@22880 -
2012-10-30 11:55:59 +00:00
sergei
90d564e6a5
+ ELF linker: handle R_386_GOTOFF and R_X86_64_GOTOFF64 relocations
...
git-svn-id: trunk@22830 -
2012-10-23 14:13:31 +00:00
sergei
6d70009f06
+ ELF linker. Works on x86_64-linux and i386-linux good enough to pass the testsuite, but still requires a lot of work in nearly all aspects. In particular, no attempt to resolve symbols from shared libs is done, everything is just treated as imports. Symbol versioning isn't supported either.
...
x86_64 is the most elaborated, has some degree of indirect function (GNU_IFUNC) and TLS support, so it is even able to link with static libc/pthreads code (tw14265) and produce an executable that can launch (but still fails due to invalid DWARF unwind info).
i386 produces working shared libraries if they are compiled with -Cg, without one your mileage may vary. tw14265 does not link yet due to missing COMDAT group support.
git-svn-id: trunk@22775 -
2012-10-19 17:21:08 +00:00
pierre
2fdd8656d5
* Fix tw18702.pp i386-win32 specific failure (stack was not properly maintained)
...
git-svn-id: trunk@22617 -
2012-10-12 14:00:35 +00:00
Jonas Maebe
614436d8cb
* added pocall_mwpascal to cdecl_pocalls so we no longer have to explicitly
...
add it everywhere in the paramanagers (where it was often forgotten)
- removed places where it was explicitly added to cdecl_pocalls checks
+ test
git-svn-id: trunk@22616 -
2012-10-12 08:41:03 +00:00
florian
283ff05127
* merged avx support in inline assembler developed by Torsten Grundke
...
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
pierre
5b5a5ab7af
+ Add EXTDEBUG warning if pi_needs_got was not set in pass_1
...
git-svn-id: trunk@22449 -
2012-09-24 15:54:59 +00:00
Jonas Maebe
95c69f1f9e
* fixed function return location for small records on darwin/i386 and
...
iphonesim/i386 when not using cdecl/cppdecl/mwpascal calling conventions
git-svn-id: trunk@22350 -
2012-09-06 21:41:42 +00:00
florian
5b13ef1025
+ added sse/avx instructions sets introduced during the last years
...
git-svn-id: trunk@22287 -
2012-09-02 20:55:12 +00:00
Jonas Maebe
b1dc518ac4
* removed systems_need_16_byte_stack_alignment and use target_info.stackalign instead
...
git-svn-id: trunk@22279 -
2012-09-02 14:32:21 +00:00
Jonas Maebe
a5cb157091
* enable specifying the alignment mismatch of the frame/stack pointer
...
relative to the normal stack alignment of the target (e.g., when using
ebp as framepointer, all addresses are offset 8 to the stack pointer) in
the temp generator. This enables allocating temps/locals with the correct
alignment as long as the required alignment is not bigger than the
guaranteed stack pointer alignment (fixes mantis #15582 on systems where
the stack pointer is at least aligned to 16 bytes; e.g., not yet on
i386-platforms other than darwin)
git-svn-id: trunk@22277 -
2012-09-02 14:32:05 +00:00
Jonas Maebe
f7dbe6d7a6
* use a different register constant for EIP and RIP (fixes external
...
assembler writers on x86-64 after r22181, the shift in positions
caused every occurrence of RIP to become EIP in the assembler code)
git-svn-id: trunk@22234 -
2012-08-24 18:49:17 +00:00
sergei
c529356693
* Split most CPU-specific code from ogelf.pas into newly created cpuelf.pas units in CPU subdirectories.
...
git-svn-id: trunk@22208 -
2012-08-23 11:49:49 +00:00
florian
4dee21c60e
+ NR_DEFAULTFLAGS and RS_DEFAULTFLAGS for all CPUs with flags added
...
git-svn-id: trunk@22181 -
2012-08-22 19:38:27 +00:00
florian
74d3c8cc57
* on i386-win32 when using stdcall calling conventions, records with a size of 1,2 and 4 are returned in al/ax/eax now, resolves #22675
...
git-svn-id: trunk@22146 -
2012-08-20 16:57:53 +00:00
florian
4d86d25c6c
* -O4 switch for optimizations which are correct but which might have unexpected effects
...
like field reordering (possible problems cracker classes) or using ebp as normal register (broken
stack traces from dump_stack)
+ niln is also valid in a cse domain
* parameters passed by reference shall have a complexity >1
* load nodes from outer scopes shall have a complexity >1
* better cse debugging
+ more node types added to cse
* consider parameters passed by reference in cse
* take care of cse in parameters in simple cases
git-svn-id: trunk@22050 -
2012-08-09 18:58:54 +00:00
tom_at_work
810adb2f65
Merge with trunk r22040. Regenerated makefiles.
...
git-svn-id: branches/targetandroid@22046 -
2012-08-09 08:12:34 +00:00
florian
b330bba0bc
+ introduce -Oofastmath
...
* limit the application of the tree transformation introduced in r21986 to safe cases and -Oofastmath
git-svn-id: trunk@22040 -
2012-08-08 19:35:45 +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
0a1157da38
* fixed memory leaks in the compiler introduced in r21862 by marking and
...
releasing temporarily created function result locations
git-svn-id: trunk@21953 -
2012-07-23 13:49:29 +00:00
Jonas Maebe
3798b79fd7
+ optimization that (re)orders instance fields of Delphi-style classes in
...
order to minimise memory losses due to alignment padding. Not yet enabled
by default at any optimization level, but can be (de)activated separately
via -Oo(no)orderfields
o added separate tdef.structalignment method that returns the alignment
of a type when it appears in a record/object/class (factors out
AIX-specific double alignment in structs)
o changed the handling of the offset of a delegate interface
implemented via a field, by taking the field offset on demand
rather than at declaration time (because the ordering optimization
causes the offsets of fields to be unknown until the entire
declaration has been parsed)
git-svn-id: trunk@21947 -
2012-07-22 16:47:19 +00:00
florian
e10a95bf16
- removed unneeded firstcomplex calls, pass_left_right calls already firstcomplex
...
git-svn-id: trunk@21941 -
2012-07-21 07:09:06 +00:00
florian
3a9e3991be
* the switch -Oouseebp allows the i386 compiler to use ebp as normal register
...
the drawback of this is that get_caller_frame and get_caller_addr might not work
anymore because they make the wrong assumption (i.e. not required by the abi)
that ebp contains always a valid (not necessarily the current) frame pointer
git-svn-id: trunk@21918 -
2012-07-15 19:23:36 +00:00
florian
a38be24672
* get rid of tabs with wrong size
...
git-svn-id: trunk@21916 -
2012-07-15 16:56:11 +00:00
Jonas Maebe
d6066ed51a
* fixed compilation for i386/m68k after r21878/21879
...
git-svn-id: trunk@21884 -
2012-07-11 17:41:18 +00:00
tom_at_work
4150f0a2fb
Rebase with r21814
...
git-svn-id: branches/targetandroid@21815 -
2012-07-07 23:09:20 +00:00
Jonas Maebe
7a0ae38700
+ also specify the parameter def when allocating a parameter via
...
getintparaloc + adapted all call sites of getintparaloc. This
led to a number of additional, related changes:
o corrected the type information for some getintparaloc parameters
o don't allocate some intparalocs in cases they aren't used
o changed "const tvardata" parameter into "constref tvardata" for
fpc_variant_copy_overwrite to make pass-by-reference semantics
explicit
o moved a number of routines that now have to call find_system_type()
from cgobj to hlcgobj so that cgobj doesn't have to start depending
on the symtable unit
o added versions of the cpureg alloc/dealloc methods to hlcgobj that
call through to their cgobj counter parts, so we can call save/restore
the cpu registers before/after calling system helpers from hlcgobj
(not implemented in hlcgobj itself, because all basic register
allocator functionality is still part of cgobj/cgcpu)
git-svn-id: trunk@21696 -
2012-06-24 15:02:12 +00:00
Jonas Maebe
c3ea451aea
* set tcgpara.vardef when creating parameter info
...
git-svn-id: trunk@21693 -
2012-06-24 15:01:54 +00:00
Jonas Maebe
587244c088
* factored out common code from get_funcretloc()
...
* set tcgpara.def for the function return location (field introduced for and
already used by the JVM code generator, required for future hlcg
functionality)
git-svn-id: trunk@21691 -
2012-06-24 15:01:42 +00:00
pierre
b9f8934d7e
* Fix for go32v2 specific failure in test/cg/tcalval5 with -Aas option
...
git-svn-id: trunk@21443 -
2012-05-31 12:55:56 +00:00
tom_at_work
77a85b7448
* basic android/x86 support
...
git-svn-id: branches/targetandroid@21296 -
2012-05-14 21:14:12 +00:00
Jonas Maebe
edd42aa42a
* moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
...
future use by high level code generator targets
o this in turn required that all a_load*_loc* methods are called via
hlcg rather than via cg, since a location can be a subsetref/reg and
and those are no longer handled in tcg
o that then required moving several force_location_* routines into
thlcg because they use a_load_loc*, but did not take tdef size
parameters (which are required by the thlcg a_load_loc* routines)
o the only practical consequence is that from now on, you have to
use hlcg.location_force_mem/reg() (fpureg not yet) and
hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
might be involved
git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
Jonas Maebe
85a3fd3357
+ ossinttype/osuinttype defs that correspond to OS_SINT/OS_INT for use in
...
the high level code generator
git-svn-id: trunk@21279 -
2012-05-12 16:03:15 +00:00
sergei
78c0215447
Preparations to native threadvar support:
...
- i386/cgcpu.pas: removed segment check, rejecting references with segment here is too early. These references are passed to tcgx86.a_loadaddr_ref_reg, which can generate required code for them (or reject if they are not allowed for the target).
- ncgld.pas: removed "not tf_section_threadvars in target_info" condition, it is inverse to one on the following line, making non-generic branch impossible to execute.
+ Define FPC_SECTION_THREADVARS macro if corresponding flag is set for the target.
git-svn-id: trunk@21210 -
2012-05-03 16:26:44 +00:00
Jonas Maebe
dd03bc3e66
* i386 version of fix from r21113
...
git-svn-id: trunk@21127 -
2012-04-29 22:27:00 +00:00
Jonas Maebe
834026bfb5
* synchronised with trunk up to r21067
...
git-svn-id: branches/jvmbackend@21068 -
2012-04-26 21:24:20 +00:00
pierre
34bc5ea624
* Use localalignmax in calc_stackframe_size method
...
git-svn-id: trunk@20938 -
2012-04-20 12:13:52 +00:00
Jonas Maebe
aee5380ae0
* merged trunk up to r20882
...
o support for the new codepage-aware ansistrings in the jvm branch
o empty ansistrings are now always represented by a nil pointer rather than
by an empty string, because an empty string also has a code page which
can confuse code (although this will make ansistrings harder to use
in Java code)
o more string helpers code shared between the general and jvm rtl
o support for indexbyte/word in the jvm rtl (warning: first parameter
is an open array rather than an untyped parameter there, so
indexchar(pcharvar^,10,0) will be equivalent to
indexchar[pcharvar^],10,0) there, which is different from what is
intended; changing it to an untyped parameter wouldn't help though)
o default() support is not yet complete
o calling fpcres is currently broken due to limitations in
sysutils.executeprocess() regarding handling unix quoting and
the compiler using the same command lines for scripts and directly
calling external programs
o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
to the make command line
git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
Jonas Maebe
188677ea91
* fixed the offset of memory parameters allocated via getintparaloc():
...
the register parameters are not put on the stack, so don't count them
(only makes a practical difference for fixed stack targets, fixes
random crashes with webtbs/tw3870 on Darwin/i386)
git-svn-id: trunk@20499 -
2012-03-10 18:01:22 +00:00
florian
fc569e224d
* handle all operand combinations of xadd, resolves #21146
...
git-svn-id: trunk@20177 -
2012-01-25 21:26:59 +00:00
sergei
e11c880b1e
x86 assembler improvements:
...
* Don't generate rex.w for "CALL|JMP|LCALL|LJMP regmem", they are 64-bit by default.
* LCALL,LJMP flagged as calljump instructions.
* LCALL,LJMP encode only far jumps and don't accept register operands.
* GAS writer: fixed writing rip-relative operands of calljump instructions.
+ test.
git-svn-id: trunk@19413 -
2011-10-08 11:34:04 +00:00
florian
111d05c68f
o patch by Alexander Shishkin, resolves #20409
...
* eliminate warnings in compiler (i386 & i368->x86_64) and minor refactorings
- comment out unused vars and types
- comment out unneeded comparisons (Longword <=> 0)
- suppress some "comparison always true|false" warnings
- tweak visiblity sections
git-svn-id: trunk@19385 -
2011-10-05 20:11:09 +00:00
sergei
c6d382fe18
* Moved procedure genlinearlist from ti386casenode to tx86casenode. This optimization works well on x86_64, resulting in approximately twice less instructions than when using generic code.
...
git-svn-id: trunk@19363 -
2011-10-04 11:48:33 +00:00
florian
d7f7a9bb76
* patch by Alexander Shishkin to clean up $ifopt usage by $push/$pop, resolves #20346
...
git-svn-id: trunk@19256 -
2011-09-27 20:22:40 +00:00
sergei
d94460e3b3
* Made the x86-specific scalefactor optimization of tvecnode available on x86_64 as well, by moving update_reference_reg_mul method from ti386vecnode to newly introduced tx86vecnode.
...
git-svn-id: trunk@19245 -
2011-09-26 12:58:59 +00:00
florian
4868b09844
* patch by alexvin to replace $ifopt by $push/$pop, resolves #20332
...
git-svn-id: trunk@19239 -
2011-09-25 21:19:50 +00:00
florian
e8dafe4dde
* fixed change information for a lot of sse instructions
...
git-svn-id: trunk@18787 -
2011-08-20 12:28:49 +00:00
Jonas Maebe
28740dce2d
- removed extra "fordefinition" parameter again from tprocdef.mangledname(),
...
since the definition-specific adorning of JVM mangled names is Jasmin-
specific, and such code has no place in symdef
* moved code to adorn JVM mangled names for Jasmin definitions to agjasmin
git-svn-id: branches/jvmbackend@18346 -
2011-08-20 07:49:31 +00:00
Jonas Maebe
b023627f6a
* converted tcgcasenode.pass_generate_code() to hlcgobj
...
o changed type of opsize field of tcgcasenode from tcgsize into tdef,
and fixed compilation of other code generator units after this change
git-svn-id: branches/jvmbackend@18339 -
2011-08-20 07:48:33 +00:00
Jonas Maebe
b837694207
* factored out releasing an unused return value into
...
release_unused_return_value_cpu(), so it can be cleanly
overridden by cpu-specific code
git-svn-id: branches/jvmbackend@18322 -
2011-08-20 07:45:44 +00:00
Jonas Maebe
71deda6f50
+ added interface to ncgutil.gen_load_loc_cgpara() to hlcgobj + generic
...
implementation (without loc_©mmregister support)
* moved ncgutil.gen_load_return_value() to hlcgobj, and factored out
architecture-specific behaviour to load an uninitialised function result
into a virtual method (+ JVM-specific implementation of that method),
gen_load_uninitialized_function_result()
+ added hlcgx86 unit and thlcgx86 type to override the
thlcgobj.gen_load_uninitialized_function_result() method for x87
function results; the i386 and x86_64 units now instantiate thlcgx86
instead of thlcg2ll
* moved calling of ncgutil.gen_load_loc_cgpara() from ncgcal also to hlcgobj
-> returning function results works for JVM
git-svn-id: branches/jvmbackend@18317 -
2011-08-20 07:38:16 +00:00
Jonas Maebe
0ee702b3a2
* tprocdef.mangledname now gets an extra boolean parameter indicating
...
whether the mangled name is for defining a symbol, or for referencing
it later (e.g. for a call or load of its address). The reason is that
on the JVM both cases are different.
+ jvmdef unit to encode types according to the JVM rules
+ tprocdef.jvmmangledname() to encode a procdef's JVM mangled name
(the common part of defining/referencing it; tprocdef.mangledname
afterwards adorns it as required)
git-svn-id: branches/jvmbackend@18288 -
2011-08-20 07:22:00 +00:00
Jonas Maebe
72e9cfee24
* create/destroy also the high level code generator for all architectures,
...
so it can be used in generic code
git-svn-id: branches/jvmbackend@18280 -
2011-08-20 07:21:16 +00:00
florian
c011949765
+ iretq for x86_64
...
git-svn-id: trunk@18273 -
2011-08-19 12:56:26 +00:00
florian
8308b46a94
+ support for assembler instructions with four operands
...
+ support for insertq, resolves #19910
git-svn-id: trunk@18206 -
2011-08-14 16:46:35 +00:00
florian
ff5f311b34
- removed no more used constants
...
git-svn-id: trunk@18199 -
2011-08-13 20:54:01 +00:00