summaryrefslogtreecommitdiff
path: root/compiler/paramgr.pas
Commit message (Collapse)AuthorAgeFilesLines
* - rm bogus ifdef cpu16bitalu from tparamanager.allocparaloc and .freecgparanickysn2014-04-261-14/+2
| | | | | | | | | (leftover from my initial hacky implementation of returning int64 function results in ax:bx:cx:dx, that is no longer in use?) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@27662 3ad0048d-3df7-0310-abae-a5850022a9f2
* * use voidpointer.size instead of sizeof(pint) in tparamanager.push_size innickysn2014-03-021-2/+2
| | | | | | | | order to properly support i8086 far data memory models git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26933 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Force managed types to be always returned in parameters, independent of ↵sergei2013-12-131-3/+5
| | | | | | | | target (primitive types were already handled that way; the patch affects small records with fields of managed types). * Generating code to finalize result on exception at callee side is no longer necessary. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26228 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Return dynamic arrays in parameter, this was the only managed type still ↵sergei2013-12-041-1/+1
| | | | | | | | | returned in register. Returning managed types in registers requires catching and re-raising exceptions at callee side in order to finalize result and avoid memory leaks. While such behavior makes little difference with generic setjmp-based exception handling, it becomes very inefficient as SEH-styled exception handling is being introduced. The new behavior is also Delphi-compatible. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@26180 3ad0048d-3df7-0310-abae-a5850022a9f2
* Implement volatile address registers. Fixes quite some tests, but also ↵svenbarth2013-10-031-0/+7
| | | | | | | | | | | | | | | | | | | | breaks others... (overall more are fixed than are broken :) ) paramgr.pas, tparamanager: + add virtual get_volatile_registers_address method which by default returns an empty set cgobj.pas, tcg: * allocallcpuregisters: also allocate address registers if needed * deallocallcpuregisters: also deallocate address registers if needed ncgcal.pas, tcgcallnode.pass_generate_code: * (de)allocate address registers * keep result from being deallocated if it should be an address register (currently by no architecture...) m68k/cpupara.pas, tm68kparamanager: + get_volatile_registers_address: return a0 and a1 as volatile registers m68k/n68kmat.pas, tm68kmoddivnode.call_rtl_divmod_reg_reg: * (de)allocate address registers git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@25633 3ad0048d-3df7-0310-abae-a5850022a9f2
* * missing part of r24776, using a build server also has pitfalls :/jonas2013-06-021-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24777 3ad0048d-3df7-0310-abae-a5850022a9f2
* * don't use the paracgsize in get_paraloc_def(), because it generallyjonas2013-06-021-5/+5
| | | | | | | contains the tcgsize of the entire parameter rather than only of what is left (-> calculate it from the remaining parameter length) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24776 3ad0048d-3df7-0310-abae-a5850022a9f2
* * add a tdef to each parameter location and set it for all targetjonas2013-06-021-0/+21
| | | | | | backends (not yet used, will be used in high level code generator) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24761 3ad0048d-3df7-0310-abae-a5850022a9f2
* + paramgr.pas: provide generic implementation of getintparaloc(). Once this ↵sergei2013-06-011-1/+10
| | | | | | | | | method has been changed to use the procdef, it can reuse 'regular' parameter locations created by create_paraloc_info, so separate cpu-specific implementations of getintparaloc are no longer necessary. * parabase.pas: fixed tcgpara.getcopy, it should not modify the source object. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24716 3ad0048d-3df7-0310-abae-a5850022a9f2
* + preparations for returning int64 in ax:bx:cx:dx on i8086nickysn2013-05-141-2/+14
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@24498 3ad0048d-3df7-0310-abae-a5850022a9f2
* - removed ppc-specific tcgpara.composite field, it's no longer used orjonas2013-02-061-6/+0
| | | | | | | necessary git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23581 3ad0048d-3df7-0310-abae-a5850022a9f2
* Added support for type helpers. In non Delphi modes they use "type helper" ↵svenbarth2013-02-061-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and in mode Delphi they use "record helper". They can also be used on constants. symconst.pas: + extend "thelpertype" by "ht_type" which tells the code in "pdecobj.parse_extended_type" that a type helper declaration has been parsed node.pas: + add a constant which identifies all constant node types ptype.pas: + read_named_type: add a parameter "hadtypetoken" to tell the code whether a "type" token had been parsed before + read_named_type: if an identifier "helper" is parsed we need to check whether "hadtypetoken" is true and the modeswitch "m_class" is set, but the "m_delphi" one is not; in that case we have a "type helper" declaration pgenutil.pas, generate_specialization: * adjust call to read_named_type pdecl.pas, types_dec: * adjust call to read_named_type pdecobj.pas: * parse_extended_type: extend for correct handling of primitive types (includes Delphi compatible handling as well) and reject types that are explicitly not allowed * method_dec: require "static" for class methods in type helpers * method_doc: allow constructors for type helpers as well paramgr.pas, tparamanager: * set_common_funcretloc_info: handle type helper constructors like record constructors * handle_common_ret_in_param: the "self" value of a type helper constructor is also returned in a parameter pexpr.pas: + add a function to postfixoperators which tries to find and apply a type helper for a given type * postfixoperators: try to apply type helpers for ordinal constants * postfixoperators: use the correct string type for string constants * postfixoperators: try to apply type helpers for enum constants * postfixoperators: try to apply type helpers for arrays * postfixoperators: try to apply type helpers for Variant * postfixoperators: try to apply type helpers for pointer types * postfixoperators: try to apply type helpers for other types * factor: check postfixoperators after _REALNUMBER, _CCHAR, _CWCHAR, _TRUE and _FALSE * factor: also check postfixoperators if a _POINT follows a _NIL symdef.pas, tdefawaresymtablestack.addhelpers: * use "generate_objectpascal_helper_key" to generate the key symtable.pas: + add function to generate the key value for the map of extended types using the extended def * adjust "search_last_objectpascal_helper" and "search_objectpascal_helper" to handle primitive types as well * use the new "generate_objectpascal_helper_key" function to generate the key pparautl.pas: * insert_self_and_vmt_para: don't insert the $vmt symbol for record or type helpers (ToDo: check whether class helpers really need the symbol as well) * insert_self_and_vmt_para: pass "self" as var parameter for type helpers as well psub.pas, generate_bodyentry_block: * also allow type helpers for constructor methods ncal.pas, tcallnode.gen_self_tree: * also use a temp variable for type helper constructors ncgcal.pas, tcgcallnode.secondcallparan: * allow Pointers to be passed as address param if it is the Self value of a type helper extending a pointer type * correctly handle the location in case of type helper constructors + add tests git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23580 3ad0048d-3df7-0310-abae-a5850022a9f2
* Decrease amount of code duplication regarding handling of safecall and ↵svenbarth2013-01-251-9/+27
| | | | | | | | | | | | | | | record constructors. paramgr.pas, tparamanager: + add new method "handle_common_ret_in_param" * extract common code (safecall + record constructor handling) from "ret_in_param" to "handle_common_ret_in_param" and call the latter in "ret_in_param" [aarch64,arm,avr,i386,x86_64]/cpupara.pas, tCPUparamanager.ret_in_param: * call "handle_common_ret_in_param" instead of implementing the same check again and again ncgcal.pas, tcgcallnode.handle_return_value: * move the check for (record) constructors to "tparamanager.handle_common_ret_in_param" git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23520 3ad0048d-3df7-0310-abae-a5850022a9f2
* compiler: implement record constructors + testspaul2013-01-161-12/+10
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23395 3ad0048d-3df7-0310-abae-a5850022a9f2
* compiler: change ret_in_param to accept tabstractprocdef instead of ↵paul2013-01-161-7/+5
| | | | | | tproccalloption to allow check more options (required for record constructor implementation) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23394 3ad0048d-3df7-0310-abae-a5850022a9f2
* * pass the procdef to getintparaloc instead of only the proccalloption, sojonas2013-01-061-1/+1
| | | | | | | | that the type of the parameters can be determined automatically o added compilerproc declarations for all helpers called in the compiler via their assembler name, so we can look up the corresponding procdef git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23325 3ad0048d-3df7-0310-abae-a5850022a9f2
* * make use_fixed_stack for i386 more generic (any target with more thanjonas2012-11-221-1/+1
| | | | | | | 4 byte stack alignment needs a fixed stack) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@23043 3ad0048d-3df7-0310-abae-a5850022a9f2
* * don't add a separate high parameter for array-of-const parameters on thejonas2012-11-101-0/+7
| | | | | | | JVM target (just like for open array parameters), since the array length is already encoded in the array itself there git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22968 3ad0048d-3df7-0310-abae-a5850022a9f2
* Use SUPPORT_SAFECALL conditionalpierre2012-09-271-0/+6
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@22488 3ad0048d-3df7-0310-abae-a5850022a9f2
* * fixed memory leaks in the compiler introduced in r21862 by marking andjonas2012-07-231-9/+22
| | | | | | releasing temporarily created function result locations git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21953 3ad0048d-3df7-0310-abae-a5850022a9f2
* + also specify the parameter def when allocating a parameter viajonas2012-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | getintparaloc + adapted all call sites of getintparaloc. This led to a number of additional, related changes: o corrected the type information for some getintparaloc parameters o don't allocate some intparalocs in cases they aren't used o changed "const tvardata" parameter into "constref tvardata" for fpc_variant_copy_overwrite to make pass-by-reference semantics explicit o moved a number of routines that now have to call find_system_type() from cgobj to hlcgobj so that cgobj doesn't have to start depending on the symtable unit o added versions of the cpureg alloc/dealloc methods to hlcgobj that call through to their cgobj counter parts, so we can call save/restore the cpu registers before/after calling system helpers from hlcgobj (not implemented in hlcgobj itself, because all basic register allocator functionality is still part of cgobj/cgcpu) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21696 3ad0048d-3df7-0310-abae-a5850022a9f2
* * factored out common code from get_funcretloc()jonas2012-06-241-0/+52
| | | | | | | | * set tcgpara.def for the function return location (field introduced for and already used by the JVM code generator, required for future hlcg functionality) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@21691 3ad0048d-3df7-0310-abae-a5850022a9f2
* * merged trunk up to r20882jonas2012-04-151-1/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@20887 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * parameter passing support for AIX:jonas2012-04-111-0/+1
| | | | | | | | | | | | | | | | o the last bytes of records passed by value whose size is not a multiple of the register size must be passed in the upper (leftmost) bytes of a register git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@20804 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * An open array/array of const parameter passed by value and requiring a ↵sergei2011-12-061-0/+9
| | | | | | | | | | | | | | | | | | | | local copy on heap (currently all targets except non-Darwin i386 ones) should not be placed into register and should force procedure to have an implicit finally block. * At the same time, allow non-value parameters to be placed into registers even if they have managed type (it is ok because they don't participate in implicit exception handing; explicit exception handling still forces them to memory due to logic in tabstractvarsym.is_regvar). + Added tparavarsym.needs_finalization method to handle this logic in a single place. + Added tparamanager.use_stackalloc method to determine if local copies should be allocated on heap. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@19762 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * Suppress Comaprison might be always false if first_mm_imreg is zeropierre2011-11-031-1/+4
| | | | | | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@19584 3ad0048d-3df7-0310-abae-a5850022a9f2
* | + support for non-array/record var parameter on the JVM target usingjonas2011-08-201-0/+10
| | | | | | | | | | | | copy-in/out git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18527 3ad0048d-3df7-0310-abae-a5850022a9f2
* | + support for regular arrays and open arraysjonas2011-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o support for copying value parameters at the callee side if they were passed by reference in hlcg o JVM g_concatcopy() implementation for arrays o moved code to get length of an array from njvminl to hlcgcpu so it can be reused elsewhere as well o export array copy helpers from system unit for use when assigning one array to another o some generic support for types that are normally not implicit pointers, but which are for the JVM target (such as normal arrays) * handle assigning nil to a dynamic array by generating a setlength(x,0) node instead of by hardcoding a call to fpc_dynarray_clear, so target-specific code can handle it if required * hook up gethltemp() for JVM ttgjvm so array temps are properly allocated git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18388 3ad0048d-3df7-0310-abae-a5850022a9f2
* | + gethltemp() to allocate a temp specifying full type information evenjonas2011-08-201-1/+4
| | | | | | | | | | | | | | | | 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
* | * allow overriding tparamanager.is_stack_paraloc() and let it alwaysjonas2011-08-201-1/+1
| | | | | | | | | | | | | | return true for the JVM target (it uses the evaluation stack to pass all parameters) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18324 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * also copy cgpara.def when creating temp paralocsjonas2011-08-201-0/+1
|/ | | | git-svn-id: http://svn.freepascal.org/svn/fpc/branches/jvmbackend@18323 3ad0048d-3df7-0310-abae-a5850022a9f2
* * improvement to r16050 for non-fixed stack targets: they never have to usejonas2011-03-181-2/+4
| | | | | | | | a temporary parameter location, since calls cannot overwrite parameters already on the stack in that case (it will just grow) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@17144 3ad0048d-3df7-0310-abae-a5850022a9f2
* Fix Mantis #11783:sergei2011-01-291-1/+1
| | | | | | | | | | | * Dispinterfaces can be assigned/typecasted to Variants and vice-versa. * At the same time, disabled corbainterface assignment compatibility with Variants. Simply intermixing COM and CORBA interfaces is wrong since it causes reference counting calls on CORBA interfaces. * Dispinterfaces are returned in parameter, similar to regular interfaces. * Fixed crash in comobj.pp due to incorrect typecast. * Fixed incorrect dispinterface declarations in the test itself. Now it compiles and works (if MS Excel is installed). git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16835 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Merged XPCom branch into trunk, added support for constref and changedjoost2010-10-171-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the IInterface implementation to be XPCom-compatible --- Merging r15997 through r16179 into '.': U rtl/inc/variants.pp U rtl/inc/objpash.inc U rtl/inc/objpas.inc U rtl/objpas/classes/persist.inc U rtl/objpas/classes/compon.inc U rtl/objpas/classes/classesh.inc A tests/test/tconstref1.pp A tests/test/tconstref2.pp A tests/test/tconstref3.pp U tests/test/tinterface4.pp A tests/test/tconstref4.pp U tests/webtbs/tw10897.pp U tests/webtbs/tw4086.pp U tests/webtbs/tw15363.pp U tests/webtbs/tw2177.pp U tests/webtbs/tw16592.pp U tests/tbs/tb0546.pp U compiler/sparc/cpupara.pas U compiler/i386/cpupara.pas U compiler/pdecsub.pas U compiler/symdef.pas U compiler/powerpc/cpupara.pas U compiler/avr/cpupara.pas U compiler/browcol.pas U compiler/defcmp.pas U compiler/powerpc64/cpupara.pas U compiler/ncgrtti.pas U compiler/x86_64/cpupara.pas U compiler/opttail.pas U compiler/htypechk.pas U compiler/tokens.pas U compiler/objcutil.pas U compiler/ncal.pas U compiler/symtable.pas U compiler/symsym.pas U compiler/m68k/cpupara.pas U compiler/regvars.pas U compiler/arm/cpupara.pas U compiler/symconst.pas U compiler/mips/cpupara.pas U compiler/paramgr.pas U compiler/psub.pas U compiler/pdecvar.pas U compiler/dbgstabs.pas U compiler/options.pas U packages/fcl-fpcunit/src/testutils.pp git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16180 3ad0048d-3df7-0310-abae-a5850022a9f2
| * * Implemented constref support, to force constant function-parameters to bejoost2010-09-191-0/+1
| | | | | | | | | | | | | | passed by reference git-svn-id: http://svn.freepascal.org/svn/fpc/branches/xpcom@16008 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * Fixed spell error revealed by lintian.mazen2010-10-061-1/+1
| | | | | | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16094 3ad0048d-3df7-0310-abae-a5850022a9f2
* | + i386/iphonesim target for the new iPhoneSimulator in Xcode 3.2.4 andjonas2010-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: http://svn.freepascal.org/svn/fpc/trunk@16065 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * fixed internalerrors on non-use_fixed_stack platforms after r16050:jonas2010-09-271-17/+24
| | | | | | | | | | | | | | stack parameters can also be split over multiple locations git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16052 3ad0048d-3df7-0310-abae-a5850022a9f2
* | * moved use_fixed_stack from cgutils to a method in paramgr so it canjonas2010-09-261-5/+44
|/ | | | | | | | | | | | | | | | | | | | | | | | | be used outside the code generator * renamed tabstractprocdef.requiredargarea into callerargareasize, and also added calleeargareasize field; added init_paraloc_info(side) method to init the parameter locations and init those size fields and replaced all "if not procdef.has_paraloc_info then ..." blocks with procdef.init_paraloc_info(callersize)" * moved detection of stack tainting parameters from psub to symdef/tabstractprocdef + added tcallparanode.contains_stack_tainting_call(), which detects whether a parameter contains a call that makes use of stack paramters * record for each parameter whether or not any following parameter contains a call with stack parameters; if not, in case the current parameter itself is a stack parameter immediately place it in its final location also for use_fixed_stack platforms rather than first putting it in a temporary location (part of mantis #17442) * on use_fixed_stack platforms, always first evaluate parameters containing a stack tainting call, since those force any preceding stack parameters of the current call to be stored in a temp location and copied to the final location afterwards git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16050 3ad0048d-3df7-0310-abae-a5850022a9f2
* * Safecall on linux/i386 now behaves like cdecl plus hidden exception support.joost2010-08-271-1/+1
| | | | | | | | * Adapted tests because safecall on linux/i386 now does not include high() support anymore git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15913 3ad0048d-3df7-0310-abae-a5850022a9f2
* + support for nested procedural variables:jonas2010-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | o activate using {$modeswitch nestedprocvars} (compatible with all regular syntax modes, enabled by default for MacPas mode) o activating this mode switch changes the way the frame pointer is passed to nested routines into the same way that Delphi uses (always passed via the stack, and if necessary removed from the stack by the caller) -- Todo: possibly also allow using this parameter passing convention without enabling nested procvars, maybe even by default in Delphi mode, see mantis #9432 o both global and nested routines can be passed to/assigned to a nested procvar (and called via them). Note that converting global *procvars* to nested procvars is intentionally not supported, so that this functionality can also be implemented via compile-time generated trampolines if necessary (e.g. for LLVM or CIL backends as long as they don't support the aforementioned parameter passing convention) o a nested procvar can both be declared using a Mac/ISO Pascal style "inline" type declaration as a parameter type, or as a stand-alone type (in the latter case, add "is nested" at the end in analogy to "of object" for method pointers -- note that using variables of such a type is dangerous, because if you call them once the enclosing stack frame no longer exists on the stack, the results are undefined; this is however allowed for Metaware Pascal compatibility) git-svn-id: http://svn.freepascal.org/svn/fpc/branches/nestedprocvars@15656 3ad0048d-3df7-0310-abae-a5850022a9f2
* * when determining whether a temporary paraloc can be in a LOC_REGISTER,jonas2010-06-031-1/+1
| | | | | | | | | look at paraloc^.size rather than cgpara.size, because e.g. a 32 bit record (-> cgpara.size=OS_32) may have to be passed via a LOC_MMREGISTER (-> paraloc^.size=OS_F32 or OS_M32) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@15365 3ad0048d-3df7-0310-abae-a5850022a9f2
* * changed tprocdef.funcretloc[] from a tlocation into a tcgpara so it canjonas2010-05-301-26/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * fixed handling the result value of functions where the result type isjonas2009-09-121-2/+8
| | | | | | | | | | forced to something else by the compiler (internal rtl functions etc), necessary for the objc branch * fixed adding all used function result registers to the list of registers that may need to be saved before a function call git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13695 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
* * Removed abstract modifier for some optional (not needed for every CPU ↵yury2008-07-231-2/+15
| | | | | | target) methods in tcg and tparamanager classes. These methods throw internal error if not overrode. git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@11453 3ad0048d-3df7-0310-abae-a5850022a9f2
* * cleanup and simplify the set type handlingpeter2008-03-021-1/+1
| | | | git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@10432 3ad0048d-3df7-0310-abae-a5850022a9f2
* * split cpu64bit compiler define intojonas2008-02-131-3/+3
| | | | | | | | | | | | | | | | | | | 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
* * patch from Sergei Gorelkin to return ansi/widestrings by referencejonas2008-01-111-1/+1
| | | | | | | in an invisible parameter (Delphi compatible, faster/smaller code) git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@9718 3ad0048d-3df7-0310-abae-a5850022a9f2
* * remove tdictionary and tindexarraypeter2006-11-031-7/+7
| | | | | | | | | | | | * 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