Commit Graph

252 Commits

Author SHA1 Message Date
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
d35d1ed357 + initial support for pascal booleans with sizes 2, 4 and 8
git-svn-id: branches/pasboolxx@17836 -
2011-06-26 15:02:37 +00:00
florian
2005f6869b * cycling with $R+ fixed
git-svn-id: trunk@17600 -
2011-05-28 21:18:35 +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
Jonas Maebe
b49b3ecc61 * one more fix that should have been part of r16717: also generate
addr_pic_no_got references for linux in a_loadaddr_ref_reg()

git-svn-id: trunk@16728 -
2011-01-07 19:17:47 +00:00
Jonas Maebe
0da9d36116 * fixed internal assembler for x86-64 so that it correctly handles
relocations for addr_pic_no_got references (do not go via the GOT)
  * fixed code generator so that it generates addr_pic_no_got references
    also for platforms that use the internal assembler (this will break linking
    of some tests that check static data > 2GB on Linux/x86-64, but they were
    already broken before as well because we don't use the "huge" x86-64
    execution model)
  * fixed x86-64 Linux syscall code to not expect GOT-based relocations for
    the system unit's errno variable (it's an implementation-only variable)

git-svn-id: trunk@16717 -
2011-01-06 09:28:25 +00:00
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
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
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
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
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
florian
c1f3d8dcaa * unified names of system_*/systems_* sets
git-svn-id: trunk@14566 -
2010-01-07 18:16:20 +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
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
ec8fee45fe * do not access local data via the GOT on x86_64, because
a) it's unnecessary
   b) it's slower than "direct" RIP-relative accessing
   c) it's not supported on darwin/x86_64 in certain cases
  * never use absolute addressing on darwin/x86_64 (like on win64)
  * when not generating PIC, make sure that a_loadaddr_ref_reg on x86_64
    also uses RIP-relative addressing for darwin/x86_64 and win64

git-svn-id: trunk@13760 -
2009-09-27 13:43:56 +00:00
Jonas Maebe
baf1ac22b7 * fixed r13469 (PLT entries are not GOT-relative). Not reverting all the
changes from that commit, because not hardcoding the use of
    current_procinfo in all cases when obtaining the GOT register is
    cleaner

git-svn-id: trunk@13470 -
2009-07-28 17:43:17 +00:00
Jonas Maebe
f265fbe343 * fixed GOT loading for i386 in stubs for external procedures whose external
name is (re)defined in the implementation (mantis #14221)

git-svn-id: trunk@13469 -
2009-07-28 17:28:17 +00:00
yury
41d50e4723 * Fixed dead code warning.
git-svn-id: trunk@13140 -
2009-05-13 11:27:48 +00:00
yury
92ad06f1e8 * Always use RIP relative symbol addressing for x86_64 Windows targets. Bug #13657.
* Support for simple form of RIP relative addressing by x86_64 assembler writer. Example: movl rax,SomeSymbol(%rip)

git-svn-id: trunk@13135 -
2009-05-13 10:07:44 +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
718694d1d6 * always specify an explicit alignment for tgobj.gettemp (so e.g.
shortstring temps don't get maximum alignment)
  * changed some gettemptyed() calls into gettemp() calls (gettemptyped
    means that this temp can only be used for temps of that type,
    which is necessary for refcounted types but not for floats)

git-svn-id: trunk@12036 -
2008-11-08 22:20:47 +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
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
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +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
Jonas Maebe
6c536dab3e * added several missing make_simple_ref() calls
* removed addr_pic again for darwin, as you have to explicitly code
    the relative address using a relsym instead of using an assembler
    directive like @GOT there

git-svn-id: trunk@9353 -
2007-11-29 22:06:14 +00:00
peter
dbba46c0e4 * set addr_pic
git-svn-id: trunk@9350 -
2007-11-29 21:15:22 +00:00
Jonas Maebe
c8f270c556 + darwin/x86_64 gprof support
git-svn-id: trunk@9252 -
2007-11-14 20:47:55 +00:00
Jonas Maebe
032352d98b + darwin/x86_64 support
git-svn-id: trunk@9180 -
2007-11-10 18:33:09 +00:00
Jonas Maebe
8d8ba9a583 * fixed pic reference loading for non-darwin i386 platforms after
r8657

git-svn-id: trunk@8993 -
2007-10-29 19:00:15 +00:00
florian
19b79468ad * store/load mmx registers properly
* sse registers can be stored/loaded aligned on x86-64

git-svn-id: trunk@8969 -
2007-10-28 14:08:57 +00:00
florian
f32831c44a * fixed assembling of fisttp of sse3 instruction set
+ sse3 optimized trunc() using fisttp
+ -Cfsse3 for x86-64

git-svn-id: trunk@8962 -
2007-10-27 20:50:46 +00:00
Jonas Maebe
c84744b27f * fixed a_jmp_name() for darwin/i386 (go via a stub)
* fixed g_external_wrapper for darwin/i386 (both with and without pic,
    by using a_jmp_name(), because the darwin jump stubs can always
    be called directly)

git-svn-id: trunk@8669 -
2007-09-28 14:12:46 +00:00
Jonas Maebe
3266f4e483 + Compiler support for pic on darwin/i386. The i386 rtl still needs
to be made pic-safe (mainly accesses to the global default8087cw)
  * At the same time also made the non-pic code abi-compliant (access
    external data via indirect symbol pointers etc)

    Darwin/i386 also puts the got into a virtual register (like
    Darwin/ppc), a.o. because the register allocator fails to colour
    a routine in aasmcpu.pas if we take away ebx from it.

git-svn-id: trunk@8657 -
2007-09-26 21:42:27 +00:00
Jonas Maebe
9750e49d5a * fixed x86 compilation after r8651
git-svn-id: trunk@8652 -
2007-09-26 17:25:38 +00:00
Jonas Maebe
ecd2445602 + segment register support in g_concatcopy (should fix #9667, but I
can't test since I don't have Dos/Windows -- at least the changes
    don't break Linux/i386)

git-svn-id: trunk@8608 -
2007-09-22 20:10:56 +00:00
tom_at_work
b0bb3f94a7 * improve powerpc64/linux stub for external procedures in units: also consider GOT change in call to this external procedure
* refactored above mentioned stub code generation, allowing the CG to define a cpu specific method for this task by overriding new g_external_wrapper() method

git-svn-id: trunk@8566 -
2007-09-19 20:41:39 +00:00
peter
2f044481ae * release temp when downgrading fpuregister value
git-svn-id: trunk@8530 -
2007-09-17 20:52:24 +00:00
daniel
a05d228679 - Remove IE from g_concatcopy again.
git-svn-id: trunk@8065 -
2007-07-15 16:15:13 +00:00
daniel
f0633187f4 + Change constants in g_concatcopy to make the right decisions on x86_64.
* Fix move copy in g_concatcopy for x86_64.

git-svn-id: trunk@8058 -
2007-07-14 21:29:57 +00:00
daniel
4f6eb50391 + Internalerror if g_concatcopy is called with len=0.
git-svn-id: trunk@8052 -
2007-07-14 18:56:16 +00:00
florian
c7100799ed + forbid usage of $E on targets supporting no fpu emulation
- disabled -Cfsoft on i386

git-svn-id: trunk@7625 -
2007-06-10 17:03:26 +00:00
florian
fe69d19f9c * align stack properly if no stack frame is generated, should resolve #8986
git-svn-id: trunk@7611 -
2007-06-09 18:46:35 +00:00
florian
f87e96dfb0 * properly release open array value parameters on x86-64 or if they contain automated types, resolves #8664
git-svn-id: trunk@7100 -
2007-04-13 19:20:56 +00:00