Commit Graph

17825 Commits

Author SHA1 Message Date
Jonas Maebe
cea2741339 * correct paraloc size for 3-byte records passed in the lower bits of a
register (32 bit instead of 64 bit register)

git-svn-id: trunk@30222 -
2015-03-14 18:36:43 +00:00
Jonas Maebe
3d6fcd8815 + ppc64le/ELFv2 ret_in_param implementation
* fixed ret_in_param for other ppc64 ABIs

git-svn-id: trunk@30221 -
2015-03-14 18:36:40 +00:00
Jonas Maebe
a02fb7c794 * fixed misplaced braces that caused all records to be passed by reference
on ppc64 with the mwpascal calling convention, instead of only the const
    ones

git-svn-id: trunk@30219 -
2015-03-14 18:36:35 +00:00
Jonas Maebe
7bc66a5142 + ELF/ppc64le resource support
git-svn-id: trunk@30218 -
2015-03-14 18:36:32 +00:00
Jonas Maebe
6b9b575b74 * choose between arm (little endian) and armeb for fpcres based on the
target_info rather than based on the source_info

git-svn-id: trunk@30217 -
2015-03-14 18:36:29 +00:00
Jonas Maebe
eee83ebb4a * use generic code for a_load_subsetref_regs_noindex on ppc64le
git-svn-id: trunk@30216 -
2015-03-14 18:36:26 +00:00
Jonas Maebe
cf5b42b4b2 * use generic code for set+setelement on ppc64le
git-svn-id: trunk@30214 -
2015-03-14 18:36:20 +00:00
Jonas Maebe
399ffb2005 * allocate enough room in assembler routines for a complete linkage area
so that potential callees have enough room to store their LR etc
    if needed

git-svn-id: trunk@30212 -
2015-03-14 18:36:14 +00:00
Jonas Maebe
3ab62dcfed * switched Linux/PowerPC64 to Pascal startup code so that we can used ifdefs
to detect whether we're compiling for ELFv1/SYSV or ELFv2

git-svn-id: trunk@30210 -
2015-03-14 18:36:08 +00:00
Jonas Maebe
d6499b4bc0 + rldcl., rldicl., rldcr[.] and rldicr[.] opcodes (needed for new
bootstrapping code)

git-svn-id: trunk@30208 -
2015-03-14 18:36:02 +00:00
Jonas Maebe
5a6b9c9f16 * store/reload toc around indirect calls for ELFv2 ABI
* ensure that register calls happen via R12 on the ELFv2 ABI

git-svn-id: trunk@30207 -
2015-03-14 18:35:59 +00:00
Jonas Maebe
33ed32b024 * when targeting the ELFv2 ABI, don't reserve space for the (never used)
words in the linkage area reserved for use by the compiler and linker

git-svn-id: trunk@30206 -
2015-03-14 18:35:56 +00:00
Jonas Maebe
3d9713b9c8 * has_single_field() now looks recursively into fields that are aggregate
types until it finds a non-aggregate type, and then returns "true" if
    that aggregate (record or array) contains one element
  * it now also returns the type of that element directly rather than a
    tfieldvarsym, since we only care about the type and in case of an array
    there is no field

git-svn-id: trunk@30205 -
2015-03-14 18:35:53 +00:00
Jonas Maebe
2e126bb723 - removed darwin/i386 special case code from i8086 code generator
git-svn-id: trunk@30204 -
2015-03-14 18:35:50 +00:00
Jonas Maebe
9788b01d31 * rewrote most of the special case handling of parameter passing on ppc64,
documenting the pecularities of the various calling conventions and
    marking what we do and don't support currently
  * also handle arrays for the ELFv2 ABI when determining whether an aggregate
    only contains floating values of a single type

git-svn-id: trunk@30203 -
2015-03-14 18:35:47 +00:00
Jonas Maebe
165aaea8a4 * made a separate abi entry for powerpc_darwin, as it's not exactly the same
as the AIX abi (especially on ppc64)
   o replaced (for now) all checks for the AIX abi with a check for either the
     AIX or Darwin abi
   o changed the ABI of Darwin/ppc, Darwin/ppc64 and Mac OS/ppc to
     abi_powerpc_darwin

git-svn-id: trunk@30202 -
2015-03-14 18:35:44 +00:00
Jonas Maebe
25340480b0 * factored out creating a single paraloc, so we can reuse it for creating
function return locations

git-svn-id: trunk@30201 -
2015-03-14 18:35:41 +00:00
Jonas Maebe
f0ee1a9ee3 * pass records that (recursively) only contain floating point values of the
same type (even in other records or in arrays), with 8 or less such
    values, as if those values were passed individually on ppc64/ELFv2

git-svn-id: trunk@30200 -
2015-03-14 18:35:38 +00:00
Jonas Maebe
9a73c9a460 * avoid string truncation for ait_symbolpair in assembler writer
git-svn-id: trunk@30199 -
2015-03-14 18:35:34 +00:00
Jonas Maebe
fb27dff638 * generate ".abiversion 2" directive when targeting ppc64/ELFv2
* generate code to load the TOC register if it's required, and
    emit the the ".localentry" directive to indicate to the linker
    where the actual function body starts
  * support the ".localentry" directive in the ppc64 assembler reader
   o disable the fpc_qword_to_double() assembler implementation for
     ELFv2, because we can't manually insert the .localentry directive
     before the stack allocation code
  * perform indirect calls on ppc64 via R12 in ncgcal, as R12 needs to
    contain the function address on entry on ppc64/ELFv2 (and it's
    a volatile register, so there's no problem with always using
    it)

git-svn-id: trunk@30198 -
2015-03-14 18:35:31 +00:00
Jonas Maebe
8445381929 * merged ait_set and ait_thumb_set into a single tai class
(tai_symbolpair)

git-svn-id: trunk@30197 -
2015-03-14 18:35:28 +00:00
Jonas Maebe
1e227f78fe * factored out the check for whether we have to generate dotted function
names, and disabled them for ppc64 ELFv2
  * disabling those also disables the function descriptors, so use the
    _CALL_ELF compiler variable to check whether there is in fact a
    function descriptor

git-svn-id: trunk@30196 -
2015-03-14 18:35:25 +00:00
Jonas Maebe
cc071ded4b * define _CALL_ELF=1 or _CALL_ELF=2 symbol when targeting ppc(64)
ELFv1/ELFv2, like GCC

git-svn-id: trunk@30195 -
2015-03-14 18:35:22 +00:00
Jonas Maebe
05f6660a25 * set the correct dynamic linker for the ppc64 ELFv2 abi
* specify the correct linker emulation to use for ppc64 ELFv2 little endian
  * specify the correct default library directories to search for ELFv2 little
    endian

git-svn-id: trunk@30194 -
2015-03-14 18:35:19 +00:00
Jonas Maebe
3946971c73 * default to ppc64le/elfv2 when compiling on a ppc64le platform
* default to elfv2 abi when targeting ppc64le and no abi has been specified

git-svn-id: trunk@30193 -
2015-03-14 18:35:16 +00:00
Jonas Maebe
0e76a84e04 + "ELFv2" abi identifier for ppc64
git-svn-id: trunk@30192 -
2015-03-14 18:35:13 +00:00
Károly Balogh
918c4add06 m68k: in do_spill_replace, exclude the case where the source register would be an address and the destination is a reference
git-svn-id: trunk@30191 -
2015-03-14 17:19:14 +00:00
Károly Balogh
935820293c m68k: in tm68ktypeconvnode.int_to_real, fix the reference before using it, and if the source is a register, make sure it's a data register
git-svn-id: trunk@30190 -
2015-03-14 17:14:10 +00:00
Károly Balogh
1121c2e6ce m68k: before doing a reg->ref operation, make sure the source is a datareg
git-svn-id: trunk@30189 -
2015-03-14 16:36:02 +00:00
Jeppe Johansen
52e505bff7 Fixed internal error in GOT related code for ARM internal assembler.
git-svn-id: trunk@30188 -
2015-03-14 16:03:16 +00:00
Jeppe Johansen
439027a8de Add most pre-UAL VFP instruction forms.
Add fused mac instructions for VFPv4.

git-svn-id: trunk@30187 -
2015-03-14 14:59:13 +00:00
Jeppe Johansen
64f127141f Add VFPv4 FPU type for ARM.
Fix assembler reader so it can read instructions longer than 5 characters.

git-svn-id: trunk@30186 -
2015-03-14 12:49:07 +00:00
Jeppe Johansen
73abf5e630 Merge from armiw branch.
Update ARM internal assembler to support most ARM, Thumb and Thumb-2 instructions.
Changed generation of VFP instructions to use UAL mnemonics.
Added divided and unified assembler syntax support to ARM assembly reader.

git-svn-id: trunk@30181 -
2015-03-13 19:22:27 +00:00
Jeppe Johansen
b75330760d Merged from trunk.
git-svn-id: branches/laksen/armiw@30180 -
2015-03-13 18:58:57 +00:00
Jeppe Johansen
5f622752ce Disable internal assembler
git-svn-id: branches/laksen/armiw@30179 -
2015-03-13 18:56:59 +00:00
Jonas Maebe
d4bc74ecc0 * support for -WM10.XX (for 10.10) and defining the correct associated
version macro

git-svn-id: trunk@30178 -
2015-03-13 08:35:30 +00:00
Jonas Maebe
5b3c511467 * don't crash when "return exitvalue" is used in a procedure
git-svn-id: trunk@30177 -
2015-03-13 08:35:26 +00:00
Jonas Maebe
2dcd42d4f1 * fixed detection of an objcprotocols descending from a forward-defined
objcprotocol

git-svn-id: trunk@30169 -
2015-03-12 19:37:43 +00:00
florian
f0984fb628 * abstractrecorddef.contains_float_field should search recursively, resolves #27580
git-svn-id: trunk@30168 -
2015-03-11 22:05:14 +00:00
pierre
b0d8f487c1 Makefile regenerated after previous commit: Fix fullinstall for win64 and disable 8086 and i386 compiler for win64 os source only for fullcycle and fullinstall
git-svn-id: trunk@30167 -
2015-03-11 22:03:52 +00:00
pierre
999436c5e6 Fix fullinstall for win64 and disable 8086 and i386 compiler for win64 os source only for fullcycle and fullinstall
git-svn-id: trunk@30166 -
2015-03-11 21:57:47 +00:00
Jonas Maebe
fc21845686 * fixed the allocation of R12 on ppc32/ppc64 when used to hold the value of
the stack pointer during the prolog. This was done previously in
    tcg.g_proc_entry(), but that routine is called after register allocation
    and hence has no influence. Also cleaned up the deallocation of that
    register by moving the previously ifdef'd code to thlcgppcgen
    (mantis #27634)

git-svn-id: trunk@30164 -
2015-03-11 17:49:44 +00:00
pierre
21fe7616a4 Avoid line longer than 255 characters, to be able to edit inside FP IDE
git-svn-id: trunk@30158 -
2015-03-10 07:56:18 +00:00
Jonas Maebe
6a70c84258 + internal bsr/bsf support for ppc32 and ppc64
git-svn-id: trunk@30152 -
2015-03-09 16:48:34 +00:00
Jeppe Johansen
3d7dce81fe Make MRS and MSR use the right encoding on Thumb architectures.
Set regnumber_count_bsstart to 128 to be able to search all registers.

git-svn-id: branches/laksen/armiw@30150 -
2015-03-08 17:30:38 +00:00
Jeppe Johansen
03b9e5117f Fix off by 1 error in assembler reader which prevented B instructions from being parsed.
git-svn-id: branches/laksen/armiw@30147 -
2015-03-08 12:52:43 +00:00
Jeppe Johansen
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
Jeppe Johansen
d12b913e70 Add initial support in ARM-embedded for Allwinner A20.
git-svn-id: trunk@30144 -
2015-03-08 12:22:57 +00:00
Károly Balogh
0021ad714f * fixed some ancient code behind cpu_uses_separate_address_registers define to at least compile again, for some m68k experiment
git-svn-id: trunk@30130 -
2015-03-07 22:11:43 +00:00
Jonas Maebe
b931f78b4b * insert a type conversion from ordinal to pointer for pointerconstn
git-svn-id: branches/hlcgllvm@30129 -
2015-03-07 21:44:01 +00:00
Jonas Maebe
c1e7c9de02 * support for flushing a ttai_typedconstbuilder queue with an ordinal
constant at the end (in case of e.g. ordinal -> pointer type
    conversions)

git-svn-id: branches/hlcgllvm@30128 -
2015-03-07 21:43:57 +00:00
Jonas Maebe
eba3f534de * correctly handle empty ansistring constants for llvm
git-svn-id: branches/hlcgllvm@30127 -
2015-03-07 21:43:52 +00:00
Jonas Maebe
935c0c86aa * write all ait_const's of value 0 as 'zeroinitializer' so they also work
for pointer constants

git-svn-id: branches/hlcgllvm@30126 -
2015-03-07 21:43:47 +00:00
Legolas
ffd03563d0 * Updated Wii rtl (unicode support broken .dol executables) and libogcfpc to ver.1.8.12. Fixed a dependency to Mad library too
git-svn-id: trunk@30125 -
2015-03-07 21:34:51 +00:00
Jonas Maebe
9c42437326 * moved tasmlisttypedconstbuilder.tc_emit_string_offset() to
ttai_typedconstbuilder.emit_string_offset() so it can also be used outside
    the context of parsing a Pascal-level typed constant

git-svn-id: branches/hlcgllvm@30111 -
2015-03-06 19:45:04 +00:00
sergei
a709a9b637 * MIPS peephole: check that operand is present before accessing its fields, also check that it's not a branch target. Mantis #27608.
git-svn-id: trunk@30110 -
2015-03-06 00:04:06 +00:00
Jonas Maebe
511e878606 * fixed pointer plus/minus integer on llvm (since a_op_* only gets a single
def, we have to ensure that both arguments have in fact the same type)

git-svn-id: branches/hlcgllvm@30108 -
2015-03-05 22:45:32 +00:00
Jonas Maebe
f9ae2aadac * fixed llvm unsigned greater/lower than condition mnemoniics
git-svn-id: branches/hlcgllvm@30107 -
2015-03-05 22:20:50 +00:00
Jonas Maebe
ea00e559f8 * fixed compilation after previous merge
git-svn-id: branches/hlcgllvm@30106 -
2015-03-05 22:20:45 +00:00
Jonas Maebe
06dd396a2f * fixed writing float values using the internal assembler after r28105
git-svn-id: branches/hlcgllvm@30105 -
2015-03-05 21:41:56 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Károly Balogh
a71fcd290b * allocate a temp addressreg instead of a temp intreg in callnode. improves code generation on m68k for these cases
git-svn-id: trunk@30080 -
2015-03-02 22:21:53 +00:00
Károly Balogh
106056f462 m68k: more FMOVEM.X store/load size fixes
git-svn-id: trunk@30062 -
2015-03-02 02:55:23 +00:00
Károly Balogh
acaf382ea0 m68k: FMOVEM.X stores/loads each reg as 12 bytes (96 bits) not 10 bytes (80 bits), see 68k PRM, page 5-86
git-svn-id: trunk@30061 -
2015-03-02 02:48:35 +00:00
Jonas Maebe
6dd2fe0320 * converted widestr.charlength() to use system.Utf8CodePointLen()
git-svn-id: trunk@30050 -
2015-03-01 17:12:27 +00:00
Károly Balogh
5f66d63335 m68k: disabled comment generation
git-svn-id: trunk@30045 -
2015-03-01 15:49:57 +00:00
Károly Balogh
997ec578e0 m68k: added a simple unaryminusnode which can utilize FNEG instruction for floats on 68881
git-svn-id: trunk@30044 -
2015-03-01 15:00:07 +00:00
Tomas Hajny
9f9ab082da * fix typo (space instead of underscore resulting in broken help display)
git-svn-id: trunk@30041 -
2015-02-28 23:30:24 +00:00
Tomas Hajny
2be0cc8aae * avoid crashes when displaying help with an unsupported system codepage
git-svn-id: trunk@30040 -
2015-02-28 23:15:56 +00:00
Tomas Hajny
dbbce18f56 * fix determination of help line length with codepage set to UTF-8 (the string conversion routine in widestr.pas doesn't work for UTF-8 :-((( )
git-svn-id: trunk@30039 -
2015-02-28 22:54:48 +00:00
florian
f0cf88533e * applying const_align when generating structures accessed by the rtl is not a good idea because their
alignment must be immutable, should resolve #27525

git-svn-id: trunk@30038 -
2015-02-28 22:44:58 +00:00
florian
99635658ec * corrects change flags for VSQRTSD
git-svn-id: trunk@30037 -
2015-02-28 22:42:25 +00:00
Jonas Maebe
dd2aa17de1 * also allow 64 bit platforms have have a 32x32->64 bit multiplication to
take advantage of this transormation (enables this optimization for
    AArch64)

git-svn-id: trunk@30035 -
2015-02-28 22:31:06 +00:00
Jonas Maebe
b821e31442 * force constants into a registers in the 32x32->64 optimized case
git-svn-id: trunk@30034 -
2015-02-28 22:31:03 +00:00
Jonas Maebe
86bde57b0f * do not switch around node subtrees if they have different resultdefs, e.g.
because a subtree has been optimized for a 32x32->64 multiplication (so
   some subtrees have a 32 bit resultdef and others a 64 bit resultdef)

git-svn-id: trunk@30033 -
2015-02-28 22:31:00 +00:00
Jonas Maebe
ada5060a34 * set pi_do_call for AArch64 mod/div nodes, as they call FPC_DIVBYZERO
git-svn-id: trunk@30032 -
2015-02-28 22:30:57 +00:00
Jonas Maebe
33b1732ca2 * avoid unnecessary sign/zero-extensions in genlinearlist() when generating
code on a platform that doesn't have subregisters of the same size as
    the "case" value

git-svn-id: trunk@30031 -
2015-02-28 16:46:54 +00:00
Jonas Maebe
b2427d04ed * ensure that data pools are not inserted right after add/tbb/tbh-based
jumptable dispatches

git-svn-id: trunk@30027 -
2015-02-27 20:52:12 +00:00
Tomas Hajny
1ecf8dcfa1 * improved paging of help pages so that lines are not missed with 80x25 windows due to lines overflowing the window width
git-svn-id: trunk@30026 -
2015-02-27 19:26:23 +00:00
Károly Balogh
7940806fc2 fixed ifneq vs. ifndef
git-svn-id: trunk@30023 -
2015-02-27 11:33:38 +00:00
Jonas Maebe
37c2d0e60d * use Object_getClass(obj) instead of obj._class to get the class of an
Objective-C instance on AArch64, as the latter helper from the runtime
    is a plain function call rather than an expensive message dispatch,
    and moreover it also works for protocols (the "class" method is part
    of NSObject, and protocols do not support it since there is no single
    root class and hence they may represent an instance of a class that
    does not derive from NSObject)
   o also call it to get the "self" pointer when calling class methods for
     protocols on AArch64 (fixes tobjc22a and tobjc22b on Darwin/AArch64)
   o also call it to get the metaclass of a class on Darwin/AArch64 (fixes
     tobjc25)
  - removed special handling of getting the Objective-C (meta)class for
    non-type nodes on other Darwin platforms, as this is also correctly
    handled by the generic pass_generate_code

git-svn-id: trunk@30018 -
2015-02-26 21:49:08 +00:00
florian
b7422716b2 * turn off compiler and utils building for nds
* use NoNativeBinaries to detect if a native compiler shall be build

git-svn-id: trunk@30017 -
2015-02-26 20:03:29 +00:00
Károly Balogh
56eeabd01b fixed a warning with DFA
git-svn-id: trunk@30015 -
2015-02-26 09:36:03 +00:00
sergei
657ac78304 * Improved handling of registers used in assembler blocks. Assembler nodes no longer have lists of used registers attached to them. Instead, each specified register creates an allocation/deallocation pair and an additional tai_regalloc.markused item directly in the asmlist. This way, register lists are no longer limited to integer registers, and parsing no longer depends on paramanager to know which registers are volatile.
If assembler block has no modified register list, it is still handled in pass2, by allocating all volatile registers (not only the integer ones as before).

git-svn-id: trunk@30011 -
2015-02-25 21:53:15 +00:00
sergei
31fddaafe8 + New subtype of tai_regalloc, "ra_markused". It marks a physical register as used in procedure, triggering saving/restoring that register if it is non-volatile.
git-svn-id: trunk@30010 -
2015-02-25 21:38:23 +00:00
florian
91db2a1698 + report when compilation of a unit is stopped because it has been already compiled during the recursive search in uses clauses
git-svn-id: trunk@30001 -
2015-02-24 21:46:09 +00:00
florian
0a17a08b28 - remove accidently committed (commented though) debug statement
git-svn-id: trunk@30000 -
2015-02-24 20:58:49 +00:00
pierre
da55d9ded2 Also disable overflow where range check is disabled in aasmcpu unit
git-svn-id: trunk@29989 -
2015-02-24 15:58:49 +00:00
marco
422df4bc77 * fixed typo removing ppca64, mantis 27533
git-svn-id: trunk@29988 -
2015-02-24 09:35:27 +00:00
Jonas Maebe
879afbb7be * removed -Oodfa warnings
git-svn-id: trunk@29986 -
2015-02-23 22:57:24 +00:00
Jonas Maebe
c41759a026 - removed a lot of unused copied internal assembler code
git-svn-id: trunk@29985 -
2015-02-23 22:57:21 +00:00
Jonas Maebe
2ab7f5c35d * moved x86-specific requirements from the generic bsr/bsf code to the
x86 code generator (register size constraints)

git-svn-id: trunk@29984 -
2015-02-23 22:57:18 +00:00
Jonas Maebe
3b5adcb3de + print iphonesim/x86_86-specific command line options in the help
git-svn-id: trunk@29982 -
2015-02-23 22:57:12 +00:00
Jonas Maebe
dcb6f2baae + print Darwin/AArch64-specific command line options in the help
git-svn-id: trunk@29981 -
2015-02-23 22:57:09 +00:00
Jonas Maebe
5e339e89e4 * source can also be a LOC_CREGISTER for bsr/bsf
git-svn-id: trunk@29980 -
2015-02-23 22:57:05 +00:00
Jonas Maebe
a8d05b66e2 + AArch64 internal bsf/bsr support
git-svn-id: trunk@29979 -
2015-02-23 22:57:02 +00:00
Jonas Maebe
b40a4d1b5a + support for "xor mmreg,mmreg" for initialising global floating point
regvars

git-svn-id: trunk@29978 -
2015-02-23 22:56:59 +00:00
Jonas Maebe
0a0e74342f * AArch64 doesn't need the software int64 to double code
git-svn-id: trunk@29976 -
2015-02-23 22:56:53 +00:00
Jonas Maebe
b7fb862f4a * enable internal handling of abs(int64) on AArch64
git-svn-id: trunk@29975 -
2015-02-23 22:56:50 +00:00
Jonas Maebe
fa328436ab * regenerated for iphonesim/x86-64
git-svn-id: trunk@29974 -
2015-02-23 22:56:41 +00:00
Jonas Maebe
749f393095 * fixed platform names for Darwin in ppudump
git-svn-id: trunk@29973 -
2015-02-23 22:56:24 +00:00
Jonas Maebe
79a06b1514 + iphonesim/x86_64 target (64 bit iOS simulator)
git-svn-id: trunk@29970 -
2015-02-23 22:56:09 +00:00
Jonas Maebe
f421e83c9a - don't allow setting the OS X version (-WM) for Darwin/ARM or Darwin/AArch64
for now (it's all iOS)

git-svn-id: trunk@29969 -
2015-02-23 22:56:06 +00:00
Jonas Maebe
07f31d560c + also perform sign/zero-extensions of the index in vecn using extended
registers in references

git-svn-id: trunk@29968 -
2015-02-23 22:56:03 +00:00
Jonas Maebe
d6de2c03cb * generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
o in particular, add tdef size information to the update_reference*()
     methods, and factored out offset adjustments into its own method
   o also make sure the passed size to update_reference*() corresponds to the
     actual size of the index, as it's no longer guaranteed to be ptruint
     since the previous commit

git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
Jonas Maebe
97df25cc29 + use reference/add "extended register" scale modes for vecnodes
git-svn-id: trunk@29966 -
2015-02-23 22:55:57 +00:00
Jonas Maebe
b5b7e0f338 * ensure that 64->32 bit truncations cannot be optimized away by the
register allocator on AArch64 + test (did not get caught by existing
    tests)

git-svn-id: trunk@29965 -
2015-02-23 22:55:54 +00:00
Jonas Maebe
1de8e53edd + AArch64 jump table support
git-svn-id: trunk@29964 -
2015-02-23 22:55:42 +00:00
Jonas Maebe
d4d9e361fc + AArch64 optimized version of a_load_regconst_subsetreg_intern()
git-svn-id: trunk@29963 -
2015-02-23 22:55:39 +00:00
Jonas Maebe
555194a67b + AArch64 optimized version of a_load_subsetreg_subsetreg()
git-svn-id: trunk@29962 -
2015-02-23 22:55:36 +00:00
Jonas Maebe
602853d40b + AArch64 optimized version of a_load_subsetreg_reg()
git-svn-id: trunk@29961 -
2015-02-23 22:55:33 +00:00
Jonas Maebe
c9de3b2ecd * use the zero register for a_load_const_ref(0)
git-svn-id: trunk@29960 -
2015-02-23 22:55:29 +00:00
Jonas Maebe
07455fb889 + inlined versions of concatcopy
git-svn-id: trunk@29959 -
2015-02-23 22:55:26 +00:00
Jonas Maebe
e6ab39765d * add restrictions for loaded/stored registers in case of references
with write-back

git-svn-id: trunk@29958 -
2015-02-23 22:55:23 +00:00
Jonas Maebe
65c2c68b5f * call the AArch64 compiler ppca64 instead of ppcaarch64 (less typing)
git-svn-id: trunk@29957 -
2015-02-23 22:55:20 +00:00
Jonas Maebe
14bd77f11c * removed ARM copy/paste stuff
git-svn-id: trunk@29956 -
2015-02-23 22:55:17 +00:00
Jonas Maebe
ff73d97e7f * temporary workaround for writing INS/UMOV operands, as these require
vector subregisters that we cannot represent yet. We only have to
    load/store lower single/double precision contents via them though,
    so reuse SUBMMS/SUBMMD for now.

git-svn-id: trunk@29955 -
2015-02-23 22:55:14 +00:00
Jonas Maebe
bc5a33ffac * fixed flags_to_cond() and inverse_cond() for C_GE
git-svn-id: trunk@29954 -
2015-02-23 22:55:11 +00:00
Jonas Maebe
42aca4db46 * pass managed function result addresses as a hidden first parameter instead
of in X8, as the ABI allows this deviation (see added comments) and it's
    required for some internal RTL code to call interface methods via RTTI

git-svn-id: trunk@29953 -
2015-02-23 22:55:08 +00:00
Jonas Maebe
bb1274a8ee * make DoPipe() a method of TExternalAssembler and use it in
TAArch64AppleAssembler to determine whether we have to add extra
    parameters to support assembling via a pipe ("as" is a symlink to
    clang for Arch64 on OS X, and needs to be explicitly told its going to
    receive assembler code from standard input)

git-svn-id: trunk@29952 -
2015-02-23 22:55:05 +00:00
Jonas Maebe
3d01d4ceb1 * regenerated with Darwin/AArch64 support
git-svn-id: trunk@29950 -
2015-02-23 22:54:53 +00:00
Jonas Maebe
2c6e16e49e * accesses to the ISA pointer are guaranteed to be aligned -> ensure the
code generator knows this

git-svn-id: trunk@29944 -
2015-02-23 22:54:21 +00:00
Jonas Maebe
2340da410c * we cannot directly load the ISA pointer on AArch64, we have to call the
class instance method
   (http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non-pointer_isa.html )

git-svn-id: trunk@29943 -
2015-02-23 22:54:18 +00:00
Jonas Maebe
f1fb880f18 * fixed debug register values for vector registers
git-svn-id: trunk@29942 -
2015-02-23 22:54:15 +00:00
Jonas Maebe
e2d21a5716 * reuse simple memory paralocs, since we always setup a stack frame and
we can address them via the frame pointer

git-svn-id: trunk@29941 -
2015-02-23 22:54:12 +00:00
Jonas Maebe
a81e81c775 + override second_int_to_bool(), because the generic version assumes that
OP_OR sets the flags

git-svn-id: trunk@29940 -
2015-02-23 22:54:09 +00:00
Jonas Maebe
966a851997 + a_loadmm_intreg_reg() and a_loadmm_reg_intreg() implementations
git-svn-id: trunk@29939 -
2015-02-23 22:54:06 +00:00
Jonas Maebe
41fba0c4f7 * switched to using the stack pointer as base register for the temp allocator
instead of the frame pointer register:
      1) we exactly know the offsets of the temps from the stack pointer
         after pass 1 (based on the require parameter stack size for called
         routines), while we don't know it for the frame pointer (it depends
         on the number of saved registers)
      2) temp offsets from the stack pointer are positive while those from
         the frame pointer are negative, and we can directly encode much
         bigger positive offsets in the instructions
   o move the stack pointer register to a virtual register in
     loadparentfpn, because many instructions cannot directly operate
     on/with the stack pointer
   o add the necessary register interference edges for the stack pointer
     register

git-svn-id: trunk@29938 -
2015-02-23 22:54:03 +00:00
Jonas Maebe
5bb89cc2f0 * keep track of the reason why a loadparentfpnode has been created: to
load a value from a nested context, or to pass a context to a nested
    routine. In case a target uses both the stack and frame pointer, this
    difference can matter.

git-svn-id: trunk@29937 -
2015-02-23 22:53:59 +00:00
Jonas Maebe
f69d2fe61d * AArch64 doesn't use *stret routines for Objective-C dispatching, because it
doesn't need special code for returning a struct by reference

git-svn-id: trunk@29936 -
2015-02-23 22:53:56 +00:00
Jonas Maebe
f6e90ae9bf * include ncgobjc in cpunode for aarch64
git-svn-id: trunk@29935 -
2015-02-23 22:53:53 +00:00
Jonas Maebe
f54ea490dd * fixed writing extended registers in references
git-svn-id: trunk@29933 -
2015-02-23 22:53:47 +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
70fc5dcee3 * don't pass TP-style objects as HFA or similar, because the calling
convention code is triggered before the object structure has been
    finalised, so the result can be different in the interface and
    implementation. To solve this, something like r20161 has to be
    implemented for TP-style objects

git-svn-id: trunk@29930 -
2015-02-23 22:53:29 +00:00
Jonas Maebe
620af1732a * support for AArch64 branch forwarding
o don't forward cb(n)z, as we don't check the maxiumum offsets
   o don't forward conditional branches to global labels, as they also have a
     limited range and at least the OS X toolchain doesn't support this

git-svn-id: trunk@29929 -
2015-02-23 22:53:26 +00:00
Jonas Maebe
55bc5d7972 * completed TAoptBaseCpu.RegModifiedByInstruction()
git-svn-id: trunk@29928 -
2015-02-23 22:53:23 +00:00
Jonas Maebe
28a713494c * fixed/completed spilling_get_operation_type
+ implemented spilling_get_operation_type_ref

git-svn-id: trunk@29926 -
2015-02-23 22:53:17 +00:00
Jonas Maebe
5041354b8e * recognise AArch64 PIC references
git-svn-id: trunk@29925 -
2015-02-23 22:53:14 +00:00
Jonas Maebe
5da379ab3f + inlined support for round/trunc on AArch64
git-svn-id: trunk@29923 -
2015-02-23 22:53:07 +00:00
Jonas Maebe
0203f5e32f * search iphoneall rather than cocoaall for Cocoa types on Darwin/AArch64
git-svn-id: trunk@29922 -
2015-02-23 22:53:04 +00:00
Jonas Maebe
1aee714c36 * updated PIC comment for Darwin/AArch64
git-svn-id: trunk@29921 -
2015-02-23 22:53:01 +00:00
Jonas Maebe
572742e546 * use Darwin-style section syntax for Darwin/AArch64
git-svn-id: trunk@29920 -
2015-02-23 22:52:58 +00:00
Jonas Maebe
30b0f830c3 * fixed std_param_align
o also updated copyright and architecture name

git-svn-id: trunk@29919 -
2015-02-23 22:52:55 +00:00
Jonas Maebe
851b3499b4 * aarch64 only/always uses its vector fpu
git-svn-id: trunk@29917 -
2015-02-23 22:52:48 +00:00
Jonas Maebe
5fff543c73 - removed unused taicpu.insoffset field
git-svn-id: trunk@29916 -
2015-02-23 22:52:45 +00:00
Jonas Maebe
71bd4e23d9 + taicpu.op_reg_reg_const_const() and taicpu.op_reg_reg_reg_cond() methods
git-svn-id: trunk@29915 -
2015-02-23 22:52:42 +00:00
Jonas Maebe
5bdd14e252 + AArch64 cputarg
git-svn-id: trunk@29914 -
2015-02-23 22:52:39 +00:00
Jonas Maebe
558b8967b6 + Aarch64 assembler reader
git-svn-id: trunk@29913 -
2015-02-23 22:52:36 +00:00
Jonas Maebe
96fcf6a12d * added BL and CB(N)Z to is_calljmp()
git-svn-id: trunk@29912 -
2015-02-23 22:52:33 +00:00
Jonas Maebe
aa0e2e9170 * fixed cgsize2subreg and cgsize2subreg for mm subreg sizes
git-svn-id: trunk@29911 -
2015-02-23 22:52:30 +00:00
Jonas Maebe
c2b1ff41d5 - removed ARM leftover tspecialregflag type
git-svn-id: trunk@29910 -
2015-02-23 22:52:27 +00:00
Jonas Maebe
4c504098ca + C_CS/C_CC condition and F_HS/F_LO flag aliases
git-svn-id: trunk@29909 -
2015-02-23 22:52:23 +00:00
Jonas Maebe
6e55e8356e + IP0/IP1 register aliases
git-svn-id: trunk@29908 -
2015-02-23 22:52:20 +00:00
Jonas Maebe
bc9b870943 * cpunode: added ncgcal, corrected ncpuinln -> ncpuinl
git-svn-id: trunk@29907 -
2015-02-23 22:52:17 +00:00
Jonas Maebe
1c8059e30c + dummy AArch64 hlcgcpu
git-svn-id: trunk@29906 -
2015-02-23 22:52:14 +00:00
Jonas Maebe
cfd7bfc8a5 + dummy AArch64 cpupi unit
git-svn-id: trunk@29905 -
2015-02-23 22:52:11 +00:00
Jonas Maebe
d51c87e77b * add Darwin/AArch64 to systems_darwin
git-svn-id: trunk@29904 -
2015-02-23 22:52:07 +00:00
Jonas Maebe
b0112fa63f + initial AArch64 support in systemh.inc, options.pas, version.pas and
psystem.pas

git-svn-id: trunk@29903 -
2015-02-23 22:52:04 +00:00
Jonas Maebe
f2c0b88e4f * AArch64 compiler building support to top level and compiler Makefile
git-svn-id: trunk@29901 -
2015-02-23 22:51:58 +00:00
Jonas Maebe
60dd2d1dd5 + register Darwin/AArch64 target
* pass "-arch arm64" to the linker for Darwin/AArch64

git-svn-id: trunk@29897 -
2015-02-23 22:51:44 +00:00
Jonas Maebe
bee9c4185b + default target for AArch64
git-svn-id: trunk@29896 -
2015-02-23 22:51:41 +00:00
Jonas Maebe
00b819307a + condition and shifterop operands for AArch64 assembler reader
git-svn-id: trunk@29895 -
2015-02-23 22:51:38 +00:00
Jonas Maebe
665a5e509e * default iOS deployment version for AArch64 is iOS 7
git-svn-id: trunk@29894 -
2015-02-23 22:51:34 +00:00
Jonas Maebe
8c89f7ee8f * AArch64 also uses the non-fragile Objective-C ABI
git-svn-id: trunk@29893 -
2015-02-23 22:51:31 +00:00
Jonas Maebe
de2dd592ab + shiftedregmodes and extendedregmodes set constants
git-svn-id: trunk@29892 -
2015-02-23 22:51:28 +00:00
Jonas Maebe
17bcd207af * fixed lowercase entry in uppercond2str
git-svn-id: trunk@29891 -
2015-02-23 22:51:25 +00:00
Jonas Maebe
53548663e3 + AArch64 assembler writer
git-svn-id: trunk@29890 -
2015-02-23 22:51:22 +00:00
Jonas Maebe
d246ababff + condition code operand for aarch64
+ taicpu.op_reg_cond() constructor
  * use this operand for cset

git-svn-id: trunk@29889 -
2015-02-23 22:51:19 +00:00
Jonas Maebe
9c55fa6f6c + FPCR, FPSR and TPIDR registers
git-svn-id: trunk@29878 -
2015-02-23 22:50:44 +00:00
Jonas Maebe
493b11da06 + Darwin/aarch64 system definition
git-svn-id: trunk@29877 -
2015-02-23 22:50:41 +00:00
Jonas Maebe
b5643f2a27 + aarch64 cpu identifier
git-svn-id: trunk@29876 -
2015-02-23 22:50:38 +00:00
Jonas Maebe
6995474ea0 + aarch64 cpunode
git-svn-id: trunk@29875 -
2015-02-23 22:50:35 +00:00
Jonas Maebe
820de6a17b * pass "const" arrays always by reference, because there is a lot of hacky
code out there that relies on this, even though it's not supposed to be
    guaranteed in any way :(

git-svn-id: trunk@29874 -
2015-02-23 22:50:32 +00:00
Jonas Maebe
edb3124ae8 * copy arrays passed by value to cdecl routines on the callee side even on
platforms that normally must copy value parameters on the caller side,
    because
   o if we copy them on the caller side, then the behaviour will be different
     compared to other platforms if the called routine is implemented in C
     (since they are passed by reference, changes to the array contents will
      be visible on other platforms, while they wouldn't be visible if the
      copy is made on the caller side)
   o if we don't copy them on the caller nor on the callee side, then behaviour
     will be different compared to other platforms if the called routine is
     implemented in Pascal and modifies the array (since then changes won't be
     visible on the caller side, except on platforms that normally perform
     the copy on the caller side)

git-svn-id: trunk@29873 -
2015-02-23 22:50:29 +00:00
Jonas Maebe
2dbfbd40ab * unified hlcg.g_copyvalueparas and ncgutil.copyvalueparas, they have the
same functionality in the mean time

git-svn-id: trunk@29872 -
2015-02-23 22:50:26 +00:00
Jonas Maebe
6e12ad817f * don't make copies of arrays passed as value parameters to cdecl routines
(since C compilers don't copy such arrays either, as they're implciitly
     pointers)

git-svn-id: trunk@29871 -
2015-02-23 22:50:23 +00:00
Jonas Maebe
c6ba0bb6fb + support for targets that require by-reference value parameters to be
be copied on the caller instead of callee side
   o mark Darwin/Aarch64 as such a target (any AArch64 target will be like
     that normally, as its ABI specifies this behaviour)
   o don't mark by-reference value parameters on such targets as
     vo_has_local_copy, since a) they don't have one (the copy is on the
     caller side), and b) this ensures that all code handling such
     parameters automatically knows that they are still by reference
     after the init code has run
   o when making the copies on the caller side, don't increase the
     reference count for managed types except for variants, just like
     is done when making the copies on the callee side. This is because
     the reference count increasing code on the callee side only runs
     for non-assembler functions, and we cannot know 100% certain on the
     caller side whether the called function is assembler or not (e.g. in
     case of externally declared functions)
   o maybe over time we can reuse the Pascal code in
     tcallparanode.copy_value_by_ref_para to replace the equivalent code
     in hlcgobj and ncgutil also on the caller side for other targets

git-svn-id: trunk@29870 -
2015-02-23 22:50:20 +00:00
Jonas Maebe
bedcc5cbb1 + Darwin/AArch64 system identifier
git-svn-id: trunk@29869 -
2015-02-23 22:50:16 +00:00
Jonas Maebe
0af4f3e3fb + aarch64 math nodes implementation
git-svn-id: trunk@29868 -
2015-02-23 22:50:13 +00:00
Jonas Maebe
4aeb22f7f4 + initial implementation of aarch64 type conversion nodes
git-svn-id: trunk@29867 -
2015-02-23 22:50:10 +00:00
Jonas Maebe
71ae8015da + initial implementation of aarch64 add nodes
git-svn-id: trunk@29866 -
2015-02-23 22:50:07 +00:00
Jonas Maebe
8a444ed96a + initial implementation of aarch64 inline nodes
git-svn-id: trunk@29865 -
2015-02-23 22:50:04 +00:00
Jonas Maebe
7fa414f7f1 + initial implementation of aarch64 register allocator
git-svn-id: trunk@29864 -
2015-02-23 22:50:01 +00:00
Jonas Maebe
1c8eb58792 * adapted copyright statement
git-svn-id: trunk@29863 -
2015-02-23 22:49:58 +00:00
Jonas Maebe
2214966f26 * implemented parameter passing and function result locations
git-svn-id: trunk@29862 -
2015-02-23 22:49:55 +00:00
Jonas Maebe
edef6b2a0a + AArch64 Darwin abi declaration
git-svn-id: trunk@29861 -
2015-02-23 22:49:52 +00:00
Jonas Maebe
7fbc44471b * made getparaloc ABI-compliant
git-svn-id: trunk@29860 -
2015-02-23 22:49:49 +00:00
Jonas Maebe
232599b429 * made push_addr_param() ABI-compliant
git-svn-id: trunk@29859 -
2015-02-23 22:49:46 +00:00
Jonas Maebe
e2c30eb0a1 * return base type from is_hfa()
git-svn-id: trunk@29858 -
2015-02-23 22:49:43 +00:00
Jonas Maebe
e7bbb31080 * implemented ret_in_param() according to the ABI
git-svn-id: trunk@29857 -
2015-02-23 22:49:40 +00:00
Jonas Maebe
4562731ad9 - removed custom getintparaloc()
git-svn-id: trunk@29856 -
2015-02-23 22:49:37 +00:00
Jonas Maebe
60768fcffe + implemented is_hfa()
git-svn-id: trunk@29855 -
2015-02-23 22:49:34 +00:00
Jonas Maebe
c244daaafb * don't initialize the fpu register allocator, it is/must not be used on
AArch64

git-svn-id: trunk@29854 -
2015-02-23 22:49:31 +00:00
Jonas Maebe
ab186f7892 + initial implementation of aarch64 code generator
git-svn-id: trunk@29853 -
2015-02-23 22:49:28 +00:00
Jonas Maebe
01a6777530 * simplified flag_2_cond array range
git-svn-id: trunk@29852 -
2015-02-23 22:49:25 +00:00
Jonas Maebe
51a094a917 + FP/LR register aliases
git-svn-id: trunk@29851 -
2015-02-23 22:49:22 +00:00
Jonas Maebe
e6d7c6a62a + is_shifter_const() function to determine whether a constant can be encoded
as an immediate operand for a logical operation

git-svn-id: trunk@29850 -
2015-02-23 22:49:19 +00:00
Jonas Maebe
d23299af1e * fixed cgsize2subreg() for integer registers (we can use 32 and 64 bit
registers -> 64 bit values go into 64 bit registers and everything else into
    32 bit ones)

git-svn-id: trunk@29849 -
2015-02-23 22:49:15 +00:00
Jonas Maebe
f4ada6cda0 + aarch64-specific treference fields
git-svn-id: trunk@29848 -
2015-02-23 22:49:13 +00:00
Jonas Maebe
123503a4f7 + GOT-related (Darwin) address modes
git-svn-id: trunk@29847 -
2015-02-23 22:49:10 +00:00