Commit Graph

103 Commits

Author SHA1 Message Date
svenbarth
a4f390e4d9 m68k/cgcpu.pas, tcg64f68k:
+ a_op64_reg_reg: add support for "NEG" and "NOT" of 64-bit values
  + a_op64_const_reg: make sure that we know whether a NEG or NOT with a constant is performed

git-svn-id: trunk@22930 -
2012-11-04 20:27:01 +00:00
svenbarth
22552e468b m68k/cgcpu.pas, tcg68k.g_concatcopy:
* in case of copying from the parameter location to the local location we need to use the alignment size for the source as byte/word values are passed as LongInts (this is how the ABI is specified)

git-svn-id: trunk@22924 -
2012-11-04 16:11:16 +00:00
svenbarth
30f006d751 m68k/cgcpu.pas, tcg64f68k.a_op64_const_reg:
* use the correct register for the high value

git-svn-id: trunk@22923 -
2012-11-04 16:08:37 +00:00
svenbarth
49d953aea2 m68k/cgcpu.pas:
+ add methods "call_rtl_mul_const_reg" and "call_rtl_mul_reg_reg" which can call the RTL helpers "fpc_mul_longint" and "fpc_mul_longword" (based on AVR code)
  * use the new call methods for the RTL to correctly pass the parameters (on the stack, not in registers...)

git-svn-id: trunk@22892 -
2012-10-31 20:58:16 +00:00
svenbarth
a3a3cad8ee m68k/cgcpu.pas, tcg68k.a_load_const_ref:
* don't do a sign_extend, but use the correct move size to copy the const; this fixes the setting of the line ending style inside of "Assign"

=> output of strings does now work correctly!

git-svn-id: trunk@22890 -
2012-10-31 20:26:29 +00:00
svenbarth
c3c7ec8839 m68k/cgcpu.pas, a_load_const_reg:
don't use the given size for MOVEQ, but only S_L

git-svn-id: trunk@22888 -
2012-10-31 19:22:27 +00:00
svenbarth
b94a120f84 m68k/cgcpu.pas, a_load_const_ref & a_load_const_reg:
use the correct size when moving a constant to a reference or register

git-svn-id: trunk@22887 -
2012-10-31 19:05:22 +00:00
svenbarth
842bb90283 * m68k/cgcpu.pas, tcg68k.a_load_ref_reg:
"sign_extend" expects the old size, not the new size. This fixes the handling of "InOutRes" which is a Word...

git-svn-id: trunk@22840 -
2012-10-24 05:01:27 +00:00
svenbarth
65a4d8baa2 Revert 22814. While this revision might fix compiler linking for Coldfire it breaks running any Coldfire up during OpenStdIO... I prefer running apps instead of a linking compiler.
Seems that I need to think this "fixref" stuff for symbols through a bit more...

git-svn-id: trunk@22826 -
2012-10-23 05:14:17 +00:00
svenbarth
cb8db8fa23 * m68k/cgcpu.pas, tcg68k.fixref:
always handle the symbol if base is set

git-svn-id: trunk@22814 -
2012-10-21 19:46:41 +00:00
svenbarth
5d28872a21 * m68k/cgcpu.pas, tcg68k.fixref:
also make m68k's fixref apply to the assumption that a register isn't modified in the cg

git-svn-id: trunk@22802 -
2012-10-21 17:19:09 +00:00
pierre
963e211644 Try to add all add_move_instruction calls
git-svn-id: trunk@22768 -
2012-10-19 15:38:11 +00:00
pierre
0b404fea69 * more 68000 fixref changes
git-svn-id: trunk@22764 -
2012-10-19 12:34:41 +00:00
pierre
f81954760b More 68000 restrictions taken into account for fixref and TST instruction
git-svn-id: trunk@22762 -
2012-10-19 11:54:05 +00:00
pierre
d472b40149 Move conversion to address register of base reference to common code in fixref
git-svn-id: trunk@22759 -
2012-10-19 09:57:49 +00:00
svenbarth
8e07ddb2bc * made internal errors for M68K unique
* fixed comment
* added comment regarding the potential usage of an address register instead of an int one

git-svn-id: trunk@22744 -
2012-10-18 20:12:07 +00:00
svenbarth
43d8da7aa3 Replace DBRA instruction for Coldfire with a SUB/BRA combination in the for-loop-code-
generation and the assembly helpers in the RTL as DBRA is not supported by Coldfire.

git-svn-id: trunk@22740 -
2012-10-18 20:11:45 +00:00
svenbarth
d5523e6af6 For now completely disable (I)MUL/(I)DIV support for Coldfire and pass through the RTL routines
(of which the names had changed from FPC_MUL_LONGWORD->FPC_MUL_DWORD and FPC_MOD_CARDINAL->
FPC_MOD_DWORD).
Also disable the usage of FPU opcodes for Coldfire.

git-svn-id: trunk@22739 -
2012-10-18 20:11:39 +00:00
svenbarth
dea2a205c9 Fixed reference handling mostly for Coldfire CPUs. While they are conceptually based on
M68000 CPUs they are nevertheless more restricted in some cases, so these need to be
handled explicitely (especially if symbols are involved).

git-svn-id: trunk@22738 -
2012-10-18 20:11:33 +00:00
svenbarth
72a47ea27a m68k/cgcpu.pas, tcg68k.g_proc_exit:
* generate special return code for non-68020 CPU which don't support RTD instruction (based on
  out code a few lines further down)

git-svn-id: trunk@22736 -
2012-10-18 20:11:25 +00:00
svenbarth
cfadcf3769 m68k/cgcpu.pas, tcg68k.a_op_const_reg:
leave "and" and "or" as "and" and "or" as according to the assembly language reference the
  assembler should automatically choose the correct instruction (though Coldfire still should
  be tested for ORI/ANDI to CCR

git-svn-id: trunk@22733 -
2012-10-18 20:11:09 +00:00
svenbarth
f501a8fecc m68k/cgcpu.pas, tcg68k.a_op_const_reg:
* use andi/ori for constant values
  * use a scratch register if target is an address register (there seems to exist an omnious
    anda/ora instruction though, but GNU as doesn't seem to handle it... maybe I haven't set
    the CPU type correctly, so I'll need to investigate this so we can hopefully remove the
    need for a scratch register for certain CPU types ;) )

git-svn-id: trunk@22732 -
2012-10-18 20:11:02 +00:00
svenbarth
05e37e3ab1 m68k/cgcpu.pas, tcg68k: implement a_jmp_name
git-svn-id: trunk@22726 -
2012-10-18 20:10:33 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
Jonas Maebe
d6066ed51a * fixed compilation for i386/m68k after r21878/21879
git-svn-id: trunk@21884 -
2012-07-11 17:41:18 +00:00
florian
77f2d6cc0d * introduce usage of TCGInt in the code generator units
git-svn-id: trunk@17459 -
2011-05-14 17:58:23 +00:00
svenbarth
96116a6c3a Several adjustments because virtual methods in helpers are just normal methods and a VMT isn't generated for them either.
* $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 -
2011-03-20 10:41:45 +00:00
paul
b317139006 compiler: fix compilation problems caused by tprocdef._class -> tprocdef.struct rename which was found by make fullcycle
git-svn-id: branches/paul/extended_records@16530 -
2010-12-10 06:50:58 +00:00
Jonas Maebe
f13f6627c4 * moved use_fixed_stack from cgutils to a method in paramgr so it can
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 -
2010-09-26 21:24:14 +00:00
Jonas Maebe
9bc15a5f61 * renamed a_param_* to a_load_*_cgpara
git-svn-id: trunk@15305 -
2010-05-22 09:07:21 +00:00
florian
515774b864 * merged armthum branch
-- 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 -
2009-10-04 09:03:44 +00:00
Jonas Maebe
7d459cf12a * the compiler now explicitly keeps track of the minimally guaranteed
alignment for each memory reference (mantis #12137, and
    test/packages/fcl-registry/tregistry1.pp on sparc). This also
    enables better code generation for packed records in many cases.
  o several changes were made to the compiler to minimise the chances
    of accidentally forgetting to set the alignment of memory references
    in the future:
    - reference_reset*() now has an extra alignment parameter
    - location_reset() can now only be used for non LOC_(C)REFERENCE,
      use location_reset_ref() for those (split the tloc enum so the
      compiler can catch errors using range checking)

git-svn-id: trunk@12719 -
2009-02-08 13:00:24 +00:00
Jonas Maebe
a4cc881693 * fixed compilation after addition of support for weak symbols
git-svn-id: trunk@12716 -
2009-02-08 10:21:17 +00:00
florian
1afb1aa9cc + ror/rol functions
+ internal compiler support for ror/rol on i386

git-svn-id: trunk@11466 -
2008-07-27 17:12:32 +00:00
yury
491f0fa1d8 * Replaced all user defined warnings by TODO comments to reduce compiler noise.
git-svn-id: trunk@11443 -
2008-07-23 11:00:03 +00:00
Károly Balogh
8674e35f45 * removed a_call_reg hack, not needed after peter's latest fix
git-svn-id: trunk@9130 -
2007-11-04 15:27:31 +00:00
Károly Balogh
14f958682c + first attempt to implement a_call_reg
+ various other changes

git-svn-id: trunk@9127 -
2007-11-04 01:40:02 +00:00
Károly Balogh
1536e9e65b + de-uglified the previous hack
+ made Amiga syscalls to save/restore the frame pointer (do we really need a frame pointer?)
 + some disabled debug comments (to asm source)
 + compiler is now able to generate some VERY basic, but working Amiga-m68k executables

git-svn-id: trunk@9051 -
2007-11-01 19:31:58 +00:00
Károly Balogh
12bcb539e6 + fix(?) stack return address with an ugly hack...
git-svn-id: trunk@9047 -
2007-11-01 16:04:16 +00:00
Károly Balogh
91abb3aeb9 + first (failed) attempt to have a working stackframe generation
git-svn-id: trunk@9040 -
2007-11-01 14:16:17 +00:00
florian
00d6a03b2c + default code now preserves mm registers
* save|restore_standard_registers => save|restore_registers

git-svn-id: trunk@8954 -
2007-10-27 12:02:28 +00:00
peter
9f0ca44c94 * new tf_smartlink_library flag
* use create_smartlink[_sections|_library] to check what to 
    do for smartlinking

git-svn-id: trunk@8715 -
2007-10-01 16:55:08 +00:00
florian
bd4bb505b3 * put Charlie's writeln debugger between DEBUG_CHARLIE conditional compilation symbols
git-svn-id: trunk@8503 -
2007-09-16 11:43:04 +00:00
Jonas Maebe
e815b923d5 * a_loadfpu_* gets two size parameters: fromsize and tosize
* fixed downsizing the precision of floating point values
  * floating point constants are now treated using only the minimal
    precision required (e.g. 2.0 is now a single, 1.1 extended etc)
    (Delphi compatible)

git-svn-id: trunk@5927 -
2007-01-12 18:33:51 +00:00
florian
d1b6522866 * fixed pushing of parameters on m68k
git-svn-id: trunk@5800 -
2007-01-03 21:46:49 +00:00
pierre
8bd9d88641 * remove C like code to be able to compile unit
git-svn-id: trunk@5794 -
2007-01-02 23:30:23 +00:00
Károly Balogh
abcf865224 + more a_param_* implemented
git-svn-id: trunk@5792 -
2007-01-02 22:11:52 +00:00
Károly Balogh
e5249a8b56 + some messy m68k changes (first attempt to implement a_param_*)
git-svn-id: trunk@5782 -
2007-01-02 00:11:52 +00:00
florian
ab919747a6 * several m68k fixes
* push_value_para partially cleaned up

git-svn-id: trunk@5435 -
2006-11-20 22:13:49 +00:00
florian
4cbb67aa00 * some fpu emulation code from arm to generic code generator moved
* several m68k fixes

git-svn-id: trunk@5218 -
2006-11-04 10:23:35 +00:00