Commit Graph

292 Commits

Author SHA1 Message Date
florian
94cf650d9a * use lea to adjust stack pointer, this is equal or faster on all modern CPUs than add/sub
git-svn-id: trunk@25010 -
2013-06-28 17:06:57 +00:00
florian
466eb4c684 * use MOVAPS/MOVAPD for reg -> reg moves to reduce data dependencies
git-svn-id: trunk@24967 -
2013-06-24 20:55:04 +00:00
florian
e81d2d1f3b * basic avx support for floating point operations (use -Cfavx to activate)
git-svn-id: trunk@24896 -
2013-06-14 20:03:01 +00:00
nickysn
62316da236 * a_call_reg moved to a_call_reg_near
git-svn-id: trunk@24855 -
2013-06-09 22:09:39 +00:00
nickysn
604b7c9deb + added cg.a_call_ref_near and a_call_ref_far
git-svn-id: trunk@24853 -
2013-06-09 20:22:47 +00:00
nickysn
ec497ae11e + the regular tcgx86.a_call_name and .a_call_name_static moved to .a_call_name_near and .a_call_name_static_near, because a_call_name and a_call_name_static are going to be overriden in tcg8086
git-svn-id: trunk@24827 -
2013-06-09 10:42:39 +00:00
nickysn
ec76b2cf40 * refactored the segment-in-integer-register reference support, so it's handled in make_simple_ref, instead of all over the place in the code generator
git-svn-id: trunk@24752 -
2013-06-01 22:18:09 +00:00
nickysn
c9c882c30a * always use 16-bit pushes for pushing/popping the segment registers on i8086 in Tcgx86.g_concatcopy
git-svn-id: trunk@24735 -
2013-06-01 17:49:49 +00:00
nickysn
e243b6b869 * never use the 66h prefix when pushing/popping segment registers on i8086, as the stack is aligned on 2 bytes there
git-svn-id: trunk@24729 -
2013-06-01 16:03:14 +00:00
nickysn
c2e3fb5918 + emit proper interrupt procedure entry/exit code on i8086
git-svn-id: trunk@24728 -
2013-06-01 15:50:11 +00:00
nickysn
0a8e008a0d + the ES register made volatile on i8086 as per the 16-bit x86 calling conventions
git-svn-id: trunk@24462 -
2013-05-07 14:27:21 +00:00
nickysn
e4f3dd1264 * do not emit shl/shr with a const different than 1 on 8086
git-svn-id: trunk@24382 -
2013-04-29 23:02:09 +00:00
nickysn
fbc41991f9 * i8086 fixes in tcgx86.a_op_reg_reg for 16-bit OP_SHR,OP_SHL,OP_SAR,OP_ROL,OP_ROR
git-svn-id: branches/i8086@23881 -
2013-03-17 00:05:05 +00:00
florian
edd4c1ce4b * proper fix to avoid sp relative adressing as r23867 tries
git-svn-id: branches/i8086@23868 -
2013-03-16 16:51:31 +00:00
florian
b321f867c6 + trgintcpu.add_cpu_interferences for i8086 so references are properly build
* empty make_simple_ref code path for i8086

git-svn-id: branches/i8086@23782 -
2013-03-10 18:51:42 +00:00
nickysn
95b15d15bd another nested ifdef cleaned up
git-svn-id: branches/i8086@23741 -
2013-03-09 11:35:42 +00:00
nickysn
981f0a5c6c nested ifdefs converted to series of elseif + some other ifdefs cleaned up
git-svn-id: branches/i8086@23740 -
2013-03-09 11:25:25 +00:00
nickysn
5f7d432ff9 i8086 fixes in Tcgx86.g_concatcopy and TCGSize2OpSize
git-svn-id: branches/i8086@23720 -
2013-03-08 00:13:02 +00:00
Jonas Maebe
5d628b29bb * set the subregsize of OS_M64 SSE registers to R_SUBQ so we can
differentiate between 64 bit and 128 bit (R_SUBMMWHOLE) SSE vector regs,
    and support spilling/assembling for R_SUBQ SSE registers (8 bytes)
    (mantis #23962)

    We currently never use the full 128 bit of an SSE register, and
    spilling for those hasn't been implemented yet either (R_SUBMMWHOLE
    SSE regs are spilled into a 4-byte temp currently -> can overwrite data)

git-svn-id: trunk@23700 -
2013-03-06 12:42:46 +00:00
yury
e13e2e1697 * Turn off special handling of interrupt calling convention for i386-android.
git-svn-id: branches/targetandroid@23492 -
2013-01-22 14:43:42 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
sergei
7530fb3352 * tcgx86.make_simple_ref: handle references to absolute addresses (these are quite rare on x86_64, but still worth to handle correctly).
* If possible, use reference base instead of index, this yields shorter instructions.
* Added comment about offset limits for rip-relative addressing.
- Removed code related to taking threadvar address on win32, it is incorrect because Windows TLS is not directly accessible via segment registers (fs:0x2c points to array of pointers to TLS storages of each module, so at least double indirection is needed).

git-svn-id: trunk@23342 -
2013-01-07 16:00:12 +00:00
florian
d7e0f07aab + UseAVX check
git-svn-id: trunk@22642 -
2012-10-14 14:04:31 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
florian
8818b58e5d * Bsf/Bsr on x86 handle now correctly 0 as argument, resolves #22783
* generic Bsf implementations handle now correctly 0 as argument
* test extended

git-svn-id: trunk@22327 -
2012-09-05 13:51:45 +00:00
Jonas Maebe
b1dc518ac4 * removed systems_need_16_byte_stack_alignment and use target_info.stackalign instead
git-svn-id: trunk@22279 -
2012-09-02 14:32:21 +00:00
Jonas Maebe
952ac1ffa6 * only use indirect symbol loads for (weak)external and private_external
symbols on darwin/ppc and darwin/i386, and also for common symbols on
    darwin/ppc, as they're not required for other kinds of symbols on those
    platforms (gcc doesn't use them either with -O1 and higher; it does use
    them always for darwin/ppc64 except for local symbols, and hence so do we)

git-svn-id: trunk@22271 -
2012-08-30 21:30:38 +00:00
Jonas Maebe
35c70a6c96 * copy the darwin got register to a new register when using it, so it
cannot get modified

git-svn-id: trunk@22240 -
2012-08-25 15:12:34 +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
408f459f5a * the code generator bugs referred to in r21921 weren't completely fixed yet
after all, although for some reason the problems only showed up with the
    external assembler on x86-64 platforms other than Darwin. Now we never use
    GOT entries on x86-64 anymore for local symbols, regardless of their nature,
    and instead use plain RIP-relative addressing for them.

git-svn-id: trunk@21924 -
2012-07-17 14:36:37 +00:00
Jonas Maebe
bb28a7cd08 * decrease the fpu stack position counter after explicitly inserted
fist(t)pq instructions (mantis #22331)
  * also internalerror in case the internal fpu stack position counter
    becomes larger than 7, so we don't have to wait for the entire
    byte to overflow before we detect a problem

git-svn-id: trunk@21734 -
2012-06-29 09:52:35 +00:00
Jonas Maebe
260958eb45 * changed last parameter of g_indirect_sym_load() to a set and also
pass on whether the symbol refers to code or data (important for
    AIX weak symbols; note that AIX does not support undefined weak
    external symbols, and FPC does not yet support weakly defining
    non-external symbols, so this functionality isn't really used yet)

git-svn-id: trunk@20802 -
2012-04-11 18:02:03 +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
florian
c4a5499d2a * handle flag to reg./ref. conversion correctly for boolean64
git-svn-id: trunk@19914 -
2011-12-29 17:28:35 +00:00
florian
a59a37dddd * handle assignments of qword bools with LOC_FLAGS correctly, resolves #20874
git-svn-id: trunk@19912 -
2011-12-29 16:48:46 +00:00
florian
60cccdcdbd * improve heuristics for copy_move vs. copy_string when optimizing for size, #20664
git-svn-id: trunk@19758 -
2011-12-04 21:18:56 +00:00
sergei
ce3f850a68 * x86_64, use rip-relative references when taking address of local code labels, fixes test/library/tlib1a.pp for Linux and FreeBSD and passing exception address to FPC_RAISEEXCEPTION on Darwin.
git-svn-id: trunk@19616 -
2011-11-09 05:12:59 +00:00
sergei
4c21beb48e win64 unwinding, misc fixes:
* Insert seh_endprologue directive after the last prologue instruction, not before it
* Omit seh_stackalloc for zero bytes
* (For now) ignore SEH directives in NASM and MASM writers, instead of failing with internal error.

git-svn-id: trunk@19246 -
2011-09-26 13:55:21 +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
florian
13ac5d185f * fix add_move_instruction for sse moves
git-svn-id: trunk@18789 -
2011-08-20 12:30:47 +00:00
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