Commit Graph

465 Commits

Author SHA1 Message Date
Károly Balogh
5f66d63335 m68k: disabled comment generation
git-svn-id: trunk@30045 -
2015-03-01 15:49:57 +00:00
Károly Balogh
997ec578e0 m68k: added a simple unaryminusnode which can utilize FNEG instruction for floats on 68881
git-svn-id: trunk@30044 -
2015-03-01 15:00:07 +00:00
Jonas Maebe
d6de2c03cb * generic part of r26050 from the hlcgllvm branch: made tcgvecnode hlcg-safe
o in particular, add tdef size information to the update_reference*()
     methods, and factored out offset adjustments into its own method
   o also make sure the passed size to update_reference*() corresponds to the
     actual size of the index, as it's no longer guaranteed to be ptruint
     since the previous commit

git-svn-id: trunk@29967 -
2015-02-23 22:56:00 +00:00
Károly Balogh
d85b49755c m68k: some ideas for a future second_abs_long implementation. no functional changes.
git-svn-id: trunk@29806 -
2015-02-23 03:37:51 +00:00
Károly Balogh
c72f58bcc5 m68k: implemented sqrt_real and abs_real inlines
git-svn-id: trunk@29805 -
2015-02-23 02:41:33 +00:00
Károly Balogh
db50666b3b n68kinl: added inline nodes for 68k. implemented first_sqr_real and second_sqr_real for 68881 FPU
git-svn-id: trunk@29799 -
2015-02-22 23:11:16 +00:00
Károly Balogh
3650991d90 m68k: support LOC_REFERENCE/LOC_CREFERENCE for floating point instructions where possible
git-svn-id: trunk@29714 -
2015-02-15 20:15:21 +00:00
Károly Balogh
fdb09365ba m68k: instead of trying to mess with LOC_FLAGS, use LOC_REGISTER to return a boolean result of the compare. idea by Florian. fixes several issues with optimizer enabled and also results in better code in some cases.
git-svn-id: trunk@29709 -
2015-02-15 17:15:15 +00:00
Károly Balogh
9693b37c1a m68k: actually,overwrite the resflags with F_E, because only that would be valid after the FSxx/TST combination
git-svn-id: trunk@29705 -
2015-02-15 14:04:11 +00:00
Károly Balogh
c062e55aa2 m68k: after a compare on the FPU, move the condition flags back to the CPU. this should make floating point compare actually working
git-svn-id: trunk@29704 -
2015-02-15 13:41:40 +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
05d38053f7 m68k: optimize a few more trivial cases
git-svn-id: trunk@29606 -
2015-02-02 08:52:19 +00:00
Károly Balogh
9d6f763d4f m68k: small helpers to determine a given int value fits into a certain size or instruction argument
git-svn-id: trunk@29605 -
2015-02-02 08:25:01 +00:00
Károly Balogh
3c2031c9c6 m68k: added RegModifiedByInstruction implementation, enabled RefsHaveScale define
git-svn-id: trunk@29597 -
2015-02-01 16:33:26 +00:00
Károly Balogh
460c4acaee m68k: implement taicpu.spilling_get_operation_type_ref, supports predecrement/postincrement addressing
git-svn-id: trunk@29593 -
2015-02-01 15:28:54 +00:00
Károly Balogh
6070ac3def m68k: some more basic FPU stuff
git-svn-id: trunk@29407 -
2015-01-05 05:26:44 +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
florian
5c67fcc43f + change always floating point divisions into multiplications if they are a power of two,
this is an exact operation so it is always allowed
* change only divisions by normal numbers into multiplications

git-svn-id: trunk@29085 -
2014-11-16 20:47:38 +00:00
Tomas Hajny
3ee3542744 * boolean constant instead of IFDEFs for detection of microcontroller support
git-svn-id: trunk@29052 -
2014-11-10 12:34:59 +00:00
pierre
aa6b62cf4c Add new procedure option: po_syscall_has_libsym,
include this option only of libsym field
 is non NIL.
 Use this option to only write redef of libsym if needed.
 Adapt ppudump source to this new procedure option.

git-svn-id: trunk@28732 -
2014-10-03 19:26:16 +00:00
Károly Balogh
8acc260a09 m68k: added the byterev and ff1 CF ISAA+/ISAC instructions, also added byterev as a CPU capability
git-svn-id: trunk@28679 -
2014-09-16 01:39:02 +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
f91ae2700c m68k: added CPUM68K_HAS_ROLROR capability flag
git-svn-id: trunk@28616 -
2014-09-07 23:45:51 +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
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