Károly Balogh
935820293c
m68k: in tm68ktypeconvnode.int_to_real, fix the reference before using it, and if the source is a register, make sure it's a data register
...
git-svn-id: trunk@30190 -
2015-03-14 17:14:10 +00:00
Károly Balogh
1121c2e6ce
m68k: before doing a reg->ref operation, make sure the source is a datareg
...
git-svn-id: trunk@30189 -
2015-03-14 16:36:02 +00:00
Károly Balogh
106056f462
m68k: more FMOVEM.X store/load size fixes
...
git-svn-id: trunk@30062 -
2015-03-02 02:55:23 +00:00
Károly Balogh
acaf382ea0
m68k: FMOVEM.X stores/loads each reg as 12 bytes (96 bits) not 10 bytes (80 bits), see 68k PRM, page 5-86
...
git-svn-id: trunk@30061 -
2015-03-02 02:48:35 +00:00
Károly Balogh
a526b0e5d6
m68k: implemented some missing bits of FPU cgpara handling, functions with float arguments seem to work much better now
...
git-svn-id: trunk@29650 -
2015-02-08 10:26:47 +00:00
Károly Balogh
06dfa4d30c
m68k: also alloc FPU registers during RTL helper calls
...
git-svn-id: trunk@29646 -
2015-02-07 23:31:46 +00:00
Károly Balogh
a99c9c29b6
m68k: basic 68881 FPU register save/restore support. probably still needs some work here and there.
...
git-svn-id: trunk@29644 -
2015-02-07 22:13:07 +00:00
Károly Balogh
7a91d5f495
m68k: oops, unbroke the build with softfpu
...
git-svn-id: trunk@29372 -
2015-01-02 16:00:53 +00:00
Károly Balogh
d000b1bc7c
m68k: basic 68881 fpu support. probably still broken at umpzillion places, and mostly untested, but at least it builds the RTL and all packages successfully with -Cp68020 -Cf68881 instead of dying with random internalerrors() and now even emits actual FPU opcodes.
...
git-svn-id: trunk@29370 -
2015-01-02 05:29:45 +00:00
Károly Balogh
3b205742b6
m68k: also try to optimize a special case of OP_SAR using the SWAP instruction
...
git-svn-id: trunk@28657 -
2014-09-14 12:47:07 +00:00
Károly Balogh
d561e8ab57
m68k: generate smarter shifting/rotation code on 68k, for example by utilizing the SWAP instruction
...
git-svn-id: trunk@28617 -
2014-09-07 23:46:46 +00:00
Károly Balogh
9991ee4165
m68k: support loading of refs to data registers, also when explicit paraloc is set and it's a register, use that directly, this fixes several syscall-related corner cases on Amiga
...
git-svn-id: trunk@28582 -
2014-09-02 17:38:34 +00:00
sergei
a5958d6e5f
* m68k: do not emit moves between same register, they end up in wrong code in some cases when register needs to be spilled (and entirely useless otherwise).
...
git-svn-id: trunk@28545 -
2014-08-30 22:00:54 +00:00
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
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
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
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
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
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
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
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
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
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
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
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
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
28323135f8
m68k: minor optimizations to g_proc_exit() - use LEA for stackpointer math which is better than ADDing large constants, also only modify the SP reg once
...
git-svn-id: trunk@27817 -
2014-05-25 01:34:00 +00:00
Károly Balogh
3b9e2a620b
added a remark about a possible QEMU issue with CMP/CMPI .W and .B on ColdFire
...
git-svn-id: trunk@27291 -
2014-03-26 17:08:16 +00:00
Károly Balogh
1af6d17b4d
don't enforce BPL length, use SUBQ in g_concatcopy
...
git-svn-id: trunk@27290 -
2014-03-26 15:43:25 +00:00
Károly Balogh
9ae38cdc1c
back to more conservative sign extension. this really needs separate handling for ColdFire and normal 68k, because the CF executes 32bit arithmetics only while normal 68k will do any size happily.
...
git-svn-id: trunk@27289 -
2014-03-26 15:02:50 +00:00
Károly Balogh
bca09a8f69
reverted parts of r27117 because it caused regressions
...
git-svn-id: trunk@27118 -
2014-03-12 19:22:04 +00:00
Károly Balogh
c7d1cef334
support sign/zero extension to subreg sizes, not just always to 32bit
...
git-svn-id: trunk@27117 -
2014-03-12 18:27:50 +00:00
Károly Balogh
552ab2938e
avoid some unnecessary sign extensions
...
git-svn-id: trunk@27111 -
2014-03-12 04:16:52 +00:00
Károly Balogh
3a464dbdcf
don't swap the base and index registers if we have a scalefactor
...
git-svn-id: trunk@27109 -
2014-03-12 02:34:30 +00:00
Károly Balogh
7b05113322
addressing improvements: fixref can swap base/index registers if better fits 68k pattern, less need to move around registers. also fix reference in a_op_const_ref.
...
git-svn-id: trunk@27108 -
2014-03-12 01:32:44 +00:00