Commit Graph

380 Commits

Author SHA1 Message Date
Károly Balogh
5535df29d4 support SP and FP alias in the assembler reader too
git-svn-id: trunk@27573 -
2014-04-13 21:03:06 +00:00
Károly Balogh
7ee09b9620 instead of supporting SP only, have register A7 defined, and have SP as an alias
git-svn-id: trunk@27572 -
2014-04-13 21:02:16 +00:00
svenbarth
02495c17bd Fix a typo. The CPU specific version of "ttypesym" should be called "tcputypesym" and not "tcpuypesym".
git-svn-id: trunk@27531 -
2014-04-11 14:30:59 +00:00
sergei
5c48804240 * Moved local label infrastructure into tasmreader, reduces number of global vars. Functionality is not changed.
git-svn-id: trunk@27477 -
2014-04-05 09:43:13 +00:00
Jonas Maebe
edff5a9aa1 * fixed m68k typo in r27438
git-svn-id: trunk@27443 -
2014-04-01 21:48:28 +00:00
Jonas Maebe
d452686c39 * moved pbestrealtype from symdef to symcpu
git-svn-id: trunk@27441 -
2014-04-01 21:41:37 +00:00
Jonas Maebe
9c7c64a3af * moved amiga/morphos-specific libsym-related field from tprocdef to
cpu-specific descendants (unfortunately causes some duplication, but the
    code is trivial and there is no easy way to avoid it)
  * also moved the use of the field in ncal to cpu-specific files (with same
    caveat)

git-svn-id: trunk@27438 -
2014-04-01 21:41:27 +00:00
Jonas Maebe
dae5d1ff62 + added class reference types of the architecture-specific t*def/t*sym
classes

git-svn-id: trunk@27396 -
2014-03-30 21:04:32 +00:00
Jonas Maebe
b57c95043f + support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
   o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
     class
   o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
     class from the base classes, and initialises the c*def/c*sym classes with
     them. This is done so that the llvm target will be able to derive from
     the tcpu*def/sym classes without umpteen ifdefs, and it also means that
     the WPO can devirtualise everything because the c* variables are only
     initialised with one class type
   o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
     calls

git-svn-id: trunk@27361 -
2014-03-29 22:31:55 +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
7093efe4c4 fixed comment, no functional changes
git-svn-id: trunk@27266 -
2014-03-24 16:53:29 +00:00
Károly Balogh
ed56f3c9b1 disable the new n68kmem node for now, it needs more fixing
git-svn-id: trunk@27123 -
2014-03-13 02:08:15 +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
73db4db6f8 use the whole reg for return values
git-svn-id: trunk@27116 -
2014-03-12 18:22:04 +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
48ceebafb1 n68kmem node for better utilization of 68k specialities in addressing
git-svn-id: trunk@27110 -
2014-03-12 02:36:40 +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
Károly Balogh
01febdd7f3 plain 68000 also doesn't support 123(dX)
git-svn-id: trunk@27098 -
2014-03-11 20:47:37 +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
Károly Balogh
6bd062b59f according to the M68K PRM and also GNU AS, plain 68000 has no BRA.L
git-svn-id: trunk@27083 -
2014-03-10 18:36:10 +00:00
Károly Balogh
1e65caa37a fixed the 68020 codepath for emit_div/mod
git-svn-id: trunk@27081 -
2014-03-10 18:01:53 +00:00
Károly Balogh
73f8c956e0 don't save the FP explicitly on a syscall, as they preserve all regs anyway except scratch regs
git-svn-id: trunk@27078 -
2014-03-10 13:39:51 +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
875a7418b3 disable broken 68020 codepath and fall back to generic until it gets fixed
git-svn-id: trunk@27070 -
2014-03-10 01:36:05 +00:00
Károly Balogh
9ec1d4ee89 fixed spilling operation type for some ColdFire instructions
git-svn-id: trunk@27064 -
2014-03-09 23:04:28 +00:00
Károly Balogh
13210ff7d4 use MVZ/MVS ColdFire instructions to load constants where applicable
git-svn-id: trunk@26935 -
2014-03-03 00:53:52 +00:00
Károly Balogh
1d5f74fae0 m68k implementation of g_save_registers and g_restore_registers using movem.l
git-svn-id: trunk@26923 -
2014-03-02 14:58:05 +00:00
Károly Balogh
8730b1bf45 cleaned up g_proc_exit, optimized generated code and also added some comments about possible ABI variations. the changes also fix two tests on my system related to cdecl procedures
git-svn-id: trunk@26918 -
2014-03-01 23:52:00 +00:00
Károly Balogh
bd4cc3b8f3 cleaned up, reindented, simplified and allowed some minor optimizations in tcg64f68k
git-svn-id: trunk@26914 -
2014-03-01 18:25:05 +00:00
svenbarth
2a65c05a8c Clean up dead code.
m68k/n68kcnv.pas:
  - pass_generate_code is used from the parent class
  - ungetcpuregister is not needed here

git-svn-id: trunk@26848 -
2014-02-22 21:29:31 +00:00
svenbarth
908c0f7293 M68k: Correctly handle the case of assigning a Boolean expression to a 64-bit Boolean. Fixes tw20889.
* m68k/n68kcnv.pas, tm68ktypeconvnode.second_int_to_bool:
    Take an inspiration from the x86 code generator and correctly handle assignment of values with a size < 8 to 64-bit Booleans

git-svn-id: trunk@26847 -
2014-02-22 21:27:19 +00:00
svenbarth
435dec656f * m68k/n68kcnv.pas, tm68ktypeconvnode.second_int_to_bool:
use the size of the destination instead of the source for the destination register; fixes tenum6

git-svn-id: trunk@26835 -
2014-02-22 14:35:30 +00:00
Károly Balogh
74533a7c90 avoid generating addressing like <label>+8(aX), since this might fail during linking if label is more than 32k away, fixes linking with lineinfo unit here
git-svn-id: trunk@26826 -
2014-02-22 02:12:03 +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
Károly Balogh
667ec17cae tiny optimization for clearing address regs
git-svn-id: trunk@26569 -
2014-01-23 02:29:45 +00:00
Károly Balogh
047395df5f implemented add/sub ops in a_op_reg_ref, since these are used often. also fixed up reference handling in a_op_const_ref a bit
git-svn-id: trunk@26568 -
2014-01-23 02:07:24 +00:00
Károly Balogh
cd4bb364e5 reenabled and fixed up tcg68k.op_const_ref a bit
git-svn-id: trunk@26567 -
2014-01-22 23:15:01 +00:00
nickysn
85dd9e5789 + added a size parameter to optimize_op_const and do a sign extension of the 'a' parameter up from the specified size, so that things like (i and $ffffffff) get optimized away the same way as (i and -1)
git-svn-id: trunk@26561 -
2014-01-22 15:00:34 +00:00
pierre
6d4a9aad66 pass new asm extra opt using -ao option
git-svn-id: trunk@26539 -
2014-01-21 00:16:26 +00:00
Károly Balogh
b398430b4c * get_volatile_registers* now defines proper volatile register range for all cases using the pre-defined values
* removed the two huge and ugly case switches while parsing Amiga-specific paralocs, using a simple unified function now

git-svn-id: trunk@26466 -
2014-01-15 02:49:03 +00:00
Károly Balogh
80b253c111 be consistent in naming. renamed VOLATILE_ADDRESSREGISTER to VOLATILE_ADDRESSREGISTERS
git-svn-id: trunk@26463 -
2014-01-15 01:31:41 +00:00
Károly Balogh
b37ebeaabd disabled a_loadaddr_ref_cgpara() for m68k, this code was copy-pasted from x86 probably and could never work properly as it is
git-svn-id: trunk@26462 -
2014-01-15 01:27:02 +00:00
Károly Balogh
74af6d0dab enabled hardware mul reg, reg codepath for ColdFire too, accelerates tfloattostr test (thus some of the SoftFPU code) by a magnitude...
git-svn-id: trunk@25770 -
2013-10-13 21:36:24 +00:00
Károly Balogh
97864d7cbd trying harder to commit compilable code (manual merge fail)
git-svn-id: trunk@25764 -
2013-10-13 18:31:43 +00:00
Károly Balogh
3b99974847 set up register A6 to be saved as well. this will only happen in case A6 is not used as framepointer
git-svn-id: trunk@25759 -
2013-10-13 16:12:32 +00:00
Károly Balogh
e5eac1bd44 make the array of registers to use depending on wheter we have an FP or not, and which register we have as FP
git-svn-id: trunk@25758 -
2013-10-13 16:06:35 +00:00