Commit Graph

644 Commits

Author SHA1 Message Date
florian
5dae691c96 * implementation of bit scan intrinsics by Richard Vida, resolves #17592
git-svn-id: trunk@16174 -
2010-10-16 15:03:30 +00:00
pierre
ba6a4760e9 * fix regression 16700 introduced in rev 16104
git-svn-id: trunk@16133 -
2010-10-11 21:23:11 +00:00
pierre
586dd1ee49 * fix go32v2 assembler parsing failure introduced in rev 16104
git-svn-id: trunk@16132 -
2010-10-11 20:53:19 +00:00
pierre
386478cd77 * Allow any register for GOT if current procedure has assembler code
git-svn-id: trunk@16110 -
2010-10-08 13:20:28 +00:00
pierre
207e0b58f5 * Support Intel [ebx].offset var PIC construct
git-svn-id: trunk@16109 -
2010-10-08 13:19:50 +00:00
pierre
7f200ab27e * Use asmsearchsym in assembler readers
git-svn-id: trunk@16104 -
2010-10-08 07:58:18 +00:00
pierre
f23695cf92 * Also declare GOT in main program
git-svn-id: trunk@16103 -
2010-10-07 22:14:58 +00:00
pierre
d2939bce3d * i386 _GLOBAL_OFFSET_TABLE_ label special treatment moved to taicpu.pass2
git-svn-id: trunk@16100 -
2010-10-07 14:14:25 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
pierre
292e85a59a * Partial fix for i386 linux PIC code generation
git-svn-id: trunk@16080 -
2010-10-05 08:07:15 +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
florian
3041bbab27 * fixes overflowing internalerror number
git-svn-id: trunk@15998 -
2010-09-16 20:46:11 +00:00
pierre
973c23e12c * Fix for win64 GNU AS bug
git-svn-id: trunk@15939 -
2010-09-02 23:41:02 +00:00
pierre
c03fa8e79d + Add warning if @GOTPCREL will not be honored
git-svn-id: trunk@15911 -
2010-08-26 15:51:36 +00:00
Jonas Maebe
99a75c56fc * fixed copy-paste error in r15600
* fixed spilling error after r15600 the same register appears twice in an
    instruction (it was spilled once in that case)

git-svn-id: trunk@15601 -
2010-07-18 21:24:52 +00:00
Jonas Maebe
a75016e67b * make sure that registers are of the right type before calling get_alias
on them (could cause crashes or, in very rare instances, wrong spilling
    code)

git-svn-id: trunk@15600 -
2010-07-18 21:01:06 +00:00
florian
9affb070b8 * don't force OT_BITS32 on x86-64, resolves #16622
git-svn-id: trunk@15595 -
2010-07-17 20:57:06 +00:00
Jonas Maebe
9273856e84 * disallow pusha*/popa* for x86_64 (mantis #14862)
* disallow pushfd/popfd for x86_64 (mantis #14862)
  * fixed assembling popfq with the internal assembler (it needs a rex.w
    prefisx, while pushfq doesn't)
  * changed the default opcode size of pushf/popf/pusha/popa in
    {$asmmode intel} from "native size" to 16 bit (compatible with Intel
    manuals and Kylix; in AT&T mode, the default size for those operations
    remains the native one)
  * changed pushf/popf in rtl/i386/* into pushfd/popfd because of the
    previous change

git-svn-id: trunk@15546 -
2010-07-10 16:22:46 +00:00
Jonas Maebe
a3a559cecc * part of r15538, forgot to commit
git-svn-id: trunk@15544 -
2010-07-10 15:05:30 +00:00
Jonas Maebe
c6d00a2b1f * correct the register size holding a smallset < 4 bytes when using "bt"
on it (mantis #16861)
  * fixed some indentation

git-svn-id: trunk@15531 -
2010-07-07 18:45:57 +00:00
Jonas Maebe
fff903a00b * fixed some unnecessary moving of values from cregister to register
after r7831

git-svn-id: trunk@15502 -
2010-06-30 19:53:15 +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
6d6892bec6 * fixed "byte/word/... ptr []" and "byte/word/..([])" typecasted expressions
in case the memory expression contains a record subscription (mantis
    #16700)

git-svn-id: trunk@15408 -
2010-06-11 14:51:58 +00:00
Jonas Maebe
3c8b23cda4 * fixed cg.a_loadmm_reg_ref() and cg.a_loadfpu_reg_ref() in case they are
used to store a record function result in an MM/FPUREGISTER to memory
    (the register size will be OS_F32/OS_F64, while the memory size will
     be OS_32/OS_64 -> convert the latter to the former)
  * extended tcalext6 to also test this scenario

git-svn-id: trunk@15385 -
2010-06-04 22:31:35 +00:00
Jonas Maebe
9e785ea553 + several internalerrors in case things go wrong
+ support for OS_M64 in several places

git-svn-id: trunk@15366 -
2010-06-03 19:09:27 +00:00
Jonas Maebe
8542632ebe * fixed evaluating constant expressions consisting of more than one term and
that start with a minus in the intel assembler reader (mantis #15843)

git-svn-id: trunk@15041 -
2010-03-24 20:52:31 +00:00
pierre
7c08e5cb57 * Fix solaris problem after commit rev 14971
git-svn-id: trunk@14974 -
2010-03-05 13:46:36 +00:00
Jonas Maebe
a7dca09535 * only refer to local symbols without GOT redirection on darwin/x86_64,
because on linux/x86_64
     a) the resulting code crashes when using the internal assembler
     b) refuses to link when using the external assembler
   (and hence I don't know whether it's safe to do on other non-darwin
    platforms either) -- fixes mantis #15889

git-svn-id: trunk@14971 -
2010-03-04 20:23:45 +00:00
Jonas Maebe
89110baab8 * don't modify the flags while simplifying PIC memory references
(mantis #15694)

git-svn-id: trunk@14871 -
2010-02-06 20:18:36 +00:00
Jonas Maebe
f90768ed6a * small optimisation for r14449: check whether the routine is a pure
assembler routine before checking whether an identifier may represent a
    register parameter, instead of afterwards

git-svn-id: trunk@14843 -
2010-02-02 10:40:25 +00:00
Jonas Maebe
28cd8271c9 * initial version of internal Mach-O/i386 assembler by Dmitry Boyarintsev
(mantis #15163)

git-svn-id: trunk@14628 -
2010-01-12 19:52:55 +00:00
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +00:00
florian
34227e811d + patch by Sven Barth to add native NT rtl support to the compiler, resolves #14886
git-svn-id: trunk@14565 -
2010-01-07 17:42:11 +00:00
Jonas Maebe
d3f9e6290b * fixed error in r14402 for functions/procedures that are not declared as
"assembler" (mantis #15370)

git-svn-id: trunk@14449 -
2009-12-17 16:04:09 +00:00
Jonas Maebe
f660e7cc6c * fisttp must get an "fpuint" suffix in the assembler output
git-svn-id: trunk@14418 -
2009-12-11 23:20:21 +00:00
Jonas Maebe
f2c0190aa3 * treat parameters that are passed in registers as register operands in the
x86 intel assembler reader (patch by Sergei Gorelkin, mantis #6851)

git-svn-id: trunk@14402 -
2009-12-11 13:33:05 +00:00
pierre
e67307aa66 * New constant system_needs_16_byte_stack_alignment
defined in system.pas
    used in x86/cgx86.pas
    and x86_64/cgcpu.pas
   

git-svn-id: trunk@14401 -
2009-12-11 09:50:27 +00:00
pierre
dbf2be812a * for rip_relative if cs_create_pic is selected
git-svn-id: trunk@14392 -
2009-12-10 13:38:34 +00:00
pierre
21bc57d4c1 * accept @PLT for pic functions
git-svn-id: trunk@14389 -
2009-12-10 13:07:44 +00:00
Jonas Maebe
b4c8c73e70 * changed tf_use_function_relative_addresses into an assembler flag (with
the opposite meaning, af_stabs_use_function_absolute_addresses), because it
    is different on Darwin for the internal and external assembler)

git-svn-id: trunk@14342 -
2009-12-06 13:21:28 +00:00
Jonas Maebe
4838ebe73b * renamed mark_InlineStart/mark_InlineEnd to mark_NoLineinfoStart/
mark_NoLineinfoEnd
  * add "no line info" markers for try/except and try/finally internal cleanup
    code, so the debugger doesn't jump back and forth between the end and start
    of exception blocks when you arrive at the end
  * honour "no line info" markers in dbgdwarf.pas

git-svn-id: trunk@14327 -
2009-12-04 19:37:22 +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
4123e0425c * don't generate instruction alignment fill bytes in non exectuable sections
git-svn-id: trunk@14251 -
2009-11-21 22:34:46 +00:00
pierre
ff25f1797c + Add gas for x86_64 solaris
git-svn-id: trunk@14239 -
2009-11-21 16:21:10 +00:00
Jonas Maebe
f7360d47c5 - removed aitconst_indirect_symbol, replaced with tai_directive
(patch by Dmitry Boyarintsev, mantis #15050)

git-svn-id: trunk@14157 -
2009-11-12 19:39:41 +00:00
Jonas Maebe
edacea82be * changed assembler directives for darwin lazy/non-lazy symbol pointers
and init/fini routines into their section equivalents (based on patch
    by Dmitry Boyarintsev, mantis #15037)

git-svn-id: trunk@14128 -
2009-11-09 22:20:01 +00:00
Jonas Maebe
559e284bd0 * merged r13762-14047 from trunk
git-svn-id: branches/objc@14048 -
2009-11-04 15:50:26 +00:00
Jonas Maebe
762a0c7059 * try to prevent addresses from being PICified multiple times (should fix
regressions after r13760)

git-svn-id: trunk@13795 -
2009-10-02 14:13:10 +00:00
Jonas Maebe
0c675a4039 * the objc1 unit has been renamed to objc
* the objc unit links against the Foundation instead of against the Cocoa
    framework, and inludes an interface to either the fragile or non-fragile
    obj-c run time depending on the target platform
  + support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
    for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
    are now also supported for the objectivec1 modeswitch
  + support for private_extern symbol bindings, required for the above
  * mark objcclasses that are declared in the implementation section of a
    unit as "hidden" (not sure what the effect is, since the Objective-C
    runtime does not seem to do anything with this flag)
  * enabled all obj-c tests for the newly supported platforms

git-svn-id: branches/objc@13763 -
2009-09-27 15:24:50 +00:00
Jonas Maebe
d34276c575 --- Merging r13696 through r13760 into '.':
U    ide/fpusrscr.pas
U    rtl/unix/video.pp
U    rtl/i386/i386.inc
U    rtl/win/wininc/defines.inc
U    rtl/win/systhrd.inc
U    rtl/linux/m68k/dllprt0.as
U    rtl/linux/i386/syscall.inc
U    rtl/linux/i386/dllprt0.as
U    rtl/linux/i386/si_c.inc
U    rtl/linux/i386/si_prc.inc
U    rtl/linux/i386/si_c21.inc
U    rtl/linux/i386/si_g.inc
U    rtl/linux/i386/si_c21g.inc
U    rtl/linux/i386/si_uc.inc
U    rtl/linux/i386/si_dll.inc
U    rtl/linux/x86_64/dllprt0.as
A    tests/test/packages/hash/sha1test.pp
U    tests/webtbs/tw12038.pp
U    compiler/cclasses.pas
U    compiler/symdef.pas
U    compiler/ncon.pas
U    compiler/ncgrtti.pas
U    compiler/cgbase.pas
U    compiler/pstatmnt.pas
U    compiler/systems/t_linux.pas
U    compiler/pass_1.pas
U    compiler/x86/cgx86.pas
U    compiler/x86/agx86att.pas
U    compiler/x86/aasmcpu.pas
U    compiler/aasmbase.pas
A    packages/fcl-xml/tests/extras.pp
A    packages/fcl-xml/tests/extras2.pp
--- Merging r13696 through r13760 into 'packages/fcl-xml/tests/README_DOM.txt':
U    packages/fcl-xml/tests/README_DOM.txt
--- Merging r13696 through r13760 into '.':
U    packages/fcl-xml/tests/domunit.pp
U    packages/fcl-xml/src/xpath.pp
U    packages/Makefile
U    packages/gmp/src/gmp.pas
U    packages/gmp/readme
U    packages/fcl-db/src/base/db.pas
U    packages/fcl-db/src/base/database.inc
U    packages/sqlite/src/sqlite3.inc
U    packages/fcl-web/src/custweb.pp
U    packages/hash/fpmake.pp
U    packages/hash/Makefile.fpc
A    packages/hash/src/sha1.pp
U    packages/hash/Makefile
U    packages/hash/examples/Makefile.fpc
A    packages/hash/examples/sha1test.pp
U    packages/hash/examples/Makefile
U    packages/Makefile.fpc
U    packages/fcl-base/src/ascii85.pp
U    packages/fcl-base/src/custapp.pp
U    packages/chm/src/chmwriter.pas
U    packages/chm/src/paslzx.pas
U    packages/chm/src/chmreader.pas
--- Merging r13761 into '.':
U    compiler/powerpc/agppcvasm.pas
U    compiler/ppcgen/agppcgas.pas

git-svn-id: branches/objc@13762 -
2009-09-27 14:13:44 +00:00