Károly Balogh
392da9e43f
* fix warnings when compiling the compiler with DFA optimizer enabled on m68k
...
git-svn-id: trunk@28499 -
2014-08-20 13:49:47 +00:00
Károly Balogh
ccc9bc0941
m68k: plain 68000 also needs extra handling for large offsets
...
git-svn-id: trunk@28423 -
2014-08-16 15:14:34 +00:00
Károly Balogh
9b0bf91076
m68k: do not generate CLR instructions to memory references on plain 68k. there this instruction also causes reads from the address, which is slow and can have side effects.
...
git-svn-id: trunk@28422 -
2014-08-16 13:03:03 +00:00
sergei
a28d6a84a7
+ m68k, a_load_const_reg: use MOV3Q if applicable for data registers as well, since it allows spilling replacement of destination.
...
+ a_load_const_ref: use CLR and MOV3Q if possible.
* a_cmp_reg_reg_label: force size to 32 bits for ISA_A and ISA_A+ targets.
+ support for stack frames larger than 32767 bytes.
git-svn-id: trunk@28298 -
2014-08-02 12:46:34 +00:00
sergei
499ff505c8
* m68k: further improved code generation for comparison nodes, support LOC_REFERENCE for 32-bit compares and omit low dword, when possible, for 64-bit ones.
...
git-svn-id: trunk@28297 -
2014-08-02 12:37:40 +00:00
sergei
b4d9d97a03
* m68k: don't do replace spilling if spilltemp.offset exceeds 16 bits on Coldfire targets.
...
git-svn-id: trunk@28296 -
2014-08-02 12:33:32 +00:00
sergei
3da5de0e5f
+ m68k, do_spill_replace: support more cases.
...
+ support spilling at offsets >32767, tested only to generate assemble-able code, support of large stack frames needs more changes elsewhere.
git-svn-id: trunk@28295 -
2014-08-01 20:32:48 +00:00
sergei
2c8264c42b
* m68k: partially improved code generation for comparisons.
...
git-svn-id: trunk@28283 -
2014-07-31 18:44:07 +00:00
sergei
01c8ee158d
- removed unused variables
...
git-svn-id: trunk@28282 -
2014-07-31 18:35:55 +00:00
sergei
a42ecadddf
+ m68k: implemented overflow checking (does not work for multiplication yet).
...
+ support references as source operands for 64-bit AND and OR operations.
git-svn-id: trunk@28275 -
2014-07-30 01:46:25 +00:00
sergei
9b9ea15d68
+ m68k: initial implementation of do_spill_replace (supports only MOVE instructions for now). Tested with qemu for Coldfire target.
...
git-svn-id: trunk@28274 -
2014-07-30 01:20:59 +00:00
sergei
bd5ce35130
* m68k: completely replaced 64-bit comparison code with a clone of i386 implementation. No optimizations yet, but it already makes system unit about 300 instructions shorter due to changing node location to LOC_JUMP.
...
* Cleaned up 32-bit comparison code and implemented one of the optimizations (TST instruction for comparison with constant zero which can act directly on references). This makes system unit shorter by about 1000 instructions.
git-svn-id: trunk@28260 -
2014-07-24 19:44:41 +00:00
sergei
dac52f503c
* m68k: fixed extension in a_load_ref_reg. Existing code cleans only bits 16-31 when loading a 8-bit register from 16-bit reference, and leaves garbage in bits 8-15.
...
git-svn-id: trunk@28256 -
2014-07-24 12:17:29 +00:00
sergei
b7da785688
* m68k: support stack cleanup at caller side, fixed calculation of pushed parameters size and offsets and cleaned out another pile of junk.
...
* Parameter offsets are now calculated similar to other targets, target_info,first_parm_offset is applied only to callee side, while at caller side offsets start from 0.
* For cdecl procedures, parameters are removed by caller, for the rest it's still done by callee (resembles i386 target, except there is no 'register' calling convention).
git-svn-id: trunk@28185 -
2014-07-08 19:08:56 +00:00
sergei
cfe13734e0
* m68k: Fixed damage caused by r27573 and r28177:
...
* longjmp: restored loading of function result (d0) which got removed in r28177.
* While at the point, added test for zero, because longjmp must never return zero values.
* Assembler reader: 'fp' refers to frame pointer, not the stack pointer.
git-svn-id: trunk@28183 -
2014-07-08 15:04:54 +00:00
sergei
df60309d96
* m68k: fixed the last remaining warning and removed "$WARNINGS OFF" directive.
...
git-svn-id: trunk@28176 -
2014-07-06 11:36:33 +00:00
Károly Balogh
e5656a6f7e
m68k assembler reader: fixed parsing of slash-separated movem/fmovem register lists. only the first register was stored.
...
git-svn-id: trunk@28174 -
2014-07-06 11:29:45 +00:00
sergei
1678fcdc2d
- m68k assembler reader: removed Oper.InitRef which was causing failure of tbs/tb0142.pp and, in general, making impossible calls/jumps to non-alias procedure names.
...
git-svn-id: trunk@28173 -
2014-07-06 10:35:35 +00:00
sergei
b91d965096
* m68k: initial support for ROL/ROR operations, defining 'cpurox' for CPU target can actually enable them. However it cannot be done outright because these instructions do not exits on Coldfire, and internal processing of RoX,Sar,BsX, etc. can not yet be switched depending on CPU subtype.
...
git-svn-id: trunk@28101 -
2014-06-29 17:49:30 +00:00
sergei
15e374f3c6
* m68k: fixed comparison of small sets, it should not modify sides. tw18013 is now correct when compiled with -O2.
...
git-svn-id: trunk@28100 -
2014-06-29 12:35:03 +00:00
sergei
0262514939
* m68k: Transform 32-bit div/mod nodes into helper calls during pass 1. This is consistent with the way other targets do it, and results in pretty much nicer code.
...
git-svn-id: trunk@28098 -
2014-06-28 13:28:01 +00:00
sergei
535218e837
* m68k: fixed OP_NOT/OP_NEG with two registers, it must never modify the source register.
...
git-svn-id: trunk@28097 -
2014-06-28 05:22:03 +00:00
sergei
85c0ba96e2
* tm68knotnode brought up to speed:
...
- removed code for everything but booleans (it is handled perfectly well by generic code)
+ operate directly on references when possible
+ added handling for 64-bit data.
git-svn-id: trunk@28096 -
2014-06-28 05:14:27 +00:00
sergei
4df49964ca
* tcg68k.a_op_reg_reg: renamed parameters 'reg1' and 'reg2' to 'src' and 'dst' to make it clear what's what.
...
* tcg68k.fixref method made public.
git-svn-id: trunk@28095 -
2014-06-28 05:09:34 +00:00
sergei
c2ab16c320
- m68k: dropped t68kaddnode.second_cmpboolean, apparently its presence just breaks tbs/tb0246 without any value added.
...
git-svn-id: trunk@28090 -
2014-06-27 16:34:14 +00:00
sergei
193fa2b95e
- m68k: removed some definitely misplaced code, comparison nodes are never handled in second_addfloat.
...
git-svn-id: trunk@28087 -
2014-06-27 13:23:12 +00:00
sergei
3851c1f494
- m68k: removed a_loadmm_* methods, no need to override because they produce internal error already in base class.
...
git-svn-id: trunk@28086 -
2014-06-27 12:15:00 +00:00
sergei
acd3ea8750
* m68k: Fixed parameter passing to conform to ABI:
...
* records are passed by value
* records with size of 1,2 or 4 are returned in registers
* parameters with size<4 are justified on the stack according to big-endian target
Now everything except floating-point parameters is compatible with C code compiled with "-malign-int -mrtd".
Compatibility with "-mno-align-int" is achievable by changing target_info.maxCrecordalign to 2, but doings so causes a lot more troubles because RTL (incorrectly) assumes that records declared with {$PACKRECORDS C} are aligned to pointer size.
+ Reuse parameter locations. Since everything is passed on stack, it reduces code size quite a bit.
- tm68kparamanager.getintparaloc removed, generic implementation has been tested and works as expected.
git-svn-id: trunk@28083 -
2014-06-27 06:58:39 +00:00
Károly Balogh
5276de5627
m68k: restored orglen variable to g_concatcopy which was actually used, but still got removed in r28072
...
git-svn-id: trunk@28080 -
2014-06-26 19:46:57 +00:00
Károly Balogh
3028f3ac78
m68k: disabled PEA debug comment accidentally left in
...
git-svn-id: trunk@28077 -
2014-06-26 16:50:42 +00:00
Károly Balogh
d93e7b3367
m68k: cleaned ancient silly debug mess from a_loadaddr_ref_reg. no functional changes.
...
git-svn-id: trunk@28076 -
2014-06-26 16:47:55 +00:00
Károly Balogh
1388cb9bae
m68k: implemented a proper a_loadaddr_ref_cgpara instead of the disabled mess in the source, utilizing the PEA instruction
...
git-svn-id: trunk@28075 -
2014-06-26 16:39:17 +00:00
sergei
4c3eb391ef
* m68k: cleaned out unused variables in cgcpu.pas
...
* Fixed reference strength in a_call_reg.
git-svn-id: trunk@28072 -
2014-06-26 08:27:38 +00:00
sergei
3ffa32a660
- m68k: removed garbage (tab characters, commented out code, unused variables, debug output and alike). Functionality unchanged.
...
git-svn-id: trunk@28070 -
2014-06-26 06:01:29 +00:00
sergei
ad59098457
+ m68k: initial implementation of g_stackpointer_alloc method, it has to exist for targets with non-fixed stack.
...
git-svn-id: trunk@28064 -
2014-06-25 17:43:37 +00:00
Károly Balogh
531ac093ed
m68k: implemented a simple a_cmp_const_ref_label. uses TST instruction to test ref contents against zero
...
git-svn-id: trunk@28053 -
2014-06-25 06:56:58 +00:00
sergei
c79cd3beca
* m68k: fixed/completed the inverse_cond function.
...
git-svn-id: trunk@28052 -
2014-06-25 05:23:30 +00:00
Károly Balogh
519094055c
m68k: cleaned up and fixed cgcpu/fixref for coldfire at least; also enabled n68kmem node, so addressing with scaling is generated now
...
git-svn-id: trunk@28025 -
2014-06-21 21:36:48 +00:00
Károly Balogh
2881bc81b1
m68k: tweaks and fixes in n68kmem. the node is still disabled, needs further fixes in cgcpu/fixref to work properly
...
git-svn-id: trunk@28011 -
2014-06-20 11:49:38 +00:00
Károly Balogh
c6153010d1
m68k: plain 68000 doesn't support index scaling at all (020+ and CF only)
...
git-svn-id: trunk@27967 -
2014-06-15 12:28:51 +00:00
Károly Balogh
0045f34322
tabs to spaces and indentation fix, no functional changes
...
git-svn-id: trunk@27950 -
2014-06-14 09:09:53 +00:00
Károly Balogh
7963351440
m68k: removed comment generation line accidentally left in from the previous commit
...
git-svn-id: trunk@27936 -
2014-06-11 22:42:26 +00:00
Károly Balogh
ed3ce4087a
m68k: try to generate a bit smaller code in g_adjust_self; also changed two JMPs to S_NO from S_L, because JMP is unsized anyway
...
git-svn-id: trunk@27935 -
2014-06-11 22:33:09 +00:00
Károly Balogh
1b11541c90
m68k: simplification and cleanup of g_proc_entry. the generated code shouldn't change
...
git-svn-id: trunk@27922 -
2014-06-10 09:15:26 +00:00
Károly Balogh
17657ca11d
m68k: more minor reference usage tweaking, hopefully fixes Mantis 26286
...
git-svn-id: trunk@27880 -
2014-06-06 16:41:40 +00:00
Károly Balogh
381cf72023
m68k: minor bits, addq/subq works also on address regs, remove reference validity check in a_op_const_ref because we have fixref() later anyway
...
git-svn-id: trunk@27876 -
2014-06-06 15:15:03 +00:00
Károly Balogh
df7af34de9
m68k: very early optimizer implementation experiments
...
git-svn-id: trunk@27862 -
2014-06-06 07:38:50 +00:00
Károly Balogh
0fe656e82d
m68k: simplified code generated by g_concatcopy and cleaned up the old mess from the code
...
git-svn-id: trunk@27859 -
2014-06-05 12:42:36 +00:00
Károly Balogh
f3bbad26c3
m68k: use MOVEA without size to load values to address regs. use a_op_const_reg in a_op_const_ref for smarter const loading when necessary
...
git-svn-id: trunk@27828 -
2014-05-30 05:29:22 +00:00
Károly Balogh
2936335f68
removed silly ancient writeln debug from me...
...
git-svn-id: trunk@27821 -
2014-05-28 18:36:58 +00:00