Commit Graph

246 Commits

Author SHA1 Message Date
Jonas Maebe
fb27dff638 * generate ".abiversion 2" directive when targeting ppc64/ELFv2
* generate code to load the TOC register if it's required, and
    emit the the ".localentry" directive to indicate to the linker
    where the actual function body starts
  * support the ".localentry" directive in the ppc64 assembler reader
   o disable the fpc_qword_to_double() assembler implementation for
     ELFv2, because we can't manually insert the .localentry directive
     before the stack allocation code
  * perform indirect calls on ppc64 via R12 in ncgcal, as R12 needs to
    contain the function address on entry on ppc64/ELFv2 (and it's
    a volatile register, so there's no problem with always using
    it)

git-svn-id: trunk@30198 -
2015-03-14 18:35:31 +00:00
Jonas Maebe
8445381929 * merged ait_set and ait_thumb_set into a single tai class
(tai_symbolpair)

git-svn-id: trunk@30197 -
2015-03-14 18:35:28 +00:00
Jeppe Johansen
52e505bff7 Fixed internal error in GOT related code for ARM internal assembler.
git-svn-id: trunk@30188 -
2015-03-14 16:03:16 +00:00
Jeppe Johansen
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
sergei
31fddaafe8 + New subtype of tai_regalloc, "ra_markused". It marks a physical register as used in procedure, triggering saving/restoring that register if it is non-volatile.
git-svn-id: trunk@30010 -
2015-02-25 21:38:23 +00:00
Jonas Maebe
1de8e53edd + AArch64 jump table support
git-svn-id: trunk@29964 -
2015-02-23 22:55:42 +00:00
Jonas Maebe
5041354b8e * recognise AArch64 PIC references
git-svn-id: trunk@29925 -
2015-02-23 22:53:14 +00:00
Jonas Maebe
d246ababff + condition code operand for aarch64
+ taicpu.op_reg_cond() constructor
  * use this operand for cset

git-svn-id: trunk@29889 -
2015-02-23 22:51:19 +00:00
Jeppe Johansen
47dbec3111 Rebase to trunk revision
git-svn-id: branches/laksen/armiw@29708 -
2015-02-15 16:08:18 +00:00
Károly Balogh
a99c9c29b6 m68k: basic 68881 FPU register save/restore support. probably still needs some work here and there.
git-svn-id: trunk@29644 -
2015-02-07 22:13:07 +00:00
Jeppe Johansen
6976af8365 Change .thumb_func to be an ait_directive instead of it's own tai type.
git-svn-id: branches/laksen/armiw@29334 -
2014-12-26 23:13:14 +00:00
pierre
0d9783e9a6 Avoid referencing an empty ansistring in tai_stabs.create_ansistr
git-svn-id: trunk@28990 -
2014-11-05 20:29:18 +00:00
nickysn
366dc179b6 * use tai_const.Create_int_code/dataptr(0) in tai_const.Create_nil_code/dataptr
git-svn-id: trunk@28725 -
2014-09-30 01:34:20 +00:00
nickysn
27a7c0863b + added constructors tai_const.Create_int_codeptr and .Create_int_dataptr. To be
used for emitting magic consts with the size of a code or data pointer (used
  in e.g. rtti data).

git-svn-id: trunk@28724 -
2014-09-30 01:26:16 +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
Jonas Maebe
62e1df9e76 * fixed indentation
git-svn-id: trunk@26020 -
2013-11-10 21:25:34 +00:00
florian
babbc21afd * fix handling of register sets on m68k: it is required that they are stored as two tcpuregistersets because address registers and data registers have different register types
git-svn-id: trunk@25726 -
2013-10-09 18:15:06 +00:00
nickysn
3bc89a50ed + added i8086-specific methods tai_const.Create_sym_near and tai_const.Create_sym_far, which allow creating explicitly a near or far ptr const, regardless of current memory model's defaults
git-svn-id: trunk@25502 -
2013-09-16 19:56:49 +00:00
sergei
bfcdf6b825 * Replaced tai_ent and tai_ent_end classes with tai_directive subtypes. Having separate classes for them is unnecessary complication.
git-svn-id: trunk@25338 -
2013-08-23 12:38:49 +00:00
sergei
108d3cb090 - Removed tai_label.is_global field, was used in just one place and is generally not needed: binding is controlled by 'bind' property of referenced AsmLabel.
git-svn-id: trunk@25336 -
2013-08-23 11:34:08 +00:00
florian
6606955b88 + basic support for pic on arm-linux
git-svn-id: trunk@25297 -
2013-08-19 21:35:37 +00:00
Jonas Maebe
da6d9cf3f3 * give an internalerror when we try to change the type of an asmsymbol from
anything but none (= undefined) to local

git-svn-id: trunk@25266 -
2013-08-16 10:10:38 +00:00
nickysn
fe4cac96be + added overloads to tai_const.Createname and Create_type_name, which take a Tasmsymtype parameter; to be used for declaring external symbols which reside in the data segment with AT_DATA, which is necessary for i8086 medium and compact memory models (where code and data pointers are of different size)
git-svn-id: trunk@25243 -
2013-08-11 19:46:17 +00:00
nickysn
db541b59fa - disallow calling tai_symbol_end.Createname with a symbol name that isn't yet defined
git-svn-id: trunk@25210 -
2013-08-03 12:27:43 +00:00
florian
2cdb4adf39 + tai_const.Create_type_name and tai_const.Create_pint_unaligned
* some locations fixed, where dwarf generated assembler for aligned data accidently

git-svn-id: trunk@25054 -
2013-07-07 15:09:36 +00:00
nickysn
784333edbb + added tai_const.Create_nil_codeptr and .Create_nil_dataptr, which should eventually replace tai_const.Create_sym(nil)
git-svn-id: trunk@24976 -
2013-06-25 20:57:12 +00:00
nickysn
6c1262049e * tai_const.Create_sym_offset: follow the default i8086 data (instead of code) pointer size for asm symbols with typ=AT_DATA
git-svn-id: trunk@24973 -
2013-06-25 15:12:00 +00:00
nickysn
bb06899ec7 * clarified the comment for aitconst_farptr
git-svn-id: trunk@24868 -
2013-06-10 21:35:29 +00:00
nickysn
e4a1230356 + added support for far pointer constants in the assembly output
git-svn-id: trunk@24854 -
2013-06-09 22:01:04 +00:00
sergei
b9bbe8ba67 * tai_const.getcopy: Check that 'sym' is assigned before trying to call its method. Mantis #24574.
git-svn-id: trunk@24836 -
2013-06-09 14:19:09 +00:00
florian
1682e9a2b1 * detabbed
git-svn-id: trunk@24433 -
2013-05-04 19:39:12 +00:00
florian
cec28ef512 * when inserting pc relative data blocks on arm thumb, avoid negative pc offsets, if needed, the data is copied
a short test with the rtl shows that this happens exactly once in the rtl, so it is feasible to do so

git-svn-id: trunk@24413 -
2013-05-03 20:45:26 +00:00
sergei
8e6d6d0027 * Replaced strpcopy() by its equivalent. With sysutils in uses clause, strpcopy resolves to ansistring version, inserting a redundant conversion to ansistring.
git-svn-id: trunk@24360 -
2013-04-28 19:43:47 +00:00
nickysn
f780d37d5e * proper defines of aitconst_ptr, aitconst_ptr_unaligned and aitconst_aint for 16-bit and 8-bit CPUs
git-svn-id: branches/i8086@24015 -
2013-03-27 00:01:30 +00:00
florian
2ae8d604bc + shifterop for ARM64
git-svn-id: trunk@22911 -
2012-11-01 20:11:15 +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
svenbarth
d9a61f2082 * make internal error unique
* add MULU and MULS to taicpu.get_spilling_operation_type

git-svn-id: trunk@22746 -
2012-10-18 20:12:16 +00:00
Jeppe Johansen
8e00978108 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

git-svn-id: branches/laksen/arm-embedded@22580 -
2012-10-08 03:10:44 +00:00
pierre
7c1db10df9 Handle new unaligned constant types
git-svn-id: trunk@22520 -
2012-10-02 22:30:22 +00:00
pierre
b041b3ad4a Add unaligned 16,32 and 64 bit tai_const, needed for dwarf
git-svn-id: trunk@22514 -
2012-10-02 13:03:54 +00:00
pierre
4b7a6ecc14 move currentregloc setting to ncgutil to avoid sysym unit ependency in aasmtai unit
git-svn-id: trunk@22513 -
2012-10-02 09:25:49 +00:00
pierre
fcaff0489c * psub.pas : translate tregister for registerhi also
(avoids imaginary register number in "# Var I in register .." assembler comments.
  * dbgdwarf.pas : Support register variables as register pairs.
      Does not yet handle case of changing registers.
  * symsym.pas : add currentregloc field to tabstractnormalvarsym class,
     to be able to track changing registers used for a given variable.
  * aasmtai.pas : Update currentregloc field of tai_varloc.create sym parameter.
  * ncgutil.pas : Only generate a tai_varloc if the new registers are different for the variable.

git-svn-id: trunk@22508 -
2012-10-01 14:21:13 +00:00
florian
54d3d736f5 * patch by Jeppe Johansen to add support for handling different flags for xPSR regs,
and add usermode parsing of LDM/STM ops
  This patch basically extends the ARM assembly reader a bit to properly parse CPSR and 
  SPSR flags for the MSR opcode, and allows the reader to understand 
  the ^ modifer for register lists for STMxx and LDMxx.

  Previously the following combinations weren't possible in straight assembler:
     MRS R0, CPSR
     MRS R0, SPSR
     MSR CPSR_CX, R0
     LDMIA SP, {R0-R15}^
     etc.. 

git-svn-id: trunk@22502 -
2012-09-29 08:23:40 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
florian
7840b4657a * the improved arm optimizer might move instructions around so the old hacky test if a label with its data has been already embedded into the code by checking if the offset is 0 does not work anymore so a new field for tai_label has been introduced for this purpose
git-svn-id: trunk@22345 -
2012-09-06 15:12:17 +00:00
florian
7361e19799 + support for handling OS_128/OS_S128 on 64 Bit CPUs as far as needed for method pointers in registers
git-svn-id: trunk@22344 -
2012-09-06 15:12:12 +00:00
florian
e1a2b1859a * comments and explanations on tai_regalloc.keep field
* write/read tai_regalloc. field to/from ppu

git-svn-id: trunk@22190 -
2012-08-22 19:52:08 +00:00
florian
b6608e716b + tai_regalloc.keep to force register deallocations to be keep
git-svn-id: trunk@22187 -
2012-08-22 19:51:47 +00:00
sergei
de34f58284 * Update instruction segment prefix when copying operands from another instruction, Mantis #18113.
git-svn-id: trunk@22067 -
2012-08-13 04:51:28 +00:00
pierre
f92fba996d + New tai_ent and tai_ent_end classes
git-svn-id: trunk@21779 -
2012-07-04 16:32:20 +00:00