summaryrefslogtreecommitdiff
path: root/compiler/ncgbas.pas
Commit message (Collapse)AuthorAgeFilesLines
* * synchronized with privatetrunk till r30095jonas2015-03-051-2/+5
|\ | | | | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/hlcgllvm@30101 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * Improved handling of registers used in assembler blocks. Assembler nodes ↵sergei2015-02-251-2/+5
| | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@30011 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * renamed (hl)gettemptyped() to (hl)gettempmanaged() to better indicate thejonas2014-08-191-1/+1
|/ | | | | | meaning git-svn-id: http://svn.freepascal.org/svn/fpc/branches/hlcgllvm@28484 3ad0048d-3df7-0310-abae-a5850022a9f2
* * 16-bit and 8-bit ALU fixes in tcgtempdeletenode.pass_generate_codenickysn2013-12-231-2/+44
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26272 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixes several issues which cause warnings by the dfa code when using it to ↵florian2013-12-011-0/+2
| | | | | | detect uninitialized variables git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26161 3ad0048d-3df7-0310-abae-a5850022a9f2
* * keep managed types in registers if possible. Under certain circumstances ↵florian2013-06-231-4/+2
| | | | | | | | (if they don't require init/final code, e.g. being a const parameter or immutable temp. values), managed types like dyn. arrays, new string types and interfaces can be kept in registers. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24953 3ad0048d-3df7-0310-abae-a5850022a9f2
* * report resolveref errors on the correct line numberjonas2012-12-151-7/+7
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23153 3ad0048d-3df7-0310-abae-a5850022a9f2
* * give a proper error when an mmx/fpu/sse register is used inside a memoryjonas2012-12-151-6/+7
| | | | | | reference (mantis #23441) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23152 3ad0048d-3df7-0310-abae-a5850022a9f2
* * support referencing "result" in nostackframe pure assembler routines ifjonas2012-08-211-0/+14
| | | | | | | | | | the result location is a simple location (a single register/reference) (mantis #22490) * print an error when accessing "result" in a nostack pure assembler routine if the result location is not simple git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22166 3ad0048d-3df7-0310-abae-a5850022a9f2
* * only don't pre-finalize funcret temps that are passed by reference to thejonas2012-07-231-1/+1
| | | | | | | called function, fixes webtbs/tw3742.pp after r21955 (looked at wrong testsuite results :/ ) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21963 3ad0048d-3df7-0310-abae-a5850022a9f2
* * don't pre-finalize temp nodes that are passed by reference as hiddenjonas2012-07-231-2/+4
| | | | | | | | | function result parameter, because reference counted function results are not guaranteed to be initialized (we sometimes even pass the, non-finalized, left-hand side of an assignment as hidden function result parameter) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21955 3ad0048d-3df7-0310-abae-a5850022a9f2
* + ttgobj.gethltemptyped() routine for allocating managed types with high leveljonas2011-08-201-1/+1
| | | | | | | code generator support * refactored some internal temp generator code git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18681 3ad0048d-3df7-0310-abae-a5850022a9f2
* * properly deal with reference temps in tcgtempdeletenode.pass_generate_codejonas2011-08-201-0/+15
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18665 3ad0048d-3df7-0310-abae-a5850022a9f2
* + "reference" temps that sort of implement pointer-style functionality forjonas2011-08-201-16/+42
| | | | | | | platforms that don't support pointers (by make a copy of all registers part of a reference) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18377 3ad0048d-3df7-0310-abae-a5850022a9f2
* + gethltemp() to allocate a temp specifying full type information evenjonas2011-08-201-1/+1
| | | | | | | | for regular temps. This is required for targets that need special handling of the temps depending on the type * converted most gettemp() calls to gethltemp() calls git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18376 3ad0048d-3df7-0310-abae-a5850022a9f2
* * replaced all calls to cg.g_incr/decrrefcount/g_initialize/g_finalize withjonas2011-08-201-2/+2
| | | | | | calls to hlcg.* git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18361 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Fixed spell error revealed by lintian.mazen2010-10-061-2/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16094 3ad0048d-3df7-0310-abae-a5850022a9f2
* * renamed pi_has_goto into pi_has_label because the problematic thing is if ↵florian2010-08-051-3/+3
| | | | | | | | | | a procedure has a label as target and not if it has some goto * moved inclusion of pi_has_label to tlabelnode.pass_1 git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15712 3ad0048d-3df7-0310-abae-a5850022a9f2
* * changed tprocdef.funcretloc[] from a tlocation into a tcgpara so it canjonas2010-05-301-36/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | represent complex locations (required for full x86-64 ABI support, which is not yet implemented) -> lots of special result handling code has been removed and replaced by the parameter handling routines + added support for composite parameters (and hence function results) to tcg.a_load_ref_cgpara() (so it can be used for handling, e.g., 64 bit parameters on 32 bit platforms) * the above fixed writing past the end of allocated memory when handling records returned in registers on x86-64 whose size is not a multiple of 8 bytes (mantis #16357) - removed the x86-64 and PPC specific versions of a_load_ref_cgpara(), as they are now handled correctly by the generic version * moved the responsibility of allocating tcgpara cpu registers (using paramanager.allocparaloc()) from the callers of cg.a_load*_cgpara() to the cg.a_load*_cgpara() methods themselves (so the register allocation can be done efficiently when dealing with function results) * for the above, renamed paramanager.alloc/freeparaloc() to paramanager.alloc/freecgpara(), and use paramanager.allocparaloc() to allocate individual pcgparalocations instead * fixed the register size of SSE2 function result registers for x86-64 (when used for floating point), which results in removing a few superfluous "movs? %xmm0,%xmm0" instructions * fixed compilation of paramanagers of avr, m68k and mips after r13695 and also updated them for these new changes git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15350 3ad0048d-3df7-0310-abae-a5850022a9f2
* * removed "and not is_class()" condition from is_managed_type(), becausejonas2010-05-221-2/+1
| | | | | | | | | | | | tobjectdef.needs_inittable returns false for classes nowadays (and already since quite some time) * nevertheless replaced all usages in the compiler of x.needs_inittable with is_managed_type(x) (in case some other condition is added again in the future) and removed all remaining accompanying "and not is_class(x)" checks git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15320 3ad0048d-3df7-0310-abae-a5850022a9f2
* + tempcreate nodes can now take an init. value, this allows to initilialize ↵florian2010-01-101-0/+8
| | | | | | temp. ref nodes on the fly git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14595 3ad0048d-3df7-0310-abae-a5850022a9f2
* * handle mm register properly when used as top_local, resolves #14566florian2010-01-031-0/+15
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14535 3ad0048d-3df7-0310-abae-a5850022a9f2
* * don't allocate persistent temps for classes (they are not refcounted)jonas2009-12-081-1/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@14372 3ad0048d-3df7-0310-abae-a5850022a9f2
* o added ARM VPFv2/VFPv3 support:jonas2009-12-031-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + 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: http://svn.freepascal.org/svn/fpc/trunk@14317 3ad0048d-3df7-0310-abae-a5850022a9f2
* * the compiler now explicitly keeps track of the minimally guaranteedjonas2009-02-081-5/+10
| | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@12719 3ad0048d-3df7-0310-abae-a5850022a9f2
* * always specify an explicit alignment for tgobj.gettemp (so e.g.jonas2008-11-081-1/+1
| | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@12036 3ad0048d-3df7-0310-abae-a5850022a9f2
* * split cpu64bit compiler define intojonas2008-02-131-4/+4
| | | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@10320 3ad0048d-3df7-0310-abae-a5850022a9f2
* * no longer remove AsmBlockStart and AsmBlockEnd markers fromjonas2007-09-221-12/+1
| | | | | | | | | | | | assembler blocks in procedures marked as inline. I have no idea why that was done, but it was the case already since a long time and caused a compiler crash when compiling tests/test/opt/tretopt1 (because it caused the assembler optimizer to process such assembler blocks, while their operand order is not guaranteed to be the AT&T one as expected by the optimizers) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8604 3ad0048d-3df7-0310-abae-a5850022a9f2
* * changed boolean fields in ttempinfo to a set for easierjonas2007-07-291-11/+11
| | | | | | | extensibility without increasing the size of the record git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8199 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixed calling inline functions (with exit statements) from insidejonas2007-07-201-0/+7
| | | | | | | | | | | | | finally blocks * fixed the handling of function results of inlined functions with exit statements + test for the above two issues and for bug fixed in r8091 * copy may_be_in_reg field inside ttempcreatenode.dogetcopy (allows some more temps which were needlessly forced into memory to be in registers) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@8108 3ad0048d-3df7-0310-abae-a5850022a9f2
* * only check validity of assembler instructions in pass_2, after alljonas2007-05-291-1/+11
| | | | | | | local operands have been resolved (mantis #8950) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@7516 3ad0048d-3df7-0310-abae-a5850022a9f2
* * remove tdictionary and tindexarraypeter2006-11-031-1/+1
| | | | | | | | | | | | * symtables based on TFPHashObjectList and TFPObjectList * rename torddef.typ to torddef.ordtype * rename tfloatdef.typ to tfloatdef.floattype * rename tdef.deftype to tdef.typ * remove obsolete browser code, browcol is kept so the ide can still be compiled git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@5192 3ad0048d-3df7-0310-abae-a5850022a9f2
* * settings refactoredflorian2006-10-301-3/+3
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@5094 3ad0048d-3df7-0310-abae-a5850022a9f2
* * remove ttypepeter2006-10-291-27/+27
| | | | | | | | | * rename old ttype variables *type to *def * rename resulttypepass to pass_typecheck * rename pass_2 to pass_generate_code git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@5077 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixed memory leak with temp. variables, fixes #7282florian2006-10-221-0/+3
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@4998 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixed compilation on non x86 systemsflorian2006-04-201-0/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@3300 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Support in tempnodes for SSE floats in XMM registerspeter2006-04-201-7/+35
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@3295 3ad0048d-3df7-0310-abae-a5850022a9f2
* Merged revisions 2921-2922,2925 via svnmerge from peter2006-03-161-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | http://svn.freepascal.org/svn/fpc/branches/linker/compiler ........ r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines * pass ObjectWriter to ObjectOuput ........ r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines * refactor asmdata ........ r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines * add cfi to asmdata * move asmlist, asmcfi, asmdata to own unit ........ git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2932 3ad0048d-3df7-0310-abae-a5850022a9f2
* * rewrite of optimizer optionspeter2006-03-131-2/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2901 3ad0048d-3df7-0310-abae-a5850022a9f2
* Merged revisions ↵peter2006-03-051-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2669,2673,2677,2683,2696,2699-2702,2704,2708,2712-2715,2718,2722-2723,2728-2730,2740,2769 via svnmerge from svn+ssh://peter@www.freepascal.org/FPC/svn/fpc/branches/linker/compiler ........ r2669 | peter | 2006-02-23 09:31:21 +0100 (Thu, 23 Feb 2006) | 2 lines * add compiler dir ........ r2673 | peter | 2006-02-23 17:08:56 +0100 (Thu, 23 Feb 2006) | 2 lines * enabled more code ........ r2677 | peter | 2006-02-24 17:46:29 +0100 (Fri, 24 Feb 2006) | 2 lines * pe stub and headers ........ r2683 | peter | 2006-02-25 23:13:24 +0100 (Sat, 25 Feb 2006) | 2 lines * section options cleanup ........ r2696 | peter | 2006-02-26 20:27:41 +0100 (Sun, 26 Feb 2006) | 2 lines * fixed typecasts ........ r2699 | peter | 2006-02-26 23:04:32 +0100 (Sun, 26 Feb 2006) | 2 lines * simple linking works ........ r2700 | peter | 2006-02-27 09:44:50 +0100 (Mon, 27 Feb 2006) | 2 lines * internal linker script ........ r2701 | peter | 2006-02-27 12:05:12 +0100 (Mon, 27 Feb 2006) | 2 lines * make elf working again ........ r2702 | peter | 2006-02-27 14:04:43 +0100 (Mon, 27 Feb 2006) | 3 lines * disable dwarf for smartlinking with .a * fix section start in new .a file ........ r2704 | peter | 2006-02-27 18:30:43 +0100 (Mon, 27 Feb 2006) | 2 lines * stab section fixes ........ r2708 | peter | 2006-02-28 19:29:17 +0100 (Tue, 28 Feb 2006) | 2 lines * basic work to merge stabs sections ........ r2712 | peter | 2006-02-28 23:17:48 +0100 (Tue, 28 Feb 2006) | 2 lines * unload tmodules before linking ........ r2713 | peter | 2006-02-28 23:18:51 +0100 (Tue, 28 Feb 2006) | 2 lines * fixed stabs linking ........ r2714 | peter | 2006-02-28 23:19:19 +0100 (Tue, 28 Feb 2006) | 2 lines * show code and data size ........ r2715 | peter | 2006-02-28 23:25:35 +0100 (Tue, 28 Feb 2006) | 2 lines * unload .stabs from objdata after it is merged ........ r2718 | peter | 2006-03-01 12:24:38 +0100 (Wed, 01 Mar 2006) | 3 lines * memsize/datasize cleanup * check for exports/resources when adding module to linker ........ r2722 | peter | 2006-03-03 09:12:20 +0100 (Fri, 03 Mar 2006) | 2 lines * new TObjSymbol splitted from TAsmSymbol ........ r2723 | peter | 2006-03-03 14:08:55 +0100 (Fri, 03 Mar 2006) | 2 lines * coff fixes after recent objsymbol changes ........ r2728 | peter | 2006-03-03 22:43:04 +0100 (Fri, 03 Mar 2006) | 2 lines * fixed coff writer ........ r2729 | peter | 2006-03-04 01:10:32 +0100 (Sat, 04 Mar 2006) | 2 lines * fix read-only opening ........ r2730 | peter | 2006-03-04 01:11:16 +0100 (Sat, 04 Mar 2006) | 2 lines * Read edata from DLLs, basic work ........ r2740 | peter | 2006-03-04 21:13:43 +0100 (Sat, 04 Mar 2006) | 3 lines * deletedef added * don't remove defs from index when we are already clearing everything ........ r2769 | peter | 2006-03-05 21:42:33 +0100 (Sun, 05 Mar 2006) | 4 lines * moved TObj classes to ogbase * ObjSection.SymbolRefs and SymbolDefines list * DLL importing ........ git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2771 3ad0048d-3df7-0310-abae-a5850022a9f2
* * tai_const refactoredflorian2006-01-221-6/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2323 3ad0048d-3df7-0310-abae-a5850022a9f2
* * optimized register allocation for tempnodesjonas2006-01-081-18/+40
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@2221 3ad0048d-3df7-0310-abae-a5850022a9f2
* * support multiple asmlabel types, renamed getlabel topeter2005-09-181-1/+1
| | | | | | | | | getjumplabel and added type para to getlabel for specific types * moved lineinfo generation from assemble and aggas to dbgstabs git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1120 3ad0048d-3df7-0310-abae-a5850022a9f2
* * ie on powerpc fixed: synching of fpu register variables wasn't ↵florian2005-09-131-0/+9
| | | | | | implemented, maybe subject to be merged back to 2.0.x git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1078 3ad0048d-3df7-0310-abae-a5850022a9f2
* + internal error addedflorian2005-09-101-0/+2
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1069 3ad0048d-3df7-0310-abae-a5850022a9f2
* * inline and compilerproc are now procoptions instead of proccall typesjonas2005-07-181-1/+1
| | | | | | | | | (so both can be combined with each other, as well as with other calling conventions) * defined COMPPROCINLINEFIXED so SYSTEMINLINE is again activated git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@658 3ad0048d-3df7-0310-abae-a5850022a9f2
* * log and id tags removedfpc2005-05-211-10/+0
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@42 3ad0048d-3df7-0310-abae-a5850022a9f2
* initial importfpc2005-05-161-0/+511
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@1 3ad0048d-3df7-0310-abae-a5850022a9f2