Commit Graph

238 Commits

Author SHA1 Message Date
sergei
2caa05ccd1 * Make Win64 SEH support enabled by default. If necessary to disable, compiler should be cycled with OPT=-dDISABLE_WIN64_SEH. Mantis #24012.
git-svn-id: trunk@23732 -
2013-03-08 16:58:05 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
svenbarth
17ff90deb9 aggas.pas, tgnuassembler.writetree.doalign:
+ add the case of a label instead of a jump directly in front of the align (happened in "do_open" for StdIO)

git-svn-id: trunk@22889 -
2012-10-31 20:23:41 +00:00
svenbarth
a34f28c067 The compiler inserts ".balign 4" directives before some jump labels, but sometimes the instruction before the align is not a "JMP". In that case we encounter an illegal instruction, because m68k-as does not seem to generate "NOP" instruction in such cases.
So we need to do this manually by changing (in that case) from ".balign" to ".balignw" and passing the opcode of the "NOP" instruction as a argument. The Coldfire manual suggests here to use the "TPF" instruction, but somehow QEMU does not interpret that correctly.

aggas.pas, tgnuassembler.writetree:
  * keep track of the last "tai" and pass that to "doalign"
  * doalign: do the special handling mentioned above for m68k

git-svn-id: trunk@22799 -
2012-10-21 14:18:08 +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
d91fbd3e10 aggas.pas: m68k-linux needs preceding ".section" as well
git-svn-id: trunk@22730 -
2012-10-18 20:10:52 +00:00
Jonas Maebe
bc35f4b3db * fixed writing of local static symbols on AIX
o the order of .lcomm operands was inverted and can't specify an alignment
   o the section in which to place them can't be adorned using [RW] access
     specifiers (it's always in .bss, which is [RW] by definition)

git-svn-id: trunk@22644 -
2012-10-14 15:59:49 +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
42bd8d6bc1 Handle new unaligned ait_const
git-svn-id: trunk@22515 -
2012-10-02 13:58:32 +00:00
Jonas Maebe
dc5c318eeb * fixed compilation with -dTEST_WIN64_SEH after r22433 based on patch by
Cyrax, mantis #22952)

git-svn-id: trunk@22437 -
2012-09-22 12:41:31 +00:00
florian
ca5fabda6d * cleanup some unused units from uses clauses
git-svn-id: trunk@22433 -
2012-09-21 18:53:46 +00:00
Jonas Maebe
6f2c567e37 * don't write '.section' twice for stubs on Darwin/ARM
git-svn-id: trunk@22432 -
2012-09-21 16:28:43 +00:00
tom_at_work
4150f0a2fb Rebase with r21814
git-svn-id: branches/targetandroid@21815 -
2012-07-07 23:09:20 +00:00
pierre
9b7fec59bb Support ait_ent and ait_ent_end
git-svn-id: trunk@21784 -
2012-07-04 16:36:33 +00:00
florian
6ae2a43161 * fix compilation with extdebug
git-svn-id: trunk@21705 -
2012-06-25 20:01:35 +00:00
pierre
aee68923e8 Fix .pdr generation by adding .end pseudo-instruction, limit .ent to text section for mips cpu
git-svn-id: trunk@21700 -
2012-06-24 21:54:31 +00:00
pierre
600dd162af Merge of rev21557 by Foxsen
Make macro MIPS/CPUMIPS/MIPS32 common for big endian and little endian mips processors
use MIPSEL* for little endian systems
use MIPSEB* for big endian systems

git-svn-id: trunk@21599 -
2012-06-13 22:25:38 +00:00
Jonas Maebe
14cfe770a4 * replaced most (if not all) remaining fields/parameters in the compiler
that deal with paths/filenames with TPathStr (= ansistring) to prevent
    cutting off long paths (no change in speed when compiling the compiler,
    1% extra memory usage)

git-svn-id: trunk@21120 -
2012-04-29 17:36:23 +00:00
florian
aadeba4d1a * started to fix stack frame generation on MIPS(EL)
git-svn-id: trunk@21118 -
2012-04-29 16:58:19 +00:00
Jonas Maebe
3abd5d3882 * changed inlinelevel (which is used to track whether or not we have to
generate line number information) from longint into cardinal, since it
    should never become < 0 (allows catching errors by enabling range
    checking)

git-svn-id: trunk@21114 -
2012-04-29 13:13:36 +00:00
tom_at_work
acbc94e0fd - 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

git-svn-id: branches/targetandroid@21061 -
2012-04-26 09:36:42 +00:00
Jonas Maebe
b99a8c129d * write pointer data on AIX/ppc64 using .vbyte rather than using .llong
(= equivalent of gas .quad), because .llong forces the alignment to
    8 bytes and this causes problems with some typed constant records (such
    as RTTI)

git-svn-id: trunk@21045 -
2012-04-25 20:27:56 +00:00
Jonas Maebe
6502717e67 * align all code/data sections to sizeof(pint), instead of sometimes
to 0 or 1 (section alignment <> alignment of individual data
    elements in section on some platforms, such as AIX)
  * set constalignmin and varalignmin to 8 bytes for AIX/ppc64

git-svn-id: trunk@21044 -
2012-04-25 20:27:41 +00:00
Jonas Maebe
ec77b0f3ca * fixed writing the alignment for datablocks on darwin/aix based on
the last section's alignment (lastalignment is log2(alignment) there,
    and writesection again takes log2() of its parameter)

git-svn-id: trunk@20964 -
2012-04-21 20:17:53 +00:00
Jonas Maebe
ebc542a48b * gcc does add a .file statement for AIX (but using different code than for
other platforms, which is where the confusion stemmed from)

git-svn-id: trunk@20846 -
2012-04-11 18:06:57 +00:00
Jonas Maebe
1c91a555f4 + support for asd_reference, asd_weak_reference and asd_weak_definition
in AIX assembler writer

git-svn-id: trunk@20836 -
2012-04-11 18:06:09 +00:00
Jonas Maebe
5433db6a49 * also specify the section alignment with the section statements themselves
on AIX. Adding ".align" statements only align relative to the section
    start, but does not influence the alignment of the section itself

git-svn-id: trunk@20835 -
2012-04-11 18:06:05 +00:00
Jonas Maebe
273b90fc37 + AIX assembler writer
o .short/.long/.llong are automatically aligned to 2/4/8 byte multiples
     by the AIX assembler (and for compatibility reasons, also by the
     GNU assembler when targeting AIX) -> change to .vbyte statements
  o .ascii does not allow non-ASCII characters in the AIX assembler
    -> change to .byte sequences like gcc on AIX

git-svn-id: trunk@20803 -
2012-04-11 18:02:08 +00:00
Jonas Maebe
ac43eb9b70 + generic implementation of ReplaceForbiddenAsmSymbolChars() instead
of the AVR-specific ifdef'ed variant
   o since the only special character we use in mangled names on all platforms
     is $, added a new field to tasminfo called "dollarsign" that holds the
     character $'s should be replaced with (if it doesn't have to be replaced,
     leave it at $)

git-svn-id: trunk@20801 -
2012-04-11 18:01:57 +00:00
Jonas Maebe
aaf6015b51 * converted tai directive string from pshortstring to ansistring (some
AIX directives are quite long)

git-svn-id: trunk@20799 -
2012-04-11 18:01:41 +00:00
florian
f33ee60c2e * write ait_varloc into assembler output, it is generated if -sr is passed to the compiler
git-svn-id: trunk@20471 -
2012-03-04 20:15:28 +00:00
sergei
cbad0abab5 + Platform-specific exception support for x86_64-win64. Enable by cycling with OPT=-dTEST_WIN64_SEH.
git-svn-id: trunk@20098 -
2012-01-16 23:13:31 +00:00
Jonas Maebe
3a6fb7c9ef - removed stray if-statement
git-svn-id: trunk@19922 -
2011-12-30 12:11:33 +00:00
sergei
9eb451756b + Support .seh_handler directive
git-svn-id: trunk@19365 -
2011-10-04 12:19:24 +00:00
sergei
b997094755 + Generate unwind bytecode for function prologues on win64.
* For now placed actual processing of unwind info under {$ifdef TEST_WIN64_UNWIND}, because in the current state it doesn't add much value.

git-svn-id: trunk@19200 -
2011-09-23 21:22:25 +00:00
sergei
b0c2548019 * Use '.tls' as name for sec_threadvar sections for all Windows and WinCE targets, not just i386-win32.
git-svn-id: trunk@19157 -
2011-09-19 22:27:53 +00:00
sergei
1365467b0d + Support classes for creating unwind bytecode for Win64.
git-svn-id: trunk@19071 -
2011-09-15 15:35:08 +00:00
florian
f1f0cb033a * move ReplaceForbiddenChars to cpubase of avr so it can be used in dbgstabs as well
* tried to fix dbgstabs so that it doesn't emit illegal chars using ReplaceForbiddenChars, however, dbgstabs accesses symbol names quite often, so this failed

git-svn-id: trunk@18972 -
2011-09-04 19:36:43 +00:00
florian
7bceba2392 * since the last name mangling changes, gas writer for avr needs to replace more illegal characters
git-svn-id: trunk@18971 -
2011-09-04 18:56:47 +00:00
florian
2eb39c8843 * patch by Jeppe Johansen to support jumptable generation for case nodes on arm/thumb-2, resolves #19502
git-svn-id: trunk@18233 -
2011-08-16 22:39:00 +00:00
sergei
ae4cdf25f8 + aggas.pas: Write section attributes when long section names are used for smart linking (enabled for win32 and win64). It is needed because GAS does not understand that '.text.something' is part of '.text' and assigns default attributes (writable data) to all such sections, which is not the desired behavior.
git-svn-id: trunk@17989 -
2011-07-13 23:45:28 +00:00
sergei
5bda700410 * External assemblers: moved some common code into the base class, 4 copies reduced to one.
git-svn-id: trunk@17561 -
2011-05-26 13:10:49 +00:00
florian
fb84cb865b * rebase to trunk@17295
git-svn-id: branches/avr@17296 -
2011-04-10 19:20:48 +00:00
florian
f328b6d635 + user section type
+ parsing of section directive for variables
  + section test
  + write section names in the assembler/binary writers correctly
  * allow section only after ; and for embedded targets

git-svn-id: branches/usersections@17154 -
2011-03-20 15:42:28 +00:00
florian
26415e9903 * as avr doesn't like $ in symbols, use ReplaceForbiddenChars to replace them
git-svn-id: branches/avr@17040 -
2011-02-27 21:04:18 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
8b0301409a + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 and
later: the same as i386/darwin, except
      a) uses the non-fragile Objective-C ABI/runtime
      b) does not require stubs for direct calls/jumps (not required for
         i386/darwin under 10.6 and later either, but still generated
         there for backwards compatibility)
      c) only the same packages are enabled as for ARM/Darwin
      d) MacOSAll is compiled specifically for the iPhoneSimulator SDK
    This target also defines the symbol "darwin" apart from the target
    name "iphonesim" for source code compatibility reasons.

git-svn-id: trunk@16065 -
2010-09-29 21:56:47 +00:00
Jonas Maebe
ad93588fa1 * use 32 bit int->string conversions for non-64 bit constants on 32 bit
platforms

git-svn-id: trunk@15517 -
2010-07-03 13:06:40 +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