Commit Graph

39 Commits

Author SHA1 Message Date
Jonas Maebe
0fc1fd6ac1 * replaced current_procinfo.currtrue/falselabel with storing the true/false
labels of LOC_JUMP in the node's location. This generates some extra jumps
    for short circuit boolean and/or-expressions if optimizations are off, but
    with optimisations enabled the generated code is the same (except for JVM
    because the jump threading optimisation isn't enabled there yet).

git-svn-id: trunk@31431 -
2015-08-27 18:28:57 +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
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
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
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
2c8264c42b * m68k: partially improved code generation for comparisons.
git-svn-id: trunk@28283 -
2014-07-31 18:44:07 +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
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
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
Károly Balogh
2936335f68 removed silly ancient writeln debug from me...
git-svn-id: trunk@27821 -
2014-05-28 18:36:58 +00:00
Károly Balogh
a82a3ec38e let the assembler decide about the size of the Bcc and BRA instructions, this makes code generated here work on a 68000 (and probably a lot smaller in size, no more forced 32bit displacements)
git-svn-id: trunk@27084 -
2014-03-10 18:50:05 +00:00
Jonas Maebe
4065483a50 * completed thlcgobj.location_force_fpureg(), use it everywhere and removed
ncgutil/thlcg2ll.location_force_fpureg()

git-svn-id: trunk@27071 -
2014-03-10 09:01:05 +00:00
Károly Balogh
2791e8ad15 use optimized cg loading functions in 64bit compares instead of hardcoded move.ls (move.l #X,dn is 48bit long, clr.l/moveq.l is 16bit long)
git-svn-id: trunk@26570 -
2014-01-23 03:03:44 +00:00
svenbarth
8e60465eb4 Fix the last failing tcnvint test (plus another one) by using comparisons that are not necessarily 32-bit.
m68k/n68kadd.pas, tn68kadd.second_cmpordinal:
  * use the size of the largest operand to select a fiting operand
  * ToDo: check whether a sign/zero extend of the value is necessary

git-svn-id: trunk@25628 -
2013-10-03 11:59:25 +00:00
svenbarth
4d1fb1573e m68k: Fix handling of small sets (based on how ARM does it)
Fixes 12 tests

git-svn-id: trunk@25589 -
2013-09-28 08:17:13 +00:00
svenbarth
6f5a648516 Improve the cpu type handling for M68k just in case we should branch 2.8.0 before I can start working on M68k again.
Therefor the cpu type (-Cp...) "coldfire" was split up into "isaa", "isaa+", "isab" and "isac". The Linux RTL can currently compiled for "68020", "isab" and "isac". For the other three Bcc.L must be handled differently (only Bcc.B/W supported) and for "68000" also EXT.L needs to be handled differently.

fpcdefs.inc:
  + define CPUCAPABILITIES if capabilities can be set for a certain CPU type (currently ARM, AVR and M68k)
options.pas:
  * check for CPUCAPABILITIES instead of specific CPUs
assemble.pas:
  - the handling of the CPU type is already done in m68k/ag68kgas.pas, Tm68kGNUAssembler.MakeCmdLine (and thereby already using the gascputypestr array!)
m68k/cpuinfo.pas:
  - tcputype: remove "cpu_coldfire"
  + tcputype: add "cpu_isa_a", "cpu_isa_a_p", "cpu_isa_b" and "cpu_isa_c"
  + add "cpu_coldfire" constant which contains all Coldfire specific cpu types
  * adjust "cputypestr" and  "gascputypestr"
  + add tcpuflags and cpu_capabilities (DBRA restriction was checked with CPUCOLDFIRE, CAS/TAS will be needed for atomic operations and BRAL restriction was discovered during testing of new cpu types)
m68k/cgcpu.pas:
  * adjust checks for "cpu_coldfire"
m68k/n68kadd.pas:
  * don't use a BRA.L if it is not supported, but (at least for now) a BRA.W
aggas.pas:
  * adjusted check for Coldfire

git-svn-id: trunk@25457 -
2013-09-11 17:07:32 +00:00
Jonas Maebe
2dd75e707e * renamed thlcgobj.tcgsize2orddef to defutil.cgsize_orddef
git-svn-id: trunk@24743 -
2013-06-01 18:28:15 +00:00
svenbarth
78f0d6f70e Revert the changes from r23383 for m68k/n68kadd.pas. Memo to self: Don't change code if you don't really understand why it does things the way it does.
With this change and the change from r23465 we are down from ~950 to ~650 failures :D

git-svn-id: trunk@23466 -
2013-01-20 18:00:51 +00:00
svenbarth
ccecf2c13c Fix comparisons (aka usage of flag/CCR register)
m68k/aasmcpu.pas, taicpu.spilling_get_operation_type:
  * add all Sxx instructions as "operand_write" instructions

m68k/n68kadd.pas, t68kaddnode.getresflags:
  * use the correct operation in case of swapped nodes

m68k/cgcpu.pas, tcg68k.g_flags2reg:
  - don't move a 0 to the register, because this will CLR it and thus the flags won't be valid anymore...
  - NEG would have been the wrong operation (NOT would have been correct), but it isn't needed anyway...
  * simplify the method by handling the address register case only when necessary

git-svn-id: trunk@23383 -
2013-01-14 20:31:15 +00:00
svenbarth
9d4d7d748c m68k/n68kadd.pas:
+ add support for 64-bit comparisons; the code is based on the code of mips/ncpuadd.pas, but heavily adjusted for m68k

git-svn-id: trunk@22913 -
2012-11-01 21:27:02 +00:00
svenbarth
f0aad6dbc4 * m68k/n68kadd.pas, t68kaddnode.second_cmpordinal:
for "CMP" it is important to note that the first operand (which can be basically a register, a constant or a reference) is substracted from the second operand (which needs to be a data register) and not the other way round

git-svn-id: trunk@22798 -
2012-10-21 13:59:05 +00:00
svenbarth
5bb0e5992b * m68k/n68kadd.pas, t68kaddnode.second_cmpboolean:
don't use "location.loc" if second_pass was not called on the node yet, but "expectloc"
* added test

git-svn-id: trunk@22789 -
2012-10-20 20:32:46 +00:00
svenbarth
f746d9603a * m68k/n68kadd.pas, t68kaddnode.second_cmpsmallset:
respect more location combinations than just LOC_CONSTANT and LOC_REGISTER
* added test

git-svn-id: trunk@22786 -
2012-10-20 19:39:29 +00:00
Jonas Maebe
edd42aa42a * moved subsetref/reg and bit_set/test support from cgobj to hlcgobj for
future use by high level code generator targets
   o this in turn required that all a_load*_loc* methods are called via
     hlcg rather than via cg, since a location can be a subsetref/reg and
     and those are no longer handled in tcg
   o that then required moving several force_location_* routines into
     thlcg because they use a_load_loc*, but did not take tdef size
     parameters (which are required by the thlcg a_load_loc* routines)
   o the only practical consequence is that from now on, you have to
     use hlcg.location_force_mem/reg() (fpureg not yet) and
     hlcg.gen_load_loc_cgpara() instead of the removed versions from ncgutil,
     and hlcg.a_load*loc*() instead of cg.a_load*loc* if a subsetref/reg
     might be involved

git-svn-id: trunk@21287 -
2012-05-13 12:33:10 +00:00
florian
26850e3425 * fix full cycle after adding new boolean types
git-svn-id: branches/pasboolxx@17847 -
2011-06-27 20:11:08 +00:00
Jonas Maebe
8349cde7db * changed byte/word/longbool to be Delphi-compatible (+ similar changes
for qwordbool) + test:
    o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
    o these types are now all signed
    o converting an integer type to a byte/word/long/qwordbool using an
      explicit type cast keeps the integer's original value stored in the
      bool, instead of forcing it to ord(true)/ord(false)
    (mantis #10233 and #10613, implemented for all architectures, testsuite
     tested for ppc32, sparc and x86)
  * fixed some places where the rtl depended on longbool(true) having the
    value 1
  * extended several boolean tests (and adapted some to no longer assume
    that byte/word/long/qwordbool(true)=1)
  + support for converting to qwordbool in second_int_to_bool for x86, ppc
    and sparc

git-svn-id: trunk@9898 -
2008-01-24 21:30:55 +00:00
Jonas Maebe
1d96dcc50d * renamed nf_swaped to nf_swapped
git-svn-id: trunk@5818 -
2007-01-05 12:47:22 +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
peter
658c46b903 * remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
  * rename torddef.typ to torddef.ordtype
  * rename tfloatdef.typ to tfloatdef.floattype
  * rename tdef.deftype to tdef.typ
  * remove obsolete browser code, browcol is kept so the ide
    can still be compiled

git-svn-id: trunk@5192 -
2006-11-03 00:30:30 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
3078a1927f * remove ttype
* rename old ttype variables *type to *def
  * rename resulttypepass to pass_typecheck
  * rename pass_2 to pass_generate_code

git-svn-id: trunk@5077 -
2006-10-29 22:19:39 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
Károly Balogh
37024dc4d0 + more m68k mess... ignore :)
git-svn-id: trunk@2384 -
2006-01-31 16:58:50 +00:00
Károly Balogh
8d8e9b8806 + more 68k mess, committed to transfer between dev machines, ignore
git-svn-id: trunk@2382 -
2006-01-31 01:39:24 +00:00
Károly Balogh
db07870443 totally messy m68k changes. cleanup in progress
git-svn-id: trunk@2352 -
2006-01-27 14:20:35 +00:00