+ Added new value TAttSuffix.attsufINTdual, assigned it to movsX and movzX instructions
* Moved suffix-to-size translation tables from rax86att.pas to itcpugas.pas
+ Added x86_64 specific suffix-to-size translation, enabling BQ and WQ suffixes (LQ seems unnecessary at the moment)
* Fixed logic of tx86attreader.is_asmopcode so it only assigns dual suffix to instructions that explicitly allow it. This disambiguates cases like movsbq=movs+bq vs. cmovbq=cmovb+q
* As a net result: movz[bw]q and movs[bw]q now compile for x86_64; cmovbw and cmovbl which were incorrectly handled for i386 are now fixed.
+ Test for correct assembling of cmov.
git-svn-id: trunk@17353 -
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U rtl/inc/objc1.inc
U rtl/inc/system.inc
U rtl/objpas/typinfo.pp
A tests/test/tchlp30.pp
A tests/test/thlp35.pp
A tests/test/tchlp3.pp
A tests/test/thlp7.pp
A tests/test/trhlp24.pp
A tests/test/tchlp13.pp
A tests/test/thlp44.pp
A tests/test/thlp18.pp
A tests/test/trhlp33.pp
A tests/test/tchlp22.pp
A tests/test/thlp27.pp
A tests/test/trhlp16.pp
A tests/test/tchlp31.pp
A tests/test/thlp36.pp
A tests/test/tchlp4.pp
A tests/test/thlp8.pp
A tests/test/trhlp25.pp
A tests/test/trhlp1.pp
A tests/test/uhlp41a.pp
A tests/test/tchlp40.pp
A tests/test/tchlp14.pp
A tests/test/thlp19.pp
A tests/test/trhlp34.pp
U tests/test/ttpara1.pp
A tests/test/tchlp23.pp
A tests/test/thlp28.pp
A tests/test/urhlp14.pp
A tests/test/trhlp17.pp
A tests/test/tchlp32.pp
A tests/test/uhlp43.pp
A tests/test/thlp37.pp
A tests/test/tchlp5.pp
A tests/test/thlp9.pp
A tests/test/trhlp26.pp
A tests/test/trhlp2.pp
A tests/test/uchlp12.pp
A tests/test/tchlp41.pp
A tests/test/uhlp41b.pp
A tests/test/tchlp15.pp
A tests/test/trhlp35.pp
U tests/test/ttpara2.pp
A tests/test/tchlp50.pp
A tests/test/tchlp24.pp
A tests/test/thlp29.pp
A tests/test/trhlp18.pp
A tests/test/thlp10.pp
U tests/test/cg/ttincdec.pp
A tests/test/tchlp33.pp
A tests/test/thlp38.pp
A tests/test/tchlp6.pp
A tests/test/trhlp27.pp
A tests/test/trhlp3.pp
A tests/test/tchlp42.pp
A tests/test/tchlp16.pp
A tests/test/trhlp36.pp
A tests/test/tchlp51.pp
A tests/test/tchlp25.pp
A tests/test/trhlp19.pp
A tests/test/thlp11.pp
A tests/test/tchlp34.pp
A tests/test/thlp39.pp
A tests/test/tchlp7.pp
A tests/test/trhlp28.pp
A tests/test/thlp20.pp
A tests/test/trhlp4.pp
A tests/test/tchlp43.pp
A tests/test/tchlp17.pp
A tests/test/trhlp37.pp
A tests/test/tchlp52.pp
A tests/test/tchlp26.pp
A tests/test/thlp1.pp
A tests/test/urhlp17.pp
A tests/test/thlp12.pp
A tests/test/tchlp35.pp
A tests/test/tchlp8.pp
A tests/test/trhlp29.pp
A tests/test/thlp21.pp
A tests/test/trhlp5.pp
A tests/test/tchlp44.pp
A tests/test/tchlp18.pp
A tests/test/trhlp10.pp
A tests/test/trhlp38.pp
A tests/test/thlp30.pp
A tests/test/tchlp53.pp
A tests/test/tchlp27.pp
A tests/test/thlp2.pp
A tests/test/thlp13.pp
A tests/test/tchlp36.pp
A tests/test/tchlp9.pp
A tests/test/thlp22.pp
A tests/test/trhlp6.pp
A tests/test/tchlp45.pp
A tests/test/tchlp19.pp
A tests/test/trhlp11.pp
A tests/test/trhlp39.pp
A tests/test/thlp31.pp
A tests/test/tchlp54.pp
A tests/test/tchlp28.pp
A tests/test/uhlp39.pp
A tests/test/thlp3.pp
A tests/test/trhlp20.pp
A tests/test/thlp40.pp
A tests/test/thlp14.pp
A tests/test/tchlp37.pp
A tests/test/thlp23.pp
A tests/test/trhlp7.pp
A tests/test/tchlp46.pp
A tests/test/trhlp12.pp
A tests/test/thlp32.pp
A tests/test/tchlp29.pp
A tests/test/thlp4.pp
A tests/test/trhlp21.pp
A tests/test/tchlp10.pp
A tests/test/thlp41.pp
A tests/test/thlp15.pp
A tests/test/tchlp38.pp
U tests/test/trtti1.pp
A tests/test/trhlp30.pp
A tests/test/thlp24.pp
A tests/test/trhlp8.pp
A tests/test/uchlp18.pp
A tests/test/tchlp47.pp
A tests/test/trhlp13.pp
A tests/test/thlp33.pp
A tests/test/tchlp1.pp
A tests/test/thlp5.pp
A tests/test/trhlp22.pp
A tests/test/tchlp11.pp
A tests/test/thlp42.pp
A tests/test/thlp16.pp
A tests/test/tchlp39.pp
A tests/test/uhlp3.pp
A tests/test/trhlp31.pp
A tests/test/tchlp20.pp
A tests/test/uhlp31.pp
A tests/test/thlp25.pp
A tests/test/trhlp9.pp
A tests/test/tchlp48.pp
A tests/test/trhlp40.pp
A tests/test/trhlp14.pp
A tests/test/thlp34.pp
A tests/test/tchlp2.pp
A tests/test/thlp6.pp
A tests/test/trhlp23.pp
A tests/test/tchlp12.pp
A tests/test/thlp43.pp
A tests/test/thlp17.pp
A tests/test/trhlp32.pp
A tests/test/tchlp21.pp
A tests/test/thlp26.pp
A tests/test/tchlp49.pp
A tests/test/trhlp41.pp
A tests/test/trhlp15.pp
U tests/webtbf/tw13815.pp
U tests/tbf/tb0216.pp
U compiler/msgtxt.inc
U compiler/nld.pas
U compiler/dbgdwarf.pas
U compiler/sparc/cgcpu.pas
U compiler/fmodule.pas
U compiler/i386/cgcpu.pas
U compiler/msgidx.inc
U compiler/pdecsub.pas
U compiler/ncgld.pas
U compiler/symdef.pas
U compiler/nobj.pas
U compiler/nflw.pas
U compiler/pdecobj.pas
U compiler/objcdef.pas
U compiler/pinline.pas
U compiler/pexpr.pas
U compiler/ncgrtti.pas
U compiler/x86_64/cgcpu.pas
U compiler/htypechk.pas
U compiler/parser.pas
U compiler/tokens.pas
U compiler/symbase.pas
U compiler/ncal.pas
U compiler/symtable.pas
U compiler/pp.lpi
U compiler/m68k/cgcpu.pas
U compiler/ppu.pas
U compiler/rautils.pas
U compiler/arm/cgcpu.pas
U compiler/ptype.pas
U compiler/symconst.pas
U compiler/mips/cgcpu.pas
U compiler/msg/errore.msg
U compiler/psub.pas
U compiler/utils/ppudump.pp
U compiler/utils
U compiler/pdecvar.pas
U compiler/ncgcal.pas
U compiler/pdecl.pas
U compiler/dbgstabs.pas
U compiler/ppcgen/cgppc.pas
U packages/fcl-xml/tests/README_DOM.txt
U packages/unzip/src/unzip51g.pp
U packages/winunits-base/src/dwmapi.pp
U .
git-svn-id: trunk@17328 -
- second calculation of EDI is obsolete, its value is never used.
- calculation of ECX can be partially shared with first calculation of EDI.
- multiplying ECX by 1 is also redundant (was happening due to a wrong condition).
git-svn-id: trunk@17260 -
+ parsing of section directive for variables
+ section test
+ write section names in the assembler/binary writers correctly
* allow section only after ; and for embedded targets
git-svn-id: branches/usersections@17154 -
* $CPU/cgcpu.pas: disable the generation of VMT loading code
* dbgstabs.pas, dbgdwarf.pas: treat virtual methods of helpers as normal methods
* ncgcal.pas: don't register virtual helper methods for WPO
* ncgrtti.pas: write virtual helper methods as normal methods to RTTI
* nobj.pas: correctly handle final and override cases in helpers
* pdecvar.pas: property getters
* rautils.pas: no VMT offset in records
git-svn-id: branches/svenbarth/classhelpers@17150 -
- rename tprocdef._class to tprocdef.struct and change the type from tobjectdef to tabstractrecorddef because methods can belong not to classes only now but to records too
- replace in many places use of current_objectdef to current_structdef with typcast where is needed
- add an argument to comp_expr, expr, factor, sub_expr to notify that we are searching type only symbol to solve the problem with records,objects,classes which contains fields with the same name as previosly declared type (like:
HWND = type Handle;
rec = record
hWnd: HWND;
end;)
- disable check in factor_read_id which was made for object that only static fields can be accessed as TObjectType.FieldName outside the object because it makes SizeOf(TObjectType.FieldName) imposible and since the same method was extended to handle records it also breaks a52 package compilation
- rename tcallcandidates.collect_overloads_in_class to tcallcandidates.collect_overloads_in_struct and addapt the code to handle overloads in records too
- fix searchsym_type to search also in object ancestors if we found an object symtable
- add pd_record, pd_notrecord flags to mark procedure modifies which can or can't be used with records. Disallow the next modifiers for records: abstract, dynamic, export, external, far, far16, final, forward, internconst, internproc, interrupt, message, near, override, public, reintroduce, virtual, weakexternal,
Allow the next modifiers for records: static
git-svn-id: branches/paul/extended_records@16526 -
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: trunk@16180 -
later: the same as i386/darwin, except
a) uses the non-fragile Objective-C ABI/runtime
b) does not require stubs for direct calls/jumps (not required for
i386/darwin under 10.6 and later either, but still generated
there for backwards compatibility)
c) only the same packages are enabled as for ARM/Darwin
d) MacOSAll is compiled specifically for the iPhoneSimulator SDK
This target also defines the symbol "darwin" apart from the target
name "iphonesim" for source code compatibility reasons.
git-svn-id: trunk@16065 -
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: trunk@16050 -
as a para. But in case of the safecall convention, the funcret is always
returned as para and from the c point-of-view this is a normal para. So it has
to be popped normally. This was done by correcting the pop_size in
ti386callnode.pop_parasize but it's better to do this directly in
tcgcallnode.pass_generate_code.
git-svn-id: trunk@15994 -
shifted all the parameters on the stack. Now the 'self' parameter is
declared as var, not const, restoring its original value is not necessary
anymore
git-svn-id: trunk@15744 -
+ support for nested procedural variables:
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: trunk@15694 -
* disallow pushfd/popfd for x86_64 (mantis #14862)
* fixed assembling popfq with the internal assembler (it needs a rex.w
prefisx, while pushfq doesn't)
* changed the default opcode size of pushf/popf/pusha/popa in
{$asmmode intel} from "native size" to 16 bit (compatible with Intel
manuals and Kylix; in AT&T mode, the default size for those operations
remains the native one)
* changed pushf/popf in rtl/i386/* into pushfd/popfd because of the
previous change
git-svn-id: trunk@15546 -
Darwin/i386, because that's slightly faster on Core Solo and
later CPUs (and it avoid using a non-volatile register when not
required)
git-svn-id: trunk@15532 -
x86-64 platforms (except for win64, which uses another ABI and which
already complied to it) + test
* fixed returning records containing 1 single or double field on darwin/i386,
these have to be returned via ST0 instead of as a regular record
* added support for LOC_FPUREGISTER and LOC_MMREGISTER in several places
where they can now occur due to the previous two changes
* made a few internalerrors unique
git-svn-id: trunk@15368 -
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: trunk@15350 -
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 -
mark_NoLineinfoEnd
* add "no line info" markers for try/except and try/finally internal cleanup
code, so the debugger doesn't jump back and forth between the end and start
of exception blocks when you arrive at the end
* honour "no line info" markers in dbgdwarf.pas
git-svn-id: trunk@14327 -
-- Zusammenführen der Unterschiede zwischen Projektarchiv-URLs in ».«:
U rtl/arm/setjump.inc
A rtl/arm/thumb2.inc
U rtl/arm/divide.inc
A rtl/embedded/arm/stm32f103.pp
U rtl/inc/system.inc
U compiler/alpha/cgcpu.pas
U compiler/sparc/cgcpu.pas
U compiler/i386/cgcpu.pas
U compiler/ncgld.pas
U compiler/powerpc/cgcpu.pas
U compiler/avr/cgcpu.pas
U compiler/aggas.pas
U compiler/powerpc64/cgcpu.pas
U compiler/x86_64/cgcpu.pas
U compiler/cgobj.pas
U compiler/psystem.pas
U compiler/aasmtai.pas
U compiler/m68k/cgcpu.pas
U compiler/ncgutil.pas
U compiler/rautils.pas
U compiler/arm/raarmgas.pas
U compiler/arm/armatts.inc
U compiler/arm/cgcpu.pas
U compiler/arm/armins.dat
U compiler/arm/rgcpu.pas
U compiler/arm/cpubase.pas
U compiler/arm/agarmgas.pas
U compiler/arm/cpuinfo.pas
U compiler/arm/armop.inc
U compiler/arm/narmadd.pas
U compiler/arm/aoptcpu.pas
U compiler/arm/armatt.inc
U compiler/arm/aasmcpu.pas
U compiler/systems/t_embed.pas
U compiler/psub.pas
U compiler/options.pas
git-svn-id: trunk@13801 -
* the objc unit links against the Foundation instead of against the Cocoa
framework, and inludes an interface to either the fragile or non-fragile
obj-c run time depending on the target platform
+ support for the non-fragile Objective-C runtime/ABI, as used on Mac OS X
for ARM (iPhone) 64 bit (PowerPC/64, x86_64) -- all these targets now
are now also supported for the objectivec1 modeswitch
+ support for private_extern symbol bindings, required for the above
* mark objcclasses that are declared in the implementation section of a
unit as "hidden" (not sure what the effect is, since the Objective-C
runtime does not seem to do anything with this flag)
* enabled all obj-c tests for the newly supported platforms
git-svn-id: branches/objc@13763 -
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: trunk@13695 -
register required classes:
+ add lazy references to classes referred to in the current unit
+ define reference symbols for classes defined in the current unit
+ add lazy references to parent classes of classes defined in the current
unit
git-svn-id: branches/objc@13679 -
explicitly using -Ooasmcse for now. It will probably be completely
removed before the next major release after 2.4.0 (fixes mantis
#14363)
git-svn-id: trunk@13545 -
can remove regallocs for the allocated register and reinstert them
before already processed instructions, thereby preventing the
peephole optimizer from ever seeing the allocation for this register
(mantis #13612)
git-svn-id: trunk@13085 -
the use of Objective-C 1.0 constructs. Because it is a mode switch, it
can be used cumulatively with every syntax mode. Note that a {$mode xxx}
statement resets all mode switches as well, so you cannot use the
-Mobjectivec1 variant if you have such a statement in a unit. This
modeswitch is currently only enabled for Darwin/PowerPC and Darwin/i386,
as the backend support is not yet implemented for other platforms.
+ implemented selector() statement that can be used to create an Objective-C
selector for the message with the specified *constant* name (in the future,
it will also work for Objective-C method identifiers)
+ added SEL type to the system unit (the selector() statement returns it)
+ added all Objective-C segments to the assembler writers
+ (currently mostly dummy) objc1 unit that is automatically included if the
{$modeswitch objectivec1} statement is used
+ some tests for the selector() statement
git-svn-id: trunk@12870 -
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 -
the syntax is exactly the same as for "external", except for
the keyword. It is currently only active for Darwin targets.
It should also work at least for Linux targets, but only with
the GNU assembler (which is why it is not activated there)
+ test for this functionality
git-svn-id: trunk@12009 -
* Suppressed 2 unreachable code warnings.
* Now x86 compiler compiles without warnings and notes! It will be great to keep such state in future...
git-svn-id: trunk@11455 -
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 -
* removed addr_pic again for darwin, as you have to explicitly code
the relative address using a relsym instead of using an assembler
directive like @GOT there
git-svn-id: trunk@9353 -
- long lines were not wrapped.
- constants of type ait_comp_64bit output incorrectly.
- at end of file, current segment was not closed.
patch from Sergei Gorelkin
git-svn-id: trunk@9331 -