Commit Graph

261 Commits

Author SHA1 Message Date
sergei
121271c38f * MIPS case node: simplified code a bit.
* Moved jump tables into data segment. For disassembly-based stack unwinding to work properly, MIPS ABI expects text segment to contain instructions only.

git-svn-id: trunk@24904 -
2013-06-15 12:36:21 +00:00
sergei
5bcae5a80a - Removed TMIPSParaManager.getintparaloc method, its generic implementation from r24716 works without issues.
git-svn-id: trunk@24903 -
2013-06-15 12:24:19 +00:00
sergei
8b8553991a + MIPS: prevent coalescing written-to registers with $sp,$fp,$zero and $at.
+ Implemented subset of "spill replace" functionality, replacing moves from/to spilled registers with loads/stores to spill locations. This helps to reduce amount of instructions.

git-svn-id: trunk@24900 -
2013-06-15 04:04:08 +00:00
sergei
6a8e4f0381 * MIPS: generate real instructions, not macros, for comparisons with $zero.
* g_concatcopy, g_concatcopy_unaligned: call a_cmp_reg_reg_label instead of duplicating code.

git-svn-id: trunk@24895 -
2013-06-14 07:27:48 +00:00
sergei
fb88cc4257 * TCGMIPS.a_load_reg_reg: reduce code duplication, and don't generate same register move for OS_32->OS_S32 and vice versa. Such moves explode into at least 4 instructions if register needs spilling, after which they are no longer recognized and cannot be removed by reg.allocator. So it's much better not to generate them in first place.
* Implemented overflow checking for multiplication, no longer generate MULO and MULOU macros.

git-svn-id: trunk@24894 -
2013-06-14 00:12:17 +00:00
sergei
7e0ae2e984 * MIPS: fixed cgsize2subreg to return correct result for float registers.
- TCGMIPS.getfpuregister override is no longer necessary with the above fix.

git-svn-id: trunk@24893 -
2013-06-13 23:50:20 +00:00
sergei
562714129f * MIPS: get completely rid of LI macro, generate equivalent CPU instructions instead.
git-svn-id: trunk@24862 -
2013-06-10 02:07:21 +00:00
sergei
86637a9ff9 * MIPS: pi_needs_got is necessary when doing unsigned to float conversions (it uses a global constant) and also if procedure does any calls in PIC mode.
git-svn-id: trunk@24822 -
2013-06-08 23:29:50 +00:00
sergei
2868a30cce + Added mips32r2 opcodes needed for pic32.
* Output registers of type R_SPECIALREGISTER as numbers.
+ For MTC0/MFC0 instructions, set type of first operand to R_SPECIALREGISTER, since it designates a coprocessor register.

git-svn-id: trunk@24799 -
2013-06-03 20:01:30 +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
sergei
4b820a1ca5 - Removed tcgloadnode.generate_picvaraccess, it is never used and is not necessary because PIC stuff is handled at lower levels.
git-svn-id: trunk@24764 -
2013-06-02 10:49:17 +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
sergei
fe322f35d5 * MIPS: fixed passing CPU type specified with -CpXXX switch to assembler
- removed mips_cpu variable and cpu_mips_default CPU type.
  * globals.pas: default CPU type changed to MIPS2, this is what was passed to assembler before.

git-svn-id: trunk@24643 -
2013-05-30 15:02:40 +00:00
sergei
0ad96d2099 * MIPS: some clean up of assembler reader:
- references cannot be in brackets
  - registers are only prefixed by dollar, never by percent
  - syntax x@LO is not supported, must be %lo(x).

git-svn-id: trunk@24633 -
2013-05-30 09:28:21 +00:00
sergei
2944fc8839 * MIPS improvements:
* reworked condition codes, changed BC1T and BC1F from separate instructions to condition jumps.
  - removed A_P_SW, A_P_LW and A_SPARC8UNIMP
  + support '.set at' and '.set noat' directives
  + prepare to support bgtz,bgez,bltz,blez instructions.

git-svn-id: trunk@24631 -
2013-05-29 17:35:56 +00:00
sergei
e1f6cf79e9 * MIPS: an empty reference (no symbol, base or index and zero offset) must not be output as empty string.
git-svn-id: trunk@24630 -
2013-05-29 15:59:40 +00:00
sergei
c31321c2fe * TCGMIPS.handle_reg_const_reg(): fixed to generate 'real' CPU instructions, so macro processing by assembler is no longer needed.
git-svn-id: trunk@24564 -
2013-05-24 03:56:51 +00:00
sergei
d367148f75 - Removed obsolete comments (copypasted from other CPU code, most likely).
- Removed topsize, MIPS target does not use it.

git-svn-id: trunk@24535 -
2013-05-20 10:39:05 +00:00
sergei
300289dd89 * MIPS: reworked 64-bit code generation, implemented overflow checking and optimized operations with constants.
git-svn-id: trunk@24508 -
2013-05-15 10:02:08 +00:00
sergei
bfd7401541 * MIPS: overflow checking added in r24445 works only when source and destination of operation are different registers. Fixed cases of operations on same register.
git-svn-id: trunk@24507 -
2013-05-15 09:55:47 +00:00
sergei
7cfc737866 * MIPS: rewrote 32-bit code generation methods, reducing code duplication.
+ Implemented overflow checking for unsigned 32-bit addition and subtraction.
* Use optimize_op_const instead of custom optimizations.
* Change AND/OR/XOR into ANDI/ORI/XORI if they use immediate operands, and use correct range for these immediate operands, must be 0..65535 unlike -32768..32767 for arithmetic operations.
* Don't treat AND/OR/XOR as macros, no longer necessary.
* Don't treat BEQ/BNE as macros either.

git-svn-id: trunk@24445 -
2013-05-05 05:55:03 +00:00
sergei
a0d3750b81 + MIPS: implemented direct 32x32 to 64 bit multiplication.
git-svn-id: trunk@24436 -
2013-05-04 20:35:24 +00:00
sergei
504b6754b7 * MIPS small improvements:
* TCGMIPS.a_load_reg_reg: generate CPU instructions instead of macros
  * TCGMIPS.a_cmp_const_reg_label: load constant using a_load_const_reg instead of LI macro (it may also end up with LI, but tries to optimize when possible).
  - removed unused variables.

git-svn-id: trunk@24418 -
2013-05-04 07:33:34 +00:00
sergei
1f8bd4a2d1 + MIPS: initial target-specific unary minus node.
git-svn-id: trunk@24417 -
2013-05-04 07:19:08 +00:00
sergei
02a288fd89 * MIPS addnode: rewritten almost completely:
* shorter by 280 lines
  * generates actual instructions instead of macros
  * uses immediate operands for constants when possible
  * 64-bit and float comparisons use LOC_JUMP as location

git-svn-id: trunk@24236 -
2013-04-14 12:12:36 +00:00
sergei
cded05ccef + MIPS linker: support linking PIC object files with non-PIC ones, by routing absolute calls into PIC code through stubs that load R25.
git-svn-id: trunk@24098 -
2013-03-31 19:58:52 +00:00
sergei
c5bf2ecb65 + MIPS linker: added ELF header flags, TLS relocations and an utility procedure to handle endianness.
git-svn-id: trunk@24052 -
2013-03-29 14:11:27 +00:00
pierre
702effaad0 Force use of PIC compatible calling for register variable calls as procvars might be internal or external and thus require PIC
git-svn-id: trunk@24005 -
2013-03-25 21:53:31 +00:00
sergei
6f1997f5e5 + MIPS: added profiling support
git-svn-id: trunk@23950 -
2013-03-21 13:40:50 +00:00
sergei
1c652eb8f9 MIPS procinfo improvements:
- Removed TMIPSProcInfo.needs_frame_pointer, it duplicates pi_needs_stackframe flag.
- Don't save RA for leaf procedures.
* GP is caller-saved register, it does not need saving/restoring as nonvolatile registers. Handle its restore position as a "normal" temp, whose offset is known before secondpass. This allows to handle PIC calls without involving GAS macro processing.

git-svn-id: trunk@23885 -
2013-03-17 08:43:39 +00:00
sergei
823e3ea398 MIPS: reworked PIC/call code:
+ Favor 'weak' parameter in a_call_name of both thlcgmips and TCGMIPS.
* make_simple_ref and a_loadaddr_ref_reg: require input references to be 'raw' (no refaddr=addr_pic, etc) and do not use GP as base/index. If it's not true, raise an internal error. When addr_pic_call16 or so needs to be generated, it must be done without calling the mentioned methods.
* thlcgmips.a_call_name: generate PIC sequence for procedures declared as 'external', instead of 'cdecl', this is more correct because ABI has only one calling convention.
- make_simple_ref_fpu removed, there's no reason to handle references to floating-point data in different way.
- a_loadaddr_ref_cgpara override also removed, generic method does the job just well.
- thlcgmips.a_call_ref and a_call_reg overrides removed because indirect calls are now always done using $t9.

git-svn-id: trunk@23698 -
2013-03-05 19:31:20 +00:00
sergei
a1b50f643e - removed never used function.
git-svn-id: trunk@23697 -
2013-03-05 18:05:52 +00:00
sergei
6fcd9979dd + MIPS: doing progress with linker, implemented processing of local symbols in PIC code and stuff needed to link shared libraries.
git-svn-id: trunk@23690 -
2013-03-04 20:48:33 +00:00
sergei
1421998752 * MIPS register spilling: relocations are not needed to load constant values, and offset limit is 32767, not 4095.
git-svn-id: trunk@23675 -
2013-02-28 20:43:38 +00:00
sergei
5812cf3b46 * MIPS: allocate 16-byte outgoing parameter area also for procedures declared as 'assembler' without 'nostackframe'. This is a half-measure because there is no way to determine correct size to allocate for such procedures (probably we must add some directive to specify it). The same generally applies to all targets with fixed stack, not just MIPS.
git-svn-id: trunk@23663 -
2013-02-25 22:47:09 +00:00
sergei
d190d4676b - MIPS: removed comment generation in function prologues, it clutters listing more than it helps. Also removed some unused variables.
git-svn-id: trunk@23661 -
2013-02-25 21:40:03 +00:00
sergei
354ebb822a * MIPS: fixed layout of stack frame in case procedure does only low-level calls (via a_call_name, etc.). A 16-byte outgoing parameter area must be allocated regardless of actual parameter count.
* Abort if attempting to emit a call without pi_do_call flag set, because the outgoing parameter area determines layout of temps and therefore cannot be created/changed during pass 2.
* Bypass g_concatcopy_move if procedure is a leaf one, due to the restriction mentioned above.

git-svn-id: trunk@23644 -
2013-02-21 20:57:38 +00:00
sergei
69c8f6cf7d * Typo in previous commit
git-svn-id: trunk@23639 -
2013-02-20 23:03:45 +00:00
sergei
d7c96dea8b * MIPS: refactoring: removed handle_load_store and handle_load_store_fpu.
git-svn-id: trunk@23637 -
2013-02-20 20:59:33 +00:00
sergei
30247d8961 * MIPS: fixed parameter handling for big-endian targets, and removed a lot of garbage.
* Parameters passed in registers are no longer forced to stack, therefore assembler routines using 'lw' instruction to load such parameters must have it changed to 'move' (tb0072.pp).

git-svn-id: trunk@23627 -
2013-02-18 04:20:10 +00:00
sergei
f0e6d2c054 * MIPS: MULT[U] and DIV[U] don't modify first operand.
git-svn-id: trunk@23623 -
2013-02-16 06:43:41 +00:00
sergei
209bfaa774 + MIPS: Allocate a LOC_VOID location for empty records, avoids internal errors in other parts of compiler.
git-svn-id: trunk@23586 -
2013-02-08 17:53:04 +00:00
pierre
2916235cfe Fix make_simple_ref for pic address with big offsets
git-svn-id: trunk@23584 -
2013-02-08 15:47:14 +00:00
sergei
d82387ff72 * MIPS: fixed parameter management to properly align records smaller than 32 bits on big-endian targets.
* Also changed parameter management to allocate a single LOC_REFERENCE location for any parameter (or part of a parameter) passed on stack. Such locations can now be handled by generic code. As a consequence, TGMIPS.a_load_const_cgpara and a_load_ref_cgpara methods are no longer necessary (moreover they were ignoring parameter shifting).
* a_loadfpu_ref_cgpara patched to handle 64-bit location, which are now possible.

* This change eliminates code generation madness where each word of a record was copied individually, thus passing by value a 32K-word sized record was bloating into 64K instructions, multiply this number by 2 for larger records due to limited immediate offsets, and by another 2 for global record in PIC mode :/

git-svn-id: trunk@23575 -
2013-02-05 22:21:09 +00:00
sergei
70c0d680a6 + MIPS linker: understand R_MIPS_JALR relocation and __gnu_local_gp symbol.
git-svn-id: trunk@23568 -
2013-02-03 21:54:37 +00:00
sergei
ef38193043 * MIPS: Once again fixed g_external_wrapper. My initial assumption about .cpload was wrong: it is optimized into position-dependent sequence only if "-KPIC -mno-shared" is passed to GAS command line, without -KPIC it is ignored altogether. Therefore r23566 breaks some non-PIC tests.
git-svn-id: trunk@23567 -
2013-02-03 21:53:30 +00:00
sergei
9bc758d62b * Forgot to set base register to NR_GP
git-svn-id: trunk@23566 -
2013-02-03 01:46:49 +00:00
sergei
a0c1e1b07f * MIPS: fixed a_call_name and a_call_reg methods to workaround a bug in GAS <2.21, see comments in source for details.
+ g_external_wrapper method.

git-svn-id: trunk@23565 -
2013-02-02 23:52:58 +00:00
pierre
899951577a Avoid wrong code generation for a_call_name if we create pic code
git-svn-id: trunk@23560 -
2013-02-01 21:16:58 +00:00
sergei
8bfbee747a * MIPS: Rewrote g_intf_wrapper method to support instance offsets greater than 32767 and PIC (the latter part untested yet).
git-svn-id: trunk@23557 -
2013-02-01 18:28:46 +00:00
sergei
503b132096 * cgbase.pas: added more MIPS-specific address types, needed to support large GOT model.
* cpugas.pas: GetReferenceString: rewritten, it is easier than trying to fix it. Fixes incorrect writing of non-PIC references containing base, symbol and offset together, and some forms of PIC references. Also supports newly introduced address types.

git-svn-id: trunk@23555 -
2013-02-01 16:46:22 +00:00
sergei
6e4f6a64d6 + MIPS: Allow subset locations for boolean NOT, this appears sufficient to fix all bitpacking-related tests.
git-svn-id: trunk@23554 -
2013-01-31 21:52:29 +00:00
pierre
7e79042d58 Reorganize for better pic support (not yet working completly ...)
git-svn-id: trunk@23550 -
2013-01-31 13:35:52 +00:00
pierre
6e2db1a5e5 Use addr_pic_call16 in a_call_name method
git-svn-id: trunk@23549 -
2013-01-31 13:34:38 +00:00
pierre
9cb7be4c92 + Support addr_pic_call16
* Add more instructions to is_macro_instruction function

git-svn-id: trunk@23548 -
2013-01-31 13:32:18 +00:00
sergei
08c0c265c9 * MIPS: use correct def to calculate parameter alignment (when parameter is passed by address, its def changes to pointer and the alignment of parameter itself is irrelevant). Fixes at least webtbs/tw7806.
git-svn-id: trunk@23538 -
2013-01-29 20:09:41 +00:00
sergei
5e13334467 * Fixed tMIPSELtypeconvnode.second_int_to_bool handling of C booleans, webtbs/tw10233 and webtbs/tw17180 now work.
* Reused applicable code from the above mentioned method in tMIPSELnotnode.second_boolean, it is more efficient in handling 64-bit data.

git-svn-id: trunk@23531 -
2013-01-28 21:32:21 +00:00
pierre
9e6a2b868c Fix -Cp option failure due to cputypestr array that must be uppercased
git-svn-id: trunk@23446 -
2013-01-18 17:09:28 +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
b35d04ffa8 * MIPS: methodpointers must be compatible with records; since records are never passed by address in this ABI, so must be methodpointers. Fixes webtbs/tw9141.pp.
git-svn-id: trunk@23392 -
2013-01-15 19:09:19 +00:00
sergei
d2758265e3 * MIPS int->real conversion: When converting unsigned to single, load it into 64-bit FP register, otherwise further subtracting a 64-bit offset leads to invalid result. Fixes tw17714.pp.
* The addend is endian-dependent, fixes tcnvint4.pp on big-endian targets.

git-svn-id: trunk@23388 -
2013-01-15 10:49:37 +00:00
sergei
b5eecab582 * Procvars (methodpointers) must be treated as records, too. Fixes tw12318.pp and tw14155.pp after r23377.
* Factored related code into a separate method, as it will probably need further refinement.

git-svn-id: trunk@23387 -
2013-01-15 10:39:14 +00:00
sergei
162896e7d7 * MIPS code generator fixes and improvements:
- removed a_jmp_cond, it's not virtual and not applicable to this CPU.
* a_loadfpu_reg_cgpara: use direct register moves for simple destinations.
* g_concatcopy: don't take address of source/destination for small amounts of data if possible, for single 32-bit moves this reduces number of generated instructions from 4 to 2.
* g_intf_wrapper: 'Self' is in R4 (a0), not R2. Fixes test/tinterface1.pp.

* mips/cpupara.pas: for functions with result returned in parameter, pass its address in a0 only if result is a record. ABI does not specify behavior for types except records/unions. At the same time, Pascal code relies on the fact that results like strings/interfaces does not change their locations, i.e. "function foo(<self>): IInterface" can be invoked as "procedure foo(<self>, out obj)". This fixes test/tdel1.pp and some Variant-related tests.

git-svn-id: trunk@23377 -
2013-01-13 18:24:06 +00:00
sergei
32ffddaad8 + ELF linker back-ends for ARM and MIPS.
ARM status: roughly corresponds to i386 one, passes the test suite. Handles libraries, can link static libc code including basic PIC and TLS IE/LE stuff. Completely misses Thumb support. Also does not handle ABI-specific stuff, for this reason internally linked .so cannot be used for linking executables with ld. Little-endian only. Tested only on "versatilepb" QEMU virtual machine.

MIPS status: can link the compiler and at least some dynamic executables including fpmake. Some PIC support is present but almost untested. Specific header flags and sections are also not handled yet. Written to handle both endian, but tested for big-endian only ("malta" QEMU VM), including cross-linking from x86_64.

git-svn-id: trunk@23376 -
2013-01-13 18:05:19 +00:00
sergei
d43c38633c * Fixed tMIPSELnotnode.second_boolean do handle QWordBool type correctly and deal with difference between Pascal and C booleans. Also improved it to produce code without macros. Fixes webtbs/tw20874 (and maybe something else).
git-svn-id: trunk@23345 -
2013-01-08 17:43:33 +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
sergei
db72b8d7fd * TCGMips.a_loadfpu_reg_cgpara: temps of type Double need 8-byte alignment, according to description of sdcX/ldcX instructions. Using TCGSize2Size to specify alignment is somewhat weird, but it is being used in other CPU back-ends and looks working.
git-svn-id: trunk@23146 -
2012-12-15 08:47:11 +00:00
florian
e6863aeb80 * typo fixed, patch by Mark Morgan Lloyd
git-svn-id: trunk@23108 -
2012-12-03 21:55:09 +00:00
masta
e327b4581c Use TRegNameTable instead of array[tregisterindex] of string[10]
TRegNameTable is defined in compiler/rgbase.pas and is an array of
strings, limited to the maximum length of the used register names.

r22792 added a long register name but did not scale the string-size
enough, resulting in the compiler built breaking for arm.

git-svn-id: trunk@22817 -
2012-10-22 10:23:21 +00:00
Jonas Maebe
6497d3c994 - removed no longer used/supported af_allowdirect flag (direct assembler
reader support)

git-svn-id: trunk@22794 -
2012-10-21 13:42:58 +00:00
florian
04543b179f o merge of the branch laksen/arm-embedded of Jeppe Johansen:
fixes a couple of arm-embedded stuff, 
  adds some controllers, start of fpv4_s16 support, for a complete list of
  changes see below:
------------------------------------------------------------------------
r22787 | laksen | 2012-10-20 22:00:36 +0200 (Sa, 20 Okt 2012) | 1 line

Properly do NR_DEFAULTFLAGS detection/allocation/deallocation
------------------------------------------------------------------------
r22782 | laksen | 2012-10-20 07:44:55 +0200 (Sa, 20 Okt 2012) | 1 line

Fixed flags detections code for wide->short optimization code for Thumb-2
------------------------------------------------------------------------
r22778 | laksen | 2012-10-19 20:23:14 +0200 (Fr, 19 Okt 2012) | 1 line

Added coprocessor registers, and support for 6 operands(MCR/MRC instructions, etc)
------------------------------------------------------------------------
r22647 | laksen | 2012-10-14 21:28:08 +0200 (So, 14 Okt 2012) | 1 line

Added register specifications to lpc1768.pp. From Joan Duran
------------------------------------------------------------------------
r22646 | laksen | 2012-10-14 21:10:20 +0200 (So, 14 Okt 2012) | 4 lines

Fixed some minor formating issues
Implemented a small heap mananger
Implemented console IO
Changed default LineEnding to CrLf(to ease console IO parsing)
------------------------------------------------------------------------
r22599 | laksen | 2012-10-09 08:58:58 +0200 (Di, 09 Okt 2012) | 1 line

Added all STM32F1 configurations
------------------------------------------------------------------------
r22597 | laksen | 2012-10-08 22:10:45 +0200 (Mo, 08 Okt 2012) | 1 line

Added initial support for the Cortex-M4F FPv4_S16 FPU
------------------------------------------------------------------------
r22596 | laksen | 2012-10-08 22:04:14 +0200 (Mo, 08 Okt 2012) | 1 line

Added FPv4_d16 FPU instructions, and a few extra registers
------------------------------------------------------------------------
r22592 | laksen | 2012-10-08 16:07:40 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for IT block merging
Added a peephole pattern check for UXTB->UXTH chains
------------------------------------------------------------------------
r22590 | laksen | 2012-10-08 14:30:00 +0200 (Mo, 08 Okt 2012) | 3 lines

Add CBNZ/CBZ instructions
Create preliminary Thumb-2 PeepHoleOptPass2 code, hacked together from the ARM mode code
Added a number of simple size optimizations for common Thumb-2 instructions
------------------------------------------------------------------------
r22582 | laksen | 2012-10-08 06:49:39 +0200 (Mo, 08 Okt 2012) | 3 lines

Fix optimizations of Thumb-2 code
Fix problem with loading of condition operand for IT instructions
Properly split IT blocks when register allocator tries to spill inside a block.
------------------------------------------------------------------------
r22581 | laksen | 2012-10-08 05:15:40 +0200 (Mo, 08 Okt 2012) | 4 lines

Fixed assembler calling command line for cpus>ARMv5TE. EDSP instructions will generate errors while assembling, due to RTL assembler routines
Updated boot code for all Cortex-M3 controllers, and sc32442b to use weak linking for exception tables.
Cortex-M3 devices now also share initialization routine to simplify maintenance
STM32F10x classes now have specific units which fit the interrupt source names and counts
------------------------------------------------------------------------
r22580 | laksen | 2012-10-08 05:10:44 +0200 (Mo, 08 Okt 2012) | 2 lines

Added support for .section, .set, .weak, and .thumb_set directive for GAS assembler reader
IFDEF'ed JVM specific assembler directives, to prevent ait_* set to exceed 32 elements
------------------------------------------------------------------------
r22579 | laksen | 2012-10-08 02:10:52 +0200 (Mo, 08 Okt 2012) | 3 lines

Remove all traces of the interrupt vector table generation mechanism
Clean up cpuinfo tables
Fixed ARMv7M bug(BLX <label> doesn't exist on that version)

git-svn-id: trunk@22792 -
2012-10-21 08:39:52 +00:00
pierre
7bd7cf275c handle po_nostackframe for calc_stack_size
git-svn-id: trunk@22718 -
2012-10-18 09:44:11 +00:00
pierre
25b0de0c28 Use -march and -mabi options for GNU assembler call.
This avoids problems on newer GNU assembler, which might have
 a default ABI different from O32.

git-svn-id: trunk@22664 -
2012-10-16 10:01:23 +00:00
pierre
305206354a Add arch and abi values for mips cpu
git-svn-id: trunk@22663 -
2012-10-16 09:57:24 +00:00
Jeppe Johansen
0087661fb5 Added FPv4_d16 FPU instructions, and a few extra registers
git-svn-id: branches/laksen/arm-embedded@22596 -
2012-10-08 20:04:14 +00:00
pierre
ff78c930c5 Fix problem in 64bit substraction
git-svn-id: trunk@22521 -
2012-10-02 23:35:02 +00:00
pierre
37a7c1fc25 Add Dwarf debug info generation by default for mips cpu
git-svn-id: trunk@22509 -
2012-10-01 14:23:14 +00:00
pierre
d01ec10f45 Fix tw22326 for mips CPU
git-svn-id: trunk@22451 -
2012-09-24 22:28:54 +00:00
pierre
15f4e1279b Add RS_GP to list of saved registers if pi_needs_got flag is set
git-svn-id: trunk@22450 -
2012-09-24 21:01:47 +00:00
pierre
a3ef2b42a8 Remove more TABs in sources
git-svn-id: trunk@22336 -
2012-09-06 08:11:59 +00:00
pierre
bf46526cc7 Set register_used boolean only for calleeside
git-svn-id: trunk@22335 -
2012-09-06 08:11:15 +00:00
pierre
c72f27e53e Remove more TABs in source
git-svn-id: trunk@22334 -
2012-09-06 08:07:38 +00:00
pierre
80b0891c7c Remove TABs in source
git-svn-id: trunk@22333 -
2012-09-06 08:06:08 +00:00
pierre
6290526821 Fix variable alignment for varargs
git-svn-id: trunk@22297 -
2012-09-03 12:15:54 +00:00
pierre
9ad6285fe2 * Fix 64-bit OP_ADD and OP_SUB operations (no overflow support yet)
git-svn-id: trunk@22225 -
2012-08-23 22:05:41 +00:00
pierre
91bfa84952 Correct code after change in set_common_funcretloc_info which made the call to ret_in_param always return false
git-svn-id: trunk@22206 -
2012-08-23 09:50:47 +00:00
pierre
05a326a83e Make sure f2X+1 is also considered used if f2X is used
git-svn-id: trunk@22196 -
2012-08-22 22:49: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
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
eb1efdff8a + introduce cstylearrayofconst because pocall_mwcall was forgotten at several places
git-svn-id: trunk@22012 -
2012-08-05 08:48:23 +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
Jonas Maebe
7717e43929 * moved setting the call result to a separate method, so it can still be
used across multiple levels of inheritance such as on MIPS (and the code
    has to be reusable for a_call_ref/reeg in the future anyway)

git-svn-id: trunk@21906 -
2012-07-12 20:56:25 +00:00
Jonas Maebe
1955255dda * let thlcg.a_call_name() return the tcgpara representing the function
result location (NR_FUNCTION_RESULT_REG is not valid on all platforms)
   o this requires passing the forced function result type (if any) to this
     method
   o a generic, basic thlcg.a_call_name() is now available that sets the
     function result location; can be called by descendants
  * the availability under all circumstances of the correct function return
    type enables g_call_system_proc() on the JVM platform to now determine
    by itself how many stack slots are removed by the call -> do so, instead
    of manually counting them (or forgetting to do so and messing up the
    maximum evaluation stack height calculations)

git-svn-id: trunk@21862 -
2012-07-11 08:25:58 +00:00
pierre
ffd01794fb Reserve R25 () register for PIC function calling
git-svn-id: trunk@21857 -
2012-07-10 21:36:00 +00:00
pierre
489b93f2f5 * Overload hlcg.a_call_ref and a_call_reg methods for cdecl'ared functions to use register
git-svn-id: trunk@21856 -
2012-07-10 21:35:11 +00:00
pierre
bc0c94c204 fpcdefs.inc: Set fpc_compiler_has_fixup_jmps for powerpcXX and mips CPUs.
psub.pas: Use new fpc_compiler_has_fixup_jmps conditional.
 mips/aasmcpu.pas: MIPS specific fixup_jmps function,
   The insttruction distance calculation is not exact as
   some pseudo-instruction can be expanded to a variable number of real instructions
   real calculation would only be possible if we first 
   convert pseudo-instuctions to real instructions before calling fixup_jmps.

 ncgutil.pas: Revert commit r21791
 ncgcon.pas: Revert commit r21786
 mips/cgcpu.pas: Partial revert of commit r21798, no need to always use A_J,
 as fixup_jmps now handles out of range branches.

git-svn-id: trunk@21822 -
2012-07-09 08:59:13 +00:00
pierre
6f12197d3b Fix set of frame poointer value for big local stack size
git-svn-id: trunk@21802 -
2012-07-06 13:32:13 +00:00
pierre
a771b32097 Use R9 instead of AT for big local stack size to avoid error due to AT being changed by pseudo-instructions
git-svn-id: trunk@21800 -
2012-07-06 12:05:58 +00:00
pierre
2e4c704f06 Use A_J instead of A_BA for a_jmp_XXX unless we generate PIC code to avoid branch out of range error (like for packages/fpmake compilation)
git-svn-id: trunk@21798 -
2012-07-05 21:24:22 +00:00