Commit Graph

164 Commits

Author SHA1 Message Date
nickysn
c8487c4150 + added individual bits of the x86 flags register as subregisters
git-svn-id: trunk@35955 -
2017-04-26 13:52:52 +00:00
svenbarth
c8202061dc * get rid of addr_load_indirect again by having tcgx86 provide an internal implementation of both make_simple_ref() and a_load_ref_reg() so that make_direct_ref() can call the latter (and the latter the former) without fear of inifinite recursive calls due to the symbol; a_load_ref_reg() is additionally declared as "final" as a_load_ref_reg_internal() needs to be overloaded instead (which is the case for tcg8086)
git-svn-id: trunk@34579 -
2016-09-30 14:01:02 +00:00
Jonas Maebe
27bb656cec * replaced "in_make_direct_ref" field with a trefaddr flag
git-svn-id: trunk@34548 -
2016-09-20 21:43:52 +00:00
nickysn
0fdc62e0f7 + initialize DS with the current unit's data segment in the function entry code
generated in the huge memory model

git-svn-id: trunk@31500 -
2015-09-03 21:44:16 +00:00
florian
4d01271944 * due to avr's harvard architecture, loads of code labels need to use the gs(...) macro
git-svn-id: trunk@30559 -
2015-04-12 20:29:13 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
7fc9d775df + support for @page and @pageoffs addressing on AArch64: these are PIC
references that directly take the address of a symbol, rather than
    of its GOT entry
   o use these addressing modes to access local symbols

git-svn-id: trunk@29932 -
2015-02-23 22:53:43 +00:00
Jonas Maebe
123503a4f7 + GOT-related (Darwin) address modes
git-svn-id: trunk@29847 -
2015-02-23 22:49:10 +00:00
Jonas Maebe
67c9d60b72 * factored out the check regarding whether the index of a vecn needs to be
loaded into a register because of its size
   o by default, also allow if the size is the same as OS_ADDR but with a
     different sign

git-svn-id: trunk@29827 -
2015-02-23 22:48:08 +00:00
Jonas Maebe
bacd303208 * synchronized with trunk up to r27758
git-svn-id: branches/hlcgllvm@27779 -
2014-05-12 16:12:34 +00:00
nickysn
ec6dfb5853 + added tcgsize2str function
git-svn-id: trunk@27453 -
2014-04-03 16:50:50 +00:00
sergei
9c54cdc85d * x86: Cleaned out addr_far,addr_far_ref used to encode far calls/jumps. NASM (and FPC x86 assembler based on it) already have opsize=S_FAR for this purpose.
git-svn-id: trunk@27037 -
2014-03-08 22:54:43 +00:00
Jonas Maebe
1df3039424 + LLVM temp allocator based on new R_TEMPREGISTER register class. For every
temp we allocate, we set the base register to a newly allocated
    R_TEMPREGISTER. This allows for uniquely identifying a temp even if its
    offset is modified.

git-svn-id: branches/hlcgllvm@26033 -
2013-11-11 11:14:59 +00:00
florian
4148637c8c * fold mov/lea/mov as well if possible
git-svn-id: trunk@25905 -
2013-11-01 19:01:29 +00:00
Jonas Maebe
2ba22f666e + support for R_SUBMMX and R_SUBMMY in generic_regname()
git-svn-id: trunk@25225 -
2013-08-07 12:41:47 +00:00
nickysn
9dbbffba61 + added trefaddr.addr_seg for referencing the segment of a symbol
git-svn-id: trunk@24859 -
2013-06-10 01:16:37 +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
2279e51a95 + added trefaddr.addr_far for emitting far calls
git-svn-id: trunk@24826 -
2013-06-09 10:24:06 +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
8d6017348a * fixed the defines of OS_PAIR and OS_SPAIR for cpus with 16-bit or 8-bit ALU
git-svn-id: branches/i8086@23797 -
2013-03-12 01:00:40 +00:00
sergei
a519741d89 - Revert {$J-} accidentally committed in r23555.
git-svn-id: trunk@23556 -
2013-02-01 16:49:46 +00:00
sergei
503b132096 * cgbase.pas: added more MIPS-specific address types, needed to support large GOT model.
* cpugas.pas: GetReferenceString: rewritten, it is easier than trying to fix it. Fixes incorrect writing of non-PIC references containing base, symbol and offset together, and some forms of PIC references. Also supports newly introduced address types.

git-svn-id: trunk@23555 -
2013-02-01 16:46:22 +00:00
pierre
493c77bca0 + Add addr_pic_call16 relocation type for mips
git-svn-id: trunk@23547 -
2013-01-31 13:08:49 +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
67744ef46e * fix methodpointers in registers on big endian targets
git-svn-id: trunk@22362 -
2012-09-09 17:54:35 +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
Jonas Maebe
0fc422f244 * moved definition of maxcpuregister and tcpuregisterset from cgbase to
cgutils, and define them so they are no larger than what is required by
    the current target platform
  * added cgutils to the uses clause of several units that use the
    tcpuregisterset type

git-svn-id: trunk@21624 -
2012-06-15 18:24:35 +00:00
Jonas Maebe
aee5380ae0 * merged trunk up to r20882
o support for the new codepage-aware ansistrings in the jvm branch
   o empty ansistrings are now always represented by a nil pointer rather than
     by an empty string, because an empty string also has a code page which
     can confuse code (although this will make ansistrings harder to use
     in Java code)
   o more string helpers code shared between the general and jvm rtl
   o support for indexbyte/word in the jvm rtl (warning: first parameter
     is an open array rather than an untyped parameter there, so
     indexchar(pcharvar^,10,0) will be equivalent to
     indexchar[pcharvar^],10,0) there, which is different from what is
     intended; changing it to an untyped parameter wouldn't help though)
   o default() support is not yet complete
   o calling fpcres is currently broken due to limitations in
     sysutils.executeprocess() regarding handling unix quoting and
     the compiler using the same command lines for scripts and directly
     calling external programs
   o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
     to the make command line

git-svn-id: branches/jvmbackend@20887 -
2012-04-15 15:54:10 +00:00
florian
fcd3872d88 + introduction of tcgint
git-svn-id: trunk@17017 -
2011-02-26 20:15:53 +00:00
florian
26ce3cef00 * compilation fixes
* completed a_load_ref_reg
+ implemented procedure entry/exit code generation
+ implemented a_load_reg_ref

git-svn-id: trunk@17009 -
2011-02-26 20:08:23 +00:00
florian
8b245369e1 + implemented normalize_ref
git-svn-id: trunk@17008 -
2011-02-26 20:03:39 +00:00
Jonas Maebe
f302fcdc98 + TSubRegisterSet definition forgotten to commit in r15952
* fixed compilation on non-x86 platforms after r15952

git-svn-id: trunk@15956 -
2010-09-09 08:48:02 +00:00
Jonas Maebe
025ec34e4d + "CExtended" type that is the same as "extended", but conforming to the
properties/behaviour of the equivalent of Extended in C (i.e., to
    "long double" on i386 and x86_64 platforms that support a 10 byte
    long double, and to "double" elsewhere)

git-svn-id: trunk@14912 -
2010-02-14 13:45:58 +00:00
florian
e5ebb2a26e * started to integrate the code of David Zhang's MIPS code from fpc-mips on sf into fpc trunk
git-svn-id: trunk@14219 -
2009-11-19 22:07:10 +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
florian
6898b10e2e * fixed order of cgloc2str strings
git-svn-id: trunk@13352 -
2009-06-29 19:27:51 +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
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
florian
b5c114934d * reverted 9727 and made a better fix for it
git-svn-id: trunk@9734 -
2008-01-13 13:23:19 +00:00
florian
295fdbe37c * use the current cgsizes instead of the def to determine if loadfpu can be used, else softfloats are broken
git-svn-id: trunk@9728 -
2008-01-13 09:59:13 +00:00
Jonas Maebe
20dbda751a * fixed sparc compilation after addr_lo/hi changes
git-svn-id: trunk@8107 -
2007-07-20 12:30:16 +00:00
tom_at_work
2d1f9b20a3 * merged trefaddr.addr_lo/addr_hi with trefaddr.addr_low/addr.high; some related bugfixing/cleanup
git-svn-id: trunk@7983 -
2007-07-08 20:50:58 +00:00
peter
f2a25e845d * refactor gen_alloc_symtable so it depends on varsym type and not
on symtabletype

git-svn-id: trunk@5259 -
2006-11-05 21:53:40 +00:00
Jonas Maebe
9acc38e82a * moved some more common powerpc32/64 things to ppcgn
+ a few initial darwin/ppc64 things

git-svn-id: trunk@5197 -
2006-11-03 12:30:17 +00:00
florian
fb5e396881 + experimental -Sv option to support vector arithmetics
git-svn-id: trunk@4825 -
2006-10-07 21:39:48 +00:00
Jonas Maebe
2e131baa4c * code generator support for subsetreferences (memory locations which
are not a multiple of 8 bits, nor necessarily aligned at a
    multiple of 8 bits). Supports both constant and variable bit
    indices.

git-svn-id: trunk@4443 -
2006-08-19 11:14:43 +00:00
Jonas Maebe
8e5e1d8cdb * another shuffle fix
git-svn-id: trunk@3857 -
2006-06-13 07:54:35 +00:00
Jonas Maebe
bbeb8c14b1 * fixed shuffle helpers
git-svn-id: trunk@3856 -
2006-06-13 07:53:39 +00:00
Jonas Maebe
e344ee3cd7 + support for register variables which contain records
git-svn-id: trunk@3580 -
2006-05-19 15:49:07 +00:00