Commit Graph

341 Commits

Author SHA1 Message Date
florian
f619a1aaf6 * fld/fst can have a base register+offset
git-svn-id: trunk@22016 -
2012-08-05 18:34:13 +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
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
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
57b67dfa30 Better SP adjustments on entry/exit for ARM
If the needed adjustment is not expressible in a shifterconst, the old code
loaded a temporary register (fixed to r12) via a_load_const_reg and used it
to adjust the SP. Resulting in:

mov r12, #44
orr r12, r12, #4096
sub sp, sp, r12

The new code will try to split the adjustment into 2 shifterconstants and
will do two seperate adjustments:

sub sp, sp, #44
sub sp, sp, #4096

If that doesn't work we'll fall back to the old code. But that should
happen VERY rarely, only for stacks bigger than 256k which are not
expressible in 2 shifter constants.

git-svn-id: trunk@21863 -
2012-07-11 08:41:45 +00:00
florian
95732625cc * use r11 as a normal register if no frame pointer is needed
git-svn-id: trunk@21834 -
2012-07-09 17:17:23 +00:00
masta
dbf0404fb0 More consolidation of OP_SHL/SHR/ROR/SAR in ARM CodeGen
This removes the duplications in a_op_reg_reg_reg_checkoverflow.
OP_ROL stays seperate because it needs some special treatment again.

The code for OP_ROL was changed, previously it generated:
mov tempreg, #32
sub src1, tempreg, src1
mov dst, src2, ror src1

This would trash src1, which MIGHT be a problem, but i'm not totally
sure. But the mov/sub was replaced with rsb, so the new code looks like
this.

rsb tempreg, src1, #32
mov dst, src2, ror tempreg

If src1 gets freed afterwards the regallocator should be able to change
that into:

rsb src1, src1, #32
mov dst, src2, ror src1

git-svn-id: trunk@21804 -
2012-07-06 15:01:31 +00:00
masta
d2d5d17557 Consolidate handling of OP_SHL/SHR/ROL/ROR/SAR in ARM CodeGen
The previous code was full with duplicated code, this new version just
maps the OP_* to the correct SM_* and does some special handling for
OP_ROL which is done via OP_ROR.

git-svn-id: trunk@21801 -
2012-07-06 12:10:42 +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
masta
2768e0fc12 Folded Add/Sub/Or Splitter, lots of debug output
git-svn-id: trunk@21660 -
2012-06-20 12:39:28 +00:00
masta
92c47148cc Optimize 8/16 OP_NOT on ARM
This now generates:

mvn r0, r0, lsl #24/#16
mov r0, r0, lsr/asr #24/#16

The lsr/asr might be folded into a following instruction, making the
whole operation 1 cycle instead of 2-3 with the previous solution.

git-svn-id: trunk@21658 -
2012-06-20 12:39:09 +00:00
masta
0f3441a9c2 Split OP_ADD, OP_SUB, OP_AND and OP_ORR into multiple instructions if that can avoid constant construction or even loading from a pool.
OP_ADD, OP_SUB, OP_ORR will be split into two intructions if possible when a load/const
construction is required.

OP_AND is a bit different, because we can't just split it up, but we try
to find a two instruction BIC-equivalent to it.

Till now code like

a:= a and $FFFF;

produced code like

mov r0, $FF00
orr r0, r0, $FF
and r1, r1, r0

With this addition we produce code like:

bic r0, r0, $FF00
bic r0, r0, $FF

Saving us at least a cycle and in some cases also a load from the
constant-pool.

This uses the new split_into_shifter_const function.

git-svn-id: trunk@21647 -
2012-06-18 16:59:29 +00:00
masta
f11fbe527e Improve loading of ARM constant values
*  use split_into_shifter_const to reduce the MOV/ORR combination to a
   single check and allow a broader rang of combinations.
*  Introduce MVN/BIC combination to load values which have more 1 than 0
   bits set (like small negative values)

git-svn-id: trunk@21646 -
2012-06-18 16:59:24 +00:00
florian
45c70ec81c * patch by Nico Erfurth: Support the usage of BIC instead of AND on ARM
BIC clears the specified bits, while AND keeps them. The usage of BIC
allows a broader range of shifterconsts to be used on the ARM cpu, often
saving a cycle.

Previously code like:
Data:=Data and $FFFFFF00

would result in

mvn r1, #255
and r0, r0, r1

This patch changes this to

bic r0, r0, #255

git-svn-id: trunk@21510 -
2012-06-06 19:45:26 +00:00
florian
4ea1d22c5a * patch by Nico Erfruth: Support BX for function returns on armv5+
BX is supported from ARMv4T onwards, but i don't have a armv4t device to
test it.

Using BX instead of mov pc,lr allows for a better pipeline utilization
by enabling the CPUs branch predictor to work properly.

git-svn-id: trunk@21505 -
2012-06-06 19:42:26 +00:00
florian
c75486db89 * patch by Nico Erfurth:
Reorder unaligned Load sequence on ARM

The old version produced code like that:

ldrb rDEST, [rBASE]
ldrb rTemp, [rBASE, #1]
orr  rDEST, rDEST, rTEMP lsl #8 (2 stall cycles)
ldrb rTemp, [rBASE, #2]
orr  rDEST, rDEST, rTEMP lsl #16 (2 stall cycles)
ldrb rTemp, [rBASE, #3]
orr  rDEST, rDEST, rTEMP lsl #24 (2 stall cycles)

This creates a lot of stall-cycles on ARM Implementations with load
delay slots like Marvel Kirkwood or Intel XScale. With the usual up to 2
stall-cycles this code requires a total of 13 cycles (7 instructions + 6 stall
cycles) in best case.

The new code uses a second temp register to avoid the stall cycles.

ldrb rDEST, [rBASE]
ldrb rTemp1, [rBASE, #1]
ldrb rTemp2, [rBASE, #2]
orr  rDEST, rDEST, rTEMP1 lsl #8
ldrb rTemp1, [rBASE, #3]
orr  rDEST, rDEST, rTEMP2 lsl #16
orr  rDEST, rDEST, rTEMP1 lsl #24 (1 stall cycle)

The rescheduling and second register bring the total cycles down to 8.
If a later rescheduling should happen for the last orr it even can go
down to 7.

git-svn-id: trunk@21363 -
2012-05-22 19:09:20 +00:00
florian
5f0bcd9248 * patch by Nico Erfurth:
Optimize ARM OP_MUL/OP_IMUL for x*ispowerof2(const+1) cases

Calculations like a*7 can be optimized to a*8-a with the usage of RSB and left
shifts which can be done in a single cycle.

git-svn-id: trunk@21351 -
2012-05-20 20:50:04 +00:00
Jonas Maebe
bba4b02eb2 * use r7 instead of r11 as frame pointer on Darwin/iOS, and make sure r7
always points to the previous r7 on the stack (with the saved return
    address coming right after it) so that the debugger and crashreporter
    can use it for backtraces as specified in the ABI
   o changed NR_FRAME_POINTER_REG and RS_FRAME_POINTER_REG from a symbolic
     into a typed constant, and added a new method to tprocinfo that can
     be used to initialze it (so it can be inited to r7/r11 depending on
     the target platform)
  * allow using r9 on Darwin, it was only used by the system on iOS up to
    2.x, which we no longer support
  * prefer using r9 and r12 before r4..r11 on Darwin, because they are
    volatile and hence do not have to be saved

git-svn-id: trunk@20661 -
2012-03-29 20:54:33 +00:00
Jonas Maebe
6ba8dc7146 + support for the ARM hard float EABI on Linux (patch by Peter Green):
o new eabihf (hard float) abi
   o vfpv3_d16 variant of VFP (default variant used by EABI assemblers: VFPv3
     with only 16 double registers instead of 32) and pass it to GNU as
   o make the odd numbered single precision floating point VFP registers
     available for explicit allocation for use by the calling convention
  * fixed copy/paste error in stdname of S30 register
  -> use -dFPC_ARMHF to create an ARM eabi hard float compiler
  (mantis #21554)

git-svn-id: trunk@20660 -
2012-03-29 20:50:09 +00:00
florian
841d67ec81 * don't waste an extra register when copying 4 bytes
git-svn-id: trunk@20475 -
2012-03-05 19:12:00 +00:00
pierre
42c98f3cd5 Override abstract method to abvoid warning at compilation time
git-svn-id: trunk@19578 -
2011-11-03 10:08:12 +00:00
florian
ce61891ca3 * offset used by A_LDF,A_STF,A_FLDS,A_FLDD,A_FSTS,A_FSTD must be dividable by 4
git-svn-id: trunk@19270 -
2011-09-28 19:01:09 +00:00
Jonas Maebe
2b11fd2bef * cpus that only understand Thumb-2 don't support "blx <imm>"
git-svn-id: trunk@19238 -
2011-09-25 20:44:39 +00:00
florian
5fa184c952 + patch by Jeppe Johansen to make use of the div/udiv instruction on arm7m, resolves #20022
* explicitly make symbol addressing PC relative

git-svn-id: trunk@19221 -
2011-09-24 21:41:01 +00:00
Jonas Maebe
852ae48cb7 * also use blx instead of bl for direct calls on ARMv5+, since the target
may be thumb(2) (mantis #19896)
  * don't conditionalize "blx <imm target>", because that's not a valid
    encoding

git-svn-id: trunk@18984 -
2011-09-05 20:33:15 +00:00
florian
26850e3425 * fix full cycle after adding new boolean types
git-svn-id: branches/pasboolxx@17847 -
2011-06-27 20:11:08 +00:00
florian
77f2d6cc0d * introduce usage of TCGInt in the code generator units
git-svn-id: trunk@17459 -
2011-05-14 17:58:23 +00:00
svenbarth
35b47e491c Rebase to revision 17306
git-svn-id: branches/svenbarth/classhelpers@17314 -
2011-04-13 10:04:14 +00:00
florian
8bff2a0de4 * patch by Jeppe Johansen to fix thumb2 epilog generation, resolves #18392
git-svn-id: trunk@17252 -
2011-04-05 19:25:20 +00:00
svenbarth
96116a6c3a Several adjustments because virtual methods in helpers are just normal methods and a VMT isn't generated for them either.
* $CPU/cgcpu.pas: disable the generation of VMT loading code
* dbgstabs.pas, dbgdwarf.pas: treat virtual methods of helpers as normal methods
* ncgcal.pas: don't register virtual helper methods for WPO 
* ncgrtti.pas: write virtual helper methods as normal methods to RTTI
* nobj.pas: correctly handle final and override cases in helpers
* pdecvar.pas: property getters
* rautils.pas: no VMT offset in records

git-svn-id: branches/svenbarth/classhelpers@17150 -
2011-03-20 10:41:45 +00:00
svenbarth
80e6498921 Rebase to revision 17096
git-svn-id: branches/svenbarth/classhelpers@17099 -
2011-03-09 16:29:47 +00:00
Jonas Maebe
b8e9fd5c00 * use blx also for ARMv5, since it works on non-T variants and is required
for correct operation on T-variants (patch by Dejan Boras, mantis #18819)

git-svn-id: trunk@17001 -
2011-02-25 19:46:35 +00:00
Jonas Maebe
780e75bfac o patch by Jeppe Johansen to fix mantis #17472:
* generate add.w instead of add for thumb-2 in case one of the registers
      is > r8
    * add register interferences for the "add" instruction so the register
      allocator can detect invalid instruction forms (even for assembler code)
    * fixed error in thumb2.inc detected by the previous change

git-svn-id: trunk@16633 -
2010-12-24 15:54:39 +00:00
paul
b317139006 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
git-svn-id: branches/paul/extended_records@16530 -
2010-12-10 06:50:58 +00:00
Jonas Maebe
c44d79f3ba * fix the value of the frame pointer for Thumb-2 after r14317
(patch by Jeppe Johansen, mantis #18025)

git-svn-id: trunk@16416 -
2010-11-24 10:07:49 +00:00
Jonas Maebe
f13f6627c4 * moved use_fixed_stack from cgutils to a method in paramgr so it can
be used outside the code generator
  * renamed tabstractprocdef.requiredargarea into callerargareasize,
    and also added calleeargareasize field; added init_paraloc_info(side)
    method to init the parameter locations and init those size fields and
    replaced all "if not procdef.has_paraloc_info then ..." blocks with
    procdef.init_paraloc_info(callersize)"
  * moved detection of stack tainting parameters from psub to
    symdef/tabstractprocdef
  + added tcallparanode.contains_stack_tainting_call(), which detects
    whether a parameter contains a call that makes use of stack paramters
  * record for each parameter whether or not any following parameter
    contains a call with stack parameters; if not, in case the current
    parameter itself is a stack parameter immediately place it in its
    final location also for use_fixed_stack platforms rather than
    first putting it in a temporary location (part of mantis #17442)
  * on use_fixed_stack platforms, always first evaluate parameters
    containing a stack tainting call, since those force any preceding
    stack parameters of the current call to be stored in a temp location
    and copied to the final location afterwards

git-svn-id: trunk@16050 -
2010-09-26 21:24:14 +00:00
Jonas Maebe
356026f849 * use new_section() instead of tai_section.create() everywhere
- sort of reverted r14134, which is no longer required after the above
    change (new_section() inserts the alignment itself)
  * made the tai_section.create() constructor private so it cannot be
    called directly anymore

git-svn-id: trunk@15482 -
2010-06-26 10:50:14 +00:00
Jonas Maebe
283018a3bf * changed tprocdef.funcretloc[] from a tlocation into a tcgpara so it can
represent complex locations (required for full x86-64 ABI support,
    which is not yet implemented) -> lots of special result handling
    code has been removed and replaced by the parameter handling
    routines
  + added support for composite parameters (and hence function
    results) to tcg.a_load_ref_cgpara() (so it can be used for
    handling, e.g., 64 bit parameters on 32 bit platforms)
  * the above fixed writing past the end of allocated memory when
    handling records returned in registers on x86-64 whose size is
    not a multiple of 8 bytes (mantis #16357)
  - removed the x86-64 and PPC specific versions of a_load_ref_cgpara(),
    as they are now handled correctly by the generic version
  * moved the responsibility of allocating tcgpara cpu registers
    (using paramanager.allocparaloc()) from the callers of
    cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods
    themselves (so the register allocation can be done efficiently
    when dealing with function results)
  * for the above, renamed paramanager.alloc/freeparaloc() to
    paramanager.alloc/freecgpara(), and use paramanager.allocparaloc()
    to allocate individual pcgparalocations instead
  * fixed the register size of SSE2 function result registers for
    x86-64 (when used for floating point), which results in removing
    a few superfluous "movs? %xmm0,%xmm0" instructions
  * fixed compilation of paramanagers of avr, m68k and mips after r13695
    and also updated them for these new changes

git-svn-id: trunk@15350 -
2010-05-30 21:12:57 +00:00
Jonas Maebe
9bc15a5f61 * renamed a_param_* to a_load_*_cgpara
git-svn-id: trunk@15305 -
2010-05-22 09:07:21 +00:00
Jonas Maebe
fbebd87593 * use BLX instead of "mov r14, r15; mov r15, reg" for a_call_reg on ARMv6
and above, so this also works when calling thumb code (should actually
    also be done for ARMv5T, but we don't have a monicker for that yet)
  * use BX instead of "mov r15, r14" for simple returns from subroutines
    on ARMv6+ to support returning to thumb code from ARM code (idem)

git-svn-id: trunk@14332 -
2009-12-04 22:38:50 +00:00
Jonas Maebe
d1538ab023 o added ARM VPFv2/VFPv3 support:
+ RTL support:
      o VFP exceptions are disabled by default on Darwin,
        because they cause kernel panics on iPhoneOS 2.2.1 at least
      o all denormals are truncated to 0 on Darwin, because disabling
        that also causes kernel panics on iPhoneOS 2.2.1 (probably
        because otherwise denormals can also cause exceptions)
    * set softfloat rounding mode correctly for non-wince/darwin/vfp
      targets
    + compiler support: only half the number of single precision
      registers is available due to limitations of the register
      allocator
    + added a number of comments about why the stackframe on ARM is
      set up the way it is by the compiler
    + added regtype and subregtype info to regsets, because they're
      also used for VFP registers (+ support in assembler reader)
    + various generic support routines for dealing with floating point
      values located in integer registers that have to be transferred to
      mm registers (needed for VFP)
    * renamed use_sse() to use_vectorfpu() and also use it for
      ARM/vfp support
    o only superficially tested for Linux (compiler compiled with -Cpvfpv6
      -Cfvfpv2 works on a Cortex-A8, no testsuite run performed -- at least
      the fpu exception handler still needs to be implemented), Darwin has
      been tested more thoroughly
  + added ARMv6 cpu type and made it default for Darwin/ARM
  + ARMv6+ implementations of atomic operations using ldrex/strex
  * don't use r9 on Darwin/ARM, as it's reserved under certain
    circumstances (don't know yet which ones)
  * changed C-test object files for ARM/Darwin to ARMv6 versions
  * check in assembler reader that regsets are not empty, because
    instructions with a regset operand have undefined behaviour in that
    case
  * fixed resultdef of tarmtypeconvnode.first_int_to_real in case of
    int64->single type conversion
  * fixed constant pool locations in case 64 bit constants are generated,
    and/or when vfp instructions with limited reach are present

  WARNING: when using VFP on an ARMv6 or later cpu, you *must* compile all
    code with -Cparmv6 (or higher), or you will get crashes. The reason is
    that storing/restoring multiple VFP registers must happen using
    different instructions on pre/post-ARMv6.

git-svn-id: trunk@14317 -
2009-12-03 22:46:30 +00:00
florian
0c8546f94c * more MIPS code of David Zhang integrated
git-svn-id: trunk@14228 -
2009-11-20 14:46:45 +00:00
Jonas Maebe
3a774ce66a * fixed alignment for (non-)lazy symbol sections
* converted lazy symbol directive in arm/cgcpu.pas to section, forgotten
    in r14128 (fixes mantis #15047)

git-svn-id: trunk@14135 -
2009-11-10 10:43:15 +00:00
florian
515774b864 * merged armthum branch
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U    rtl/arm/setjump.inc
A    rtl/arm/thumb2.inc
U    rtl/arm/divide.inc
A    rtl/embedded/arm/stm32f103.pp
U    rtl/inc/system.inc
U    compiler/alpha/cgcpu.pas
U    compiler/sparc/cgcpu.pas
U    compiler/i386/cgcpu.pas
U    compiler/ncgld.pas
U    compiler/powerpc/cgcpu.pas
U    compiler/avr/cgcpu.pas
U    compiler/aggas.pas
U    compiler/powerpc64/cgcpu.pas
U    compiler/x86_64/cgcpu.pas
U    compiler/cgobj.pas
U    compiler/psystem.pas
U    compiler/aasmtai.pas
U    compiler/m68k/cgcpu.pas
U    compiler/ncgutil.pas
U    compiler/rautils.pas
U    compiler/arm/raarmgas.pas
U    compiler/arm/armatts.inc
U    compiler/arm/cgcpu.pas
U    compiler/arm/armins.dat
U    compiler/arm/rgcpu.pas
U    compiler/arm/cpubase.pas
U    compiler/arm/agarmgas.pas
U    compiler/arm/cpuinfo.pas
U    compiler/arm/armop.inc
U    compiler/arm/narmadd.pas
U    compiler/arm/aoptcpu.pas
U    compiler/arm/armatt.inc
U    compiler/arm/aasmcpu.pas
U    compiler/systems/t_embed.pas
U    compiler/psub.pas
U    compiler/options.pas

git-svn-id: trunk@13801 -
2009-10-04 09:03:44 +00:00
Jonas Maebe
a6f20cdba9 * align the stack pointer to alignment.localalignmax, fixes crashes on
ARM EABI systems because of a missing 8 byte alignment (mantis
    #11595, #13391 and #13454)

git-svn-id: trunk@13030 -
2009-04-24 12:35:26 +00:00
Jonas Maebe
7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00
Jonas Maebe
a23630260b + "weakexternal" support for imported procedures and variables.
the syntax is exactly the same as for "external", except for
    the keyword. It is currently only active for Darwin targets.
    It should also work at least for Linux targets, but only with
    the GNU assembler (which is why it is not activated there)
  + test for this functionality

git-svn-id: trunk@12009 -
2008-11-01 18:38:32 +00:00
Jonas Maebe
5347e536c2 + support for generating non-pic darwin/arm call stubs
+ write the header for non-pic darwin/arm call stubs properly in aggas
  * r9 is not available for general use on darwin/arm according to the llvm
    code generator

git-svn-id: trunk@11862 -
2008-10-04 14:07:52 +00:00
yury
4cabbe0e39 * Fixed compiler cycling with enabled range and overflow checking.
git-svn-id: trunk@11489 -
2008-07-29 21:11:03 +00:00
florian
fe7cba52dc + support of inlined ror/rol on arm
git-svn-id: trunk@11473 -
2008-07-28 15:48:38 +00:00
florian
1afb1aa9cc + ror/rol functions
+ internal compiler support for ror/rol on i386

git-svn-id: trunk@11466 -
2008-07-27 17:12:32 +00:00
yury
a6eb251cee * Define dummy tcgarm.g_stackpointer_alloc to fix abstract warning.
* Suppressed unreachable code warnings.
* Now ARM compiler compiles without warnings and notes.

git-svn-id: trunk@11456 -
2008-07-23 13:22:36 +00:00
yury
a039dd6942 * Fixed warnings about hiding inherited method.
git-svn-id: trunk@11449 -
2008-07-23 11:51:19 +00:00
yury
6c6bf452ca * Fixed level 2 comment warnings.
git-svn-id: trunk@11441 -
2008-07-23 10:08:48 +00:00
florian
67ef9f20ae * test for previous commit
* fixed wrapper generation for bigger offsets as well

git-svn-id: trunk@11059 -
2008-05-23 16:16:34 +00:00
florian
ea46cb4218 * take care of the maximum constant size when creating interface wrappers, resolves #10831
git-svn-id: trunk@11058 -
2008-05-23 16:02:17 +00:00
yury
60ecb64346 * Fixed loading of single floating point values from memory to register for ARM hardfloat.
git-svn-id: trunk@10826 -
2008-04-27 20:47:52 +00:00
yury
b9431c876e * More complete fix for bug #10515. Thanks to Jonas for suggestion.
* Fixed warnings in tcnvint6.pp

git-svn-id: trunk@10765 -
2008-04-23 08:22:27 +00:00
yury
88597d23c5 * Fixed tcgarm.a_load_ref_reg to load word values from location with alignment 2 using unaligned load.
git-svn-id: trunk@10754 -
2008-04-22 08:46:19 +00:00
yury
9222540e84 * Small optimization.
git-svn-id: trunk@10692 -
2008-04-18 11:46:39 +00:00
yury
95ea5d87dd * Fixed int to int conversion in ARM code generator.
+ Added new test to detect more bugs in int to int conversion.

git-svn-id: trunk@10691 -
2008-04-18 11:31:12 +00:00
yury
ec943198fd * Properly fill treference.alignment when variable is loaded by tcgloadnode. It allows code generator to insert unaligned handling if needed.
* Improved generic a_load_ref_reg_unaligned if ref alignment is 2.
* Improved unaligned load/store of register for ARM.
* It fixes passing records by value on ARM.
+ New test.

git-svn-id: trunk@10681 -
2008-04-16 23:01:20 +00:00
yury
cf235145cb * Fixed a_load_reg_reg for arm.
* Fixed sign/zero-extension in second_int_to_bool for all CPUs. x86 and pppc were not affected by this bug, but I fixed it for all CPUs for consistency.
* cg/tcnvint1 is passed on arm now.

git-svn-id: trunk@10669 -
2008-04-15 20:44:27 +00:00
micha
6910b0ed40 * fix arm(eb) load/store of smaller than register sizes
git-svn-id: trunk@10500 -
2008-03-17 21:27:44 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
florian
1e618b499d * fixes unaligned load_ref_reg on little endian arm
git-svn-id: trunk@8972 -
2007-10-28 15:30:50 +00:00
florian
00d6a03b2c + default code now preserves mm registers
* save|restore_standard_registers => save|restore_registers

git-svn-id: trunk@8954 -
2007-10-27 12:02:28 +00:00
micha
bae0251549 * fix big endian arm loading (fixes issue #8752)
git-svn-id: trunk@8862 -
2007-10-20 14:31:08 +00:00
peter
9f0ca44c94 * new tf_smartlink_library flag
* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
2007-10-01 16:55:08 +00:00
florian
b984b2227f * improved constant loading for arm
git-svn-id: trunk@8429 -
2007-09-11 19:28:48 +00:00
yury
bd0cafd545 * fixed ARM stackframe optimization when float registers are used.
git-svn-id: trunk@8032 -
2007-07-12 21:55:34 +00:00
florian
eb8b2fb138 * be more carefull with unaligned load optimization
git-svn-id: trunk@6356 -
2007-02-07 17:43:56 +00:00
florian
35b9bfc83e * several range check errors fixed
git-svn-id: trunk@6324 -
2007-02-03 19:36:06 +00:00
florian
01b23ca896 * improved last commit
git-svn-id: trunk@6309 -
2007-02-02 22:47:29 +00:00
florian
d0b34fef46 * safe an loadaddr for simple references when generating unaligned accesses
git-svn-id: trunk@6308 -
2007-02-02 22:43:30 +00:00
florian
c16c124562 * handle pc relative offsets in ldf/stf correctly
git-svn-id: trunk@6115 -
2007-01-21 22:55:12 +00:00
Jonas Maebe
e815b923d5 * a_loadfpu_* gets two size parameters: fromsize and tosize
* fixed downsizing the precision of floating point values
  * floating point constants are now treated using only the minimal
    precision required (e.g. 2.0 is now a single, 1.1 extended etc)
    (Delphi compatible)

git-svn-id: trunk@5927 -
2007-01-12 18:33:51 +00:00
yury
2a274aa510 * fixed tbs/tb0350.pp.
* removed unused local variables.

git-svn-id: trunk@5667 -
2006-12-21 21:18:38 +00:00
yury
c427fcf902 * fixed register to register conversion for ARM.
git-svn-id: trunk@5537 -
2006-12-03 22:01:33 +00:00
yury
d4335749ec * reverted r5481. That order of instructions can be executed more effectively on newer ARM CPUs.
git-svn-id: trunk@5484 -
2006-11-26 11:42:29 +00:00
florian
01a20b25a2 * don't reuse registers
git-svn-id: trunk@5483 -
2006-11-26 11:11:14 +00:00
yury
35b1014207 * more usual order of instructions.
git-svn-id: trunk@5481 -
2006-11-26 10:06:12 +00:00
yury
135c0ecfb7 * fixed passing float constants as part of "array of const" parameter for ARM.
git-svn-id: trunk@5403 -
2006-11-16 17:01:17 +00:00
florian
3f77637b56 * set is_jmp flag correctly
git-svn-id: trunk@5399 -
2006-11-16 09:43:58 +00:00
yury
8abe2d365e * Implemented stackframe optimization for ARM CPU.
git-svn-id: trunk@5374 -
2006-11-14 16:18:49 +00:00
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
florian
922de0bc8d * fixed wrong load_ref_ref
git-svn-id: trunk@5092 -
2006-10-30 11:48:37 +00:00
florian
67ba76f090 * several arm fixes
git-svn-id: trunk@4742 -
2006-09-27 21:05:05 +00:00
florian
e08bf34689 * stack page initialization disabled, not necessary according to Yury Sidorov
git-svn-id: trunk@4539 -
2006-09-02 20:43:59 +00:00
florian
7145eeb4b9 * bugs in wince stack initialization fixed
git-svn-id: trunk@4517 -
2006-08-29 19:32:40 +00:00
florian
e08a24562c * experimental wince stack initialization fix
git-svn-id: trunk@4516 -
2006-08-29 16:01:52 +00:00
yury
0018d7b920 * final fix for overflow checking for ARM.
git-svn-id: trunk@4103 -
2006-07-06 18:54:19 +00:00
yury
0c396ad3da * proper fix for rev. 4097.
git-svn-id: trunk@4099 -
2006-07-06 12:23:29 +00:00
yury
76921030e9 * fixed bug #6079 for ARM CPU.
git-svn-id: trunk@4097 -
2006-07-06 10:27:23 +00:00
florian
bbc42e8503 * made ie unique
git-svn-id: trunk@3737 -
2006-05-29 19:50:12 +00:00
florian
30e7d87c11 * fixed loading of floating point constants
git-svn-id: trunk@3667 -
2006-05-25 09:57:07 +00:00
florian
2ddd617971 * fixed stm/ldm for usage with large temp. areas
git-svn-id: trunk@3633 -
2006-05-22 21:00:55 +00:00
florian
8bd674af24 * another patch from Roozbeh GHolizadeh
* improved concatcopy code generation
  * improved constant loading
  * improved multiplication code generation

git-svn-id: trunk@3471 -
2006-05-10 20:07:29 +00:00
florian
fa03ab8fe5 * fixed arm compiler by adding a_call_ref
git-svn-id: trunk@3416 -
2006-05-03 13:53:40 +00:00
florian
09ad199450 * cleanup and bug fixing of unaligned data handling code by Roozbeh GHolizadeh
git-svn-id: trunk@3377 -
2006-04-30 08:07:29 +00:00
florian
13493a5355 * fixed copying of unaligned value parameters
git-svn-id: trunk@3369 -
2006-04-29 20:13:57 +00:00
florian
053bff4295 + improved concatcopy from Roozbeh GHolizadeh
git-svn-id: trunk@3355 -
2006-04-29 13:12:48 +00:00
florian
0780616dee + unaligned load/store support from Roozbeh GHolizadeh
git-svn-id: trunk@3351 -
2006-04-29 11:44:44 +00:00
peter
0ec2921bbe * split newasmsymbol to refasmsymbol and defineasmsymbol
git-svn-id: trunk@3057 -
2006-03-27 11:45:18 +00:00
florian
1b5e2b67b1 * compilation fixed
git-svn-id: trunk@2947 -
2006-03-17 21:16:15 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
peter
b6e35a200e * rewrite of optimizer options
git-svn-id: trunk@2901 -
2006-03-13 09:05:50 +00:00
florian
dae84f282f * fixed handling of doubles in softemu mode if they are split between register and memory
git-svn-id: trunk@2047 -
2005-12-24 17:43:57 +00:00
florian
12a1449884 * ldf*/stf* can handle only offsets with max. +/- 1020, so generate never a pc relative symbol
git-svn-id: trunk@1649 -
2005-11-04 23:56:06 +00:00
florian
cf3c9bdcad * a_jmp_always fixed, it doesn't generate a new symbol anymore
git-svn-id: trunk@1534 -
2005-10-19 14:38:30 +00:00
peter
a3ab2053c9 * support multiple asmlabel types, renamed getlabel to
getjumplabel and added type para to getlabel for specific types
  * moved lineinfo generation from assemble and aggas to dbgstabs

git-svn-id: trunk@1120 -
2005-09-18 21:16:10 +00:00
florian
d280ed6e8b * continued to work on arm binary writer, started to fix operand matching
git-svn-id: trunk@1073 -
2005-09-11 10:01:54 +00:00
florian
adb193497d + softfloat support for wince
* more units are build for wince

git-svn-id: trunk@959 -
2005-08-28 12:40:43 +00:00
florian
c15f720867 * fixed passing of floats for cdecl procedures/functions
git-svn-id: trunk@726 -
2005-07-21 20:12:28 +00:00
florian
94b97e8898 * loading of references with small offsets fixed
git-svn-id: trunk@575 -
2005-07-03 16:27:11 +00:00
peter
c1b2e1aac5 * check function/procedure type when adding a proc definition
git-svn-id: trunk@546 -
2005-06-30 14:56:05 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
Jonas Maebe
ec959955bd * fixed generic jumps optimizer and enabled it for ppc (the label table
was not being initialised -> getfinaldestination always failed, which
    caused wrong optimizations in some cases)
  * changed the inverse_cond into a function, because tasmcond is a record
    on ppc
  + added a compare_conditions() function for the same reason
2005-02-26 01:26:59 +00:00
florian
8305aa8781 * fixed storing of floating point registers for procedures with large temp. area
* fixed int64 comparisation
2005-02-16 22:02:26 +00:00
florian
f3b711d3bf * don't generate overflow results if they aren't necessary
* fixed op_reg_reg_reg_reg on arm
2005-02-15 19:53:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
22d9294ab3 + overflow checking for the arm 2005-02-13 18:55:19 +00:00
florian
bd31b225a0 * fixed compilation of arm compiler 2005-01-30 14:43:40 +00:00
florian
eca0cb266f * not operator for byte/word fixed 2005-01-04 21:00:48 +00:00
florian
468eca38bd * load_reg_reg fixed 2005-01-04 20:15:05 +00:00
florian
6ab9be6a5d * implemented nostackframe calling convention directive 2005-01-04 15:36:32 +00:00
florian
e2ec30866a * fixed OP_SUB for negative constants fitting in the shifter 2004-11-06 15:18:57 +00:00
florian
73c30d6579 * fixed arm compilation with cgutils
* ...
2004-11-01 17:41:28 +00:00
florian
7f20bc1c96 * fixed ie with pi_do_call 2004-10-31 16:47:43 +00:00
florian
36ca15cf07 * fixed compilation of system unit on arm 2004-10-31 16:04:30 +00:00
florian
c8d7f6be2b * another couple of arm fixed 2004-10-31 12:37:11 +00:00
florian
410d01458c * fixed several arm compiler bugs 2004-10-24 17:32:53 +00:00
peter
2ee2004032 * fixed compilation with removed loadref 2004-10-24 11:53:45 +00:00
florian
60f0434585 * fixed compilation of arm compiler 2004-10-24 07:54:25 +00:00
peter
8b3e00244f * length parameter for copyvaluearray changed to tlocation 2004-10-11 15:46:45 +00:00
florian
5062c04096 * fixed problem with cpu interferences 2004-07-03 19:29:14 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00
florian
6e4b98f913 * concatcopy with len=0 exits now immediatly 2004-03-31 19:13:04 +00:00
florian
aae508c277 + arm floating point register saving implemented
* hopefully stabs generation for MacOSX fixed
  + some defines for arm added
2004-03-29 19:19:35 +00:00
florian
9594866b30 * optimized mul code generation 2004-03-14 21:42:24 +00:00
florian
16366a944c * spilling problem fixed
* handling of floating point memory references fixed
2004-03-14 16:15:39 +00:00
florian
164a5bb1d4 + fixed code generation for cmn 2004-03-10 22:35:40 +00:00
florian
10e765329d * fixed arm compilation
* cleaned up code generation for exported linux procedures
2004-03-06 20:35:19 +00:00
olle
4fecc1a56f * big transformation of Tai_[const_]Symbol.Create[data]name* 2004-03-02 00:36:32 +00:00
peter
8c5b0f7d82 * first try to get cpupara working for x86_64 2004-02-04 22:01:13 +00:00
florian
ff303ba334 * handling of floating point references fixed 2004-01-29 17:09:32 +00:00
florian
de4fa4e7e7 * fixed another couple of arm bugs 2004-01-28 15:36:46 +00:00
florian
c77ec09d49 * fixed code generation for math inl. nodes
* more code generator improvements
2004-01-27 15:04:06 +00:00
florian
35110d8ef5 * fixed several arm issues 2004-01-26 19:05:56 +00:00
florian
8d335b9466 * fixed some spilling stuff
+ not(<int64>) implemented
  + small set comparisations implemented
2004-01-24 20:19:46 +00:00
florian
0bb8e3912f * fixref fixed if index, base and offset were given 2004-01-24 01:33:20 +00:00
florian
e7aba71412 * fixed several issues with flags 2004-01-22 20:13:18 +00:00
florian
3ab069324a * op_const_reg_reg with OP_SAR fixed 2004-01-22 02:22:47 +00:00
florian
703af0f1f4 * improved register usage
+ implemented second_cmp64bit
2004-01-22 01:47:15 +00:00
florian
af3d31eceb * fixed handling of max. distance of pc relative symbols 2004-01-21 19:01:03 +00:00
florian
3b21b99111 * fixed register allocator problems with concatcopy 2004-01-21 15:41:56 +00:00
florian
75e2de9f2c + reintroduce implemented 2004-01-21 14:22:00 +00:00
florian
e680460234 * fixed a_cmp_const_reg_label
* fixed volatile register handling which was broken by my last patch
2004-01-21 01:22:35 +00:00
florian
162ff2e6d4 * fixed a_call_reg
+ implemented paramgr.get_volative_registers
2004-01-20 23:18:00 +00:00
peter
1c7e6fc380 * sparc updates
* use registertype in spill_register
2003-12-26 14:02:30 +00:00
florian
78aeec22ca * arm compiler compilation fixed 2003-12-18 17:06:21 +00:00
florian
dd8f11e8e1 * fixed ldm/stm arm assembler reading
* fixed a_load_reg_reg with OS_8 on ARM
  * non supported calling conventions cause only a warning now
2003-12-08 17:43:57 +00:00
florian
1a87a5ed45 * fixed several arm calling conventions issues
* fixed reference reading in the assembler reader
  * fixed a_loadaddr_ref_reg
2003-12-03 17:39:04 +00:00
florian
a567970402 * fixed several arm related problems 2003-11-30 19:35:29 +00:00
florian
4584775cbe * changed some types to prevend range check errors 2003-11-24 15:17:37 +00:00
florian
256299c274 * fixed reading of reg. sets in the arm assembler reader 2003-11-21 16:29:26 +00:00
florian
bbf7300a0c * Florian's culmutative nr. 1; contains:
- invalid calling conventions for a certain cpu are rejected
    - arm softfloat calling conventions
    - -Sp for cpu dependend code generation
    - several arm fixes
    - remaining code for value open array paras on heap
2003-11-07 15:58:32 +00:00
florian
a9d9a15e20 * fixed ARM for new reg. allocation scheme 2003-11-02 14:30:03 +00:00
florian
1df13c788c * fixed some MMX<->SSE
* started to fix ppc, needs an overhaul
  + stabs info improve for spilling, not sure if it works correctly/completly
  - MMX_SUPPORT removed from Makefile.fpc
2003-10-11 16:06:42 +00:00
florian
8f66389b46 * improved arm code generation
* move some protected and private field around
  * the temp. register for register parameters/arguments are now released
    before the move to the parameter register is done. This improves
    the code in a lot of cases.
2003-09-11 11:54:59 +00:00
florian
df906eda61 * some assembling problems fixed
* improved loadaddr_ref_reg
2003-09-09 12:53:39 +00:00
florian
e78dd95d0b * fixed exit code (no preindexed addressing mode in LDM) 2003-09-06 16:45:51 +00:00
florian
bd6bf8ac94 * fixed stm and ldm to be usable with preindex operand 2003-09-06 11:21:49 +00:00
florian
1a95384ec1 * arm is working again as before the new register naming scheme was implemented 2003-09-05 23:57:01 +00:00
florian
024d08e05a * ARM compiler compiles again 2003-09-04 21:07:03 +00:00
florian
0d3832776f * first bunch of adaptions of arm compiler for new register type 2003-09-04 00:15:28 +00:00
florian
91533b5d5a * initial revision of new register naming 2003-09-03 19:10:30 +00:00
florian
220e05dd5e * fixed arm concatcopy
+ arm support in the common compiler sources added
  * moved some generic cg code around
  + tfputype added
  * ...
2003-09-03 11:18:36 +00:00
florian
6264028af1 * fixed reference handling
* fixed operand postfix for floating point instructions
  * fixed wrong shifter constant handling
2003-09-01 15:11:16 +00:00
florian
e36c23db74 * results of work on arm port last weekend 2003-09-01 09:54:57 +00:00
florian
301df6dab9 * fixed procedure entry/exit code
* started to fix reference handling
2003-08-29 21:36:28 +00:00
florian
04501b6fff * another couple of arm fixes 2003-08-28 13:26:10 +00:00
florian
dc7d8ba847 * today's arm patches 2003-08-28 00:05:29 +00:00
florian
f3266351dc + started to implement FPU support for the ARM
* fixed a lot of other things
2003-08-25 23:20:38 +00:00
florian
9edd2b0401 * continued to work on the arm port 2003-08-24 12:27:26 +00:00
florian
20b5945be0 * arm compiler can be compiled; far from being working 2003-08-21 03:14:00 +00:00
florian
abf9504b0e * more arm stuff 2003-08-20 15:50:12 +00:00
florian
5aba45edbf * very basic stuff for the arm 2003-07-21 16:35:30 +00:00