Commit Graph

811 Commits

Author SHA1 Message Date
Jonas Maebe
4686f61002 * keep track of the temp position separately from the offset in references,
so that they can still be freed after the reference has been changed
    (e.g. in case of array indexing or record field accesses) (mantis #33628)

git-svn-id: trunk@38814 -
2018-04-22 17:03:16 +00:00
nickysn
518cdf9674 * replaced the saved_XXX_registers arrays with virtual methods inside
tcpuparamanager, very similar to the existing get_volatile_registers_XXX. The
  new methods are called get_saved_registers_XXX, where XXX is the register
  type ("int", "address", "fpu" or "mm")

git-svn-id: trunk@38794 -
2018-04-19 21:22:16 +00:00
Károly Balogh
66d180187a m68k: fix build after r38206
git-svn-id: trunk@38210 -
2018-02-11 18:20:51 +00:00
Károly Balogh
64e7c90147 m68k: some quickhacks to support PalmOS reg-relative globals and quick-n-dirty small code PIC. needs some cleanup, but the basic idea will be useful a potential for MacOS and Amiga .library support as well, among others
git-svn-id: trunk@37900 -
2018-01-04 08:33:43 +00:00
Károly Balogh
57b2064cdd m68k/palmos: support the prc-tools specific @END hack for globals when writing data symbols
git-svn-id: trunk@37897 -
2018-01-04 07:57:29 +00:00
Károly Balogh
9f974369a1 palmos: for C and syscall functions, expect return values in A0. mark D2 and A2 as volatile during function calls
git-svn-id: trunk@37896 -
2018-01-04 07:52:11 +00:00
Károly Balogh
58d98d8cd7 m68k: made the PIC_OFFSET_REGs runtime changeable, and applied some defaults
git-svn-id: trunk@37895 -
2018-01-04 07:50:50 +00:00
Károly Balogh
4c0e6980db atari: workaround/silence of a vlink warning, when it merges ro sections into rw ones. there are no ro sections on atari anyway
git-svn-id: trunk@37878 -
2017-12-30 06:51:32 +00:00
Károly Balogh
e6aed467b5 renamed script unit to cscript to avoid namespace conflict with univint package on Darwin. this makes it possible to build the textmode IDE on Darwin
git-svn-id: trunk@37598 -
2017-11-17 11:27:19 +00:00
florian
4cf2a2672a changes to fix #32043
* changed most of the variables in the assembler readers used to store constants from aint to tcgint 
  as aint has only the size of the accumular while some CPUs (AVR) allow larger constants in instructions
+ allow access to absolute symbols with address type in inline assembler
* allow absolute addresses in avr inline assembler
+ tests

git-svn-id: trunk@37411 -
2017-10-06 21:07:19 +00:00
pierre
8b63f97173 Call ungetregister for NR_D2 at m68k-palmos syscall exit
git-svn-id: trunk@37351 -
2017-09-28 14:55:41 +00:00
Károly Balogh
e1501c86bf m68k: fix no FPU support
git-svn-id: trunk@37227 -
2017-09-16 18:13:57 +00:00
Károly Balogh
d115b0e8dc m68k: changed the internal name of 68k MacOS from system_m68k_mac to system_m68k_macos, so it's consistent with the PowerPC version. suggestion/request by Sven :)
git-svn-id: trunk@37035 -
2017-08-22 11:22:15 +00:00
Károly Balogh
1d78e73ed8 m68k: there are now cross-binutils for old MacOS, so based on the old/existing bits, fix the support in the compiler
git-svn-id: trunk@37028 -
2017-08-22 10:41:02 +00:00
Károly Balogh
addc3a2f94 m68k-palmos: fixed the syscall generation, and improved it to support the dispatch-selector-in-reg-D2 traps
git-svn-id: trunk@36892 -
2017-08-13 01:19:19 +00:00
Károly Balogh
8a71a70d3c m68k-palmos: sketched up some entirely untested syscall support, but it's probably close to what we need
git-svn-id: trunk@36891 -
2017-08-12 21:45:01 +00:00
Károly Balogh
e3ffeed1b2 m68k: removed traces of the never obsolete/ancient openbsd-m68k and never existed freebsd-m68k ports
git-svn-id: trunk@36877 -
2017-08-12 08:52:44 +00:00
pierre
225c4f33e9 Use old -m68020 architecture option for m68k-palmos assembler (version 2.14 from PRC tools)
git-svn-id: trunk@36865 -
2017-08-09 13:37:17 +00:00
Károly Balogh
358f8eb85d m68k: do not internalerror on localsize < 0. this condition is handled elsewhere in the compiler properly, so we just let it through
git-svn-id: trunk@36612 -
2017-06-29 00:11:19 +00:00
Károly Balogh
0370d52f20 m68k: support longword to double conversions with the FPU, without a helper, better code for some other cases
git-svn-id: trunk@36609 -
2017-06-28 01:27:02 +00:00
Károly Balogh
02ed753fab m68k: yet another attempt to fix small struct alignments on stack
git-svn-id: trunk@36605 -
2017-06-27 02:36:55 +00:00
Károly Balogh
8a8753eb79 m68k: reenabled some safety checks and removed obsolete TODO comment
git-svn-id: trunk@36604 -
2017-06-26 19:45:11 +00:00
Károly Balogh
d5e1b391f9 m68k: when calling g_concatcopy for para copy, still only copy cgpara.intsize amount of bytes
git-svn-id: trunk@36603 -
2017-06-26 19:40:13 +00:00
Károly Balogh
22ae3cd186 m68k: revert the r36568 and the followup fix attempts altogether, as they broke Amiga support entirely. there will be a cleanup before another fixing attempt
git-svn-id: trunk@36598 -
2017-06-26 16:02:26 +00:00
Károly Balogh
a14b2fd80a m68k: modify some alignment calculations in the register calling convention code, hopefully it fixes some Amiga regressions introduced in r36568
git-svn-id: trunk@36596 -
2017-06-25 19:33:21 +00:00
Károly Balogh
41f72a0e6d m68k: some initial support for C ABIs which use an address register to return structs by address
git-svn-id: trunk@36592 -
2017-06-24 19:03:58 +00:00
Károly Balogh
b481129f4e m68k: for cdecls with the SVR4 ABI return results both in A0 and D0
git-svn-id: trunk@36588 -
2017-06-23 19:21:20 +00:00
Károly Balogh
cf8aebf00f m68k: enabled safecall exception wrappers with linux
git-svn-id: trunk@36575 -
2017-06-22 15:31:32 +00:00
Károly Balogh
26d5500b7c m68k: one more alignment fix, hopefully fixes regressions not fixed by r36569
git-svn-id: trunk@36570 -
2017-06-22 02:41:36 +00:00
Károly Balogh
8ed84afdd4 m68k: try to fix some breakages caused by r36568
git-svn-id: trunk@36569 -
2017-06-22 02:11:42 +00:00
Károly Balogh
23f4304881 m68k: hopefully fix passing of smaller-than-alignment sized records/structs for stdcall/cdecl
git-svn-id: trunk@36568 -
2017-06-22 01:14:02 +00:00
Károly Balogh
c5222d7199 m68k: map sec_rodata as read-write in the vasm writer, to silence some vlink warnings, when it writes the relocations in a rodata section
git-svn-id: trunk@36501 -
2017-06-14 18:07:36 +00:00
Károly Balogh
3f3c4808ee m68k: add support register calling convention properly in the interface wrapper generation
git-svn-id: trunk@36499 -
2017-06-14 02:26:40 +00:00
Károly Balogh
e0cbd48785 m68k: always check the V flag after MUL/DIV overflows, because MUL/DIV never sets the C flag. note that this fix is full 68k only. on CF, MUL doesn't set any of V or C flags
git-svn-id: trunk@36496 -
2017-06-12 23:56:05 +00:00
Károly Balogh
90b1c8e5ed m68k: the previous attempt in r36480 broke more tests than it fixed, so lets revert to previous version and disable MOVE+OP+MOVE optimizations instead
git-svn-id: trunk@36484 -
2017-06-11 11:22:49 +00:00
Károly Balogh
40fb45aef6 m68k: attempt to make MOVE+OP+MOVE optmization more robust. this fixes random exceptions in tfmtbcd test among others
git-svn-id: trunk@36480 -
2017-06-10 21:54:48 +00:00
Károly Balogh
fe0bc52dc6 m68k: fixed some cases where comparing smallsets was broken, because the compare size was hardwired to 32bit
git-svn-id: trunk@36470 -
2017-06-09 17:27:06 +00:00
Károly Balogh
f7488f2bd8 m68k: don't try to inline NaN and InF values as consts into FPU operands
git-svn-id: trunk@36351 -
2017-05-27 20:51:05 +00:00
Károly Balogh
b3157aa5ea m68k: generate MUL helpers for CPUs without 32bit MUL already in pass 1
git-svn-id: trunk@36348 -
2017-05-26 18:46:19 +00:00
Károly Balogh
6ca8b1374b m68k: quickfix the 68000 builds of the compiler after r36344
git-svn-id: trunk@36346 -
2017-05-26 18:26:58 +00:00
Károly Balogh
87e8010f05 m68k: support 32x32 to 64bit MUL generation when targeting CPUs which support this instruction
git-svn-id: trunk@36339 -
2017-05-25 22:35:12 +00:00
Károly Balogh
63b3304374 m68k: instead of calling a helper, generate inlined code for 64 bit multiplications, when applicable
git-svn-id: trunk@36336 -
2017-05-25 20:59:12 +00:00
Károly Balogh
829b2fc3b3 m68k: enable 68020 codepaths to all CPUs supporting '020 features
git-svn-id: trunk@36335 -
2017-05-25 20:54:18 +00:00
Károly Balogh
e9ff684ff0 m68k: handle operand type correctly for 3 operand mul/div
git-svn-id: trunk@36334 -
2017-05-25 20:52:57 +00:00
Károly Balogh
aa87e911d7 m68k: fixed some copypaste error in a disabled debug string. no functional changes.
git-svn-id: trunk@36329 -
2017-05-25 15:12:28 +00:00
Károly Balogh
1f7b6fbd9a m68k: implement frac inline nodes
git-svn-id: trunk@36290 -
2017-05-21 21:13:02 +00:00
Károly Balogh
7ed9b9f188 m68k: instead of the FPU, use CPU instructions to copy cgparas to stack
git-svn-id: trunk@36289 -
2017-05-21 21:09:47 +00:00
Károly Balogh
94b684daee m68k: reworked flags2reg, so it generates shorter code for the most common case.
git-svn-id: trunk@36233 -
2017-05-16 23:15:05 +00:00
Károly Balogh
2d8f56597e m68k: reenabled the 68k-specific n68kset node
git-svn-id: trunk@36211 -
2017-05-15 00:45:06 +00:00
Károly Balogh
ca1ec0435d m68k: fixed the signedness of conditional jumps while creating the jump list for case statements
git-svn-id: trunk@36210 -
2017-05-14 22:27:09 +00:00
Károly Balogh
fbbe2981ca m68k: disable the cpu specific set node, until we fix some of the recently found problems with it
git-svn-id: trunk@36208 -
2017-05-14 20:52:18 +00:00
Károly Balogh
6d795df166 m68k: removed silly debug writeln accidentally left in r35671
git-svn-id: trunk@35673 -
2017-03-28 11:57:17 +00:00
Károly Balogh
eeb660017e m68k: improve floating point compares against memory references by swapping sides when left is a reference and right is a register
git-svn-id: trunk@35672 -
2017-03-28 11:50:39 +00:00
Károly Balogh
21468861d4 m68k: handle more reg_ref and ref_reg operations more flexibly on the cg level. these OPs should get utilized better with some of the upcoming inline nodes
git-svn-id: trunk@35671 -
2017-03-28 09:57:14 +00:00
Károly Balogh
a405b5a150 m68k: improve getreferencestring function a bit
git-svn-id: trunk@35634 -
2017-03-20 23:48:28 +00:00
Károly Balogh
a4b096e9da m68k: added the embedded target
git-svn-id: trunk@35589 -
2017-03-15 13:37:56 +00:00
Károly Balogh
07cfb2f43a m68k: removed unused 3 ops taicpu constructors
git-svn-id: trunk@35494 -
2017-02-28 22:10:59 +00:00
Károly Balogh
a34b6c7c53 m68k: atari also uses syscalls, so update the comment for that too
git-svn-id: trunk@35375 -
2017-01-31 14:43:25 +00:00
svenbarth
4d41decd5d * since m68k has a working implementation for the register calling convention and it's in fact used as default calling convention it should also be possible to explicitely declare routines as that calling convention
git-svn-id: trunk@35351 -
2017-01-28 14:54:31 +00:00
svenbarth
d35e9a69fa * update comment regarding pocall_syscall in supported_calling_conventions
git-svn-id: trunk@35350 -
2017-01-28 14:53:17 +00:00
Károly Balogh
94ec8ad854 m68k: added BSD targets, this means NetBSD, still under development
git-svn-id: trunk@35315 -
2017-01-16 21:30:39 +00:00
Károly Balogh
2e9d0543df m68k: do not generate copy loops for single byte copies on a plain '000
git-svn-id: trunk@35281 -
2017-01-13 15:41:21 +00:00
Károly Balogh
78a7710192 m68k: with the register calling convention, pass records by reference
git-svn-id: trunk@35279 -
2017-01-12 18:06:13 +00:00
Károly Balogh
3e4c905813 m68k: make vasm to use ELF objects on amiga, enabled smartlink sections
git-svn-id: trunk@35240 -
2017-01-05 22:29:08 +00:00
Károly Balogh
35ddac66fc m68k: fix frame pointer register on atari, and a few other non-amiga systems
git-svn-id: trunk@35204 -
2016-12-27 17:09:06 +00:00
Jonas Maebe
880d438704 * renamed t<cpuname>procinfo to tcpuprocinfo for all targets, so we can
inherit from it for LLVM without a thousand ifdefs

git-svn-id: trunk@35141 -
2016-12-16 22:41:21 +00:00
Károly Balogh
026f0e99f3 m68k: made the vasm writer use the right section attributes, but disabled named sections until some vlink issues are sorted out
git-svn-id: trunk@35116 -
2016-12-12 22:46:47 +00:00
Károly Balogh
2dc1d681c2 m68k: inherit the aout assembler writer instead of the normal one for amiga and atari. this allows to remove some of the previously added hacks in the generic writer
git-svn-id: trunk@35114 -
2016-12-12 22:41:53 +00:00
Károly Balogh
4e51dc2298 m68k: enable named sections for vasm generated objects. have a separate as_m68k_as_aout for a.out objects which doesn't have named sections. amiga and atari gas defaults to a.out, so have it default on these systems. finally enable section smartlinking for amiga and atari, which will be used with vasm assembler
git-svn-id: trunk@35112 -
2016-12-11 23:27:24 +00:00
Károly Balogh
66e651bed0 m68k: build fix
git-svn-id: trunk@35111 -
2016-12-11 16:49:03 +00:00
Károly Balogh
df38fd18e0 m68k/powerpc: improved version of int_to_bool casting. now both also passes the improved version of tb0625
git-svn-id: trunk@35108 -
2016-12-11 15:43:58 +00:00
Károly Balogh
288a39d86e m68k: indentation fixes. no functional changes.
git-svn-id: trunk@35106 -
2016-12-11 03:58:41 +00:00
Károly Balogh
15f67e6f5b m68k: in int to bool conversion, only try to zero/sign extend the value, if the destination is actually larger than the source
git-svn-id: trunk@35105 -
2016-12-11 03:57:55 +00:00
Károly Balogh
0cb555c07c syscalls: move the reference implementation of parseparaloc to paramgr. removes two identical copies from CPU specific code and enables basereg convention for AROS/x86_64. also, other minor fixes and cleanups in related code.
git-svn-id: trunk@35047 -
2016-12-03 19:00:41 +00:00
Károly Balogh
74c1f2aec9 m68k: cosmetics (less C-ism)
git-svn-id: trunk@35001 -
2016-11-27 20:31:11 +00:00
Jonas Maebe
a25ebbba3e + added volatility information to all memory references
o separate information for reading and writing, because e.g. in a
     try-block, only the writes to local variables and parameters are
     volatile (they have to be committed immediately in case the next
     instruction causes an exception)
   o for now, only references to absolute memory addresses are marked
     as volatile
   o the volatily information is (should be) properly maintained throughout
     all code generators for all archictures with this patch
   o no optimizers or other compiler infrastructure uses the volatility
     information yet
   o this functionality is not (yet) exposed at the language level, it
     is only for internal code generator use right now

git-svn-id: trunk@34996 -
2016-11-27 18:17:37 +00:00
Károly Balogh
4ee06e7bec m68k: implemented in_int_real support
git-svn-id: trunk@34993 -
2016-11-27 17:50:10 +00:00
Károly Balogh
c4e954c9a5 m68k: added fint and fintrz instructions
git-svn-id: trunk@34991 -
2016-11-27 17:42:24 +00:00
Károly Balogh
975dd13dcb m68k: fixed a copy paste error, which broke cos node on a coldfire fpu, effectively turning it into a sin node
git-svn-id: trunk@34987 -
2016-11-27 15:59:16 +00:00
Károly Balogh
a595877da3 m68k: in fmove + op + fmove optimizations, allow the ops precision to be different to the fmoves
git-svn-id: trunk@34985 -
2016-11-27 15:17:58 +00:00
Károly Balogh
98d4c426cb m68k: some groundwork for an improved optimizer, now tries to optimize away MOVE/FMOVE based unnecessary register shuffling around ops when possible (with room for further improvements)
git-svn-id: trunk@34979 -
2016-11-27 11:23:11 +00:00
Jonas Maebe
74a49b5f91 * restructured the the TExternalAssembler constructors so that the
hack for the Jasmin descendent is no longer needed

git-svn-id: trunk@34852 -
2016-11-09 19:51:20 +00:00
Károly Balogh
4ee4099fca m68k: introduce a register calling convention, inspired by VBCC. volatile registers are used to pass arguments
git-svn-id: trunk@34821 -
2016-11-06 18:00:29 +00:00
pierre
89c1b68b14 * Delete regvars unit.
This unit was empty unless OLDREGVARS macro was set,
    but this does not compile and no change has been made since 2011.

  * Remove regvars from all _USES clauses.

git-svn-id: trunk@34808 -
2016-11-06 14:01:39 +00:00
Károly Balogh
37f43d3604 m68k: cleanup of the BuildRefExpression method in the assembler reader
git-svn-id: trunk@34784 -
2016-11-05 19:58:06 +00:00
Károly Balogh
64650261d1 m68k: refactor of the reglist and the regpair support in the assembler reader. also added support for float register lists for FMOVEM
git-svn-id: trunk@34783 -
2016-11-05 18:53:20 +00:00
Károly Balogh
5237a4d5e2 m68k: support register pair operands in assembler reader and writer, as used by some instructions (mainly DIVS/DIVU and friends) so we don't have to hack them as three operand instructions
git-svn-id: trunk@34782 -
2016-11-05 17:07:18 +00:00
Károly Balogh
57e6cef18b m68k: enabled the mul to shift+sub/add optimizations for 68000
git-svn-id: trunk@34762 -
2016-10-23 23:46:32 +00:00
Károly Balogh
4620d9b22c m68k: when loading from a reference with zero extend, clear the register first, then load, instead of clearing with AND later, because this is faster on slow 68ks and also shorter
git-svn-id: trunk@34761 -
2016-10-23 23:16:03 +00:00
Károly Balogh
41776e9608 m68k: on a '000, optimize CLR.L Dx to MOVEQ #0,Dx which is slightly faster
git-svn-id: trunk@34760 -
2016-10-23 23:10:39 +00:00
Károly Balogh
660432685a m68k: review and some cleanup of the shlshrnode, also add a special case for shifting 64bit values by 1
git-svn-id: trunk@34757 -
2016-10-23 16:46:34 +00:00
Károly Balogh
51cb5aefbe m68k: use target_info.stackalign to align the stack instead of expecting a hardwired longword alignment. this is required for atari, and beneficial on all '000 targets
git-svn-id: trunk@34666 -
2016-10-08 14:01:32 +00:00
Károly Balogh
003487baab m68k: code generation for atari syscalls
git-svn-id: trunk@34611 -
2016-10-03 23:39:36 +00:00
Károly Balogh
def4df9791 m68k: fixed a bug, where during during unaligned stores, the base address was preinitalized to a temp address register from the wrong reference, causing havoc
git-svn-id: trunk@34584 -
2016-10-01 14:43:47 +00:00
Károly Balogh
ed13f4d0d1 m68k: add a function to optimize const MUL cases to sequences of shifts + ADD/SUB. mainly for '000 and other low end 68ks with slow/limited MUL capabilities. inactive for now, as it wasn't that extensively tested
git-svn-id: trunk@34560 -
2016-09-25 19:46:00 +00:00
Jonas Maebe
aa1be3276f - removed default value of _typ parameter of TAsmData.(Weak)RefAsmSymbol():
it was AT_NONE, which is invalid and should never be used
  * explicitly pass the correct value for all calls to those methods elsewhere
    in the compiler

git-svn-id: trunk@34250 -
2016-08-05 07:09:16 +00:00
Jonas Maebe
a0efde8167 * automatically generate necessary indirect symbols when a new assembler
symbol is defined
   o removed all places where AB_INDIRECT symbols were explicitly generated
   o only generate AB_INDIRECT symbols for AT_DATA on systems_indirect_var_imports
   o for some symbols an indirect symbol is always required (because they are
     dereferenced by code in RTL units) -> use new AT_DATA_FORCEINDIRECT type

git-svn-id: trunk@34165 -
2016-07-20 20:53:03 +00:00
Jonas Maebe
1cb8c0d00c * specify the def of assembler level symbols defined via
tasmdata.DefineAsmSymbol() and all routines that call it
   o will be used to automatically generate AB_INDIRECT sybols when
     necessary

git-svn-id: trunk@34164 -
2016-07-20 20:52:59 +00:00
Károly Balogh
2eeb078f3e m68k: removed obsolete and wrong comment. the '881 extended type is actually 12 bytes during load/store, not 10, which means longword alignment is fine. no functional changes.
git-svn-id: trunk@33910 -
2016-06-05 07:11:23 +00:00
Károly Balogh
77318be022 m68k: fix build errors with some assemblers on modulo calculation on 020+
git-svn-id: trunk@33867 -
2016-06-01 10:50:22 +00:00
Károly Balogh
a561ffe836 m68k: fixed initial offset adjustment for the unaligned store
git-svn-id: trunk@33860 -
2016-05-31 00:47:57 +00:00
Károly Balogh
b4fd85f19c m68k: unaligned handling for math and typeconv nodes
git-svn-id: trunk@33854 -
2016-05-29 18:48:24 +00:00
Károly Balogh
2d6736e40e m68k: fixed unaligned stores' predecrement addressing. also removed an unnecessary sign-extension of the tmpreg for 16bit stores
git-svn-id: trunk@33853 -
2016-05-29 18:25:33 +00:00
Károly Balogh
a8ad51e96f m68k: unaligned access support in add nodes
git-svn-id: trunk@33852 -
2016-05-29 18:12:36 +00:00
Károly Balogh
a756609a27 m68k: added a simple VASM writer frontend for the GNU AS writer (as VASM has a compatiblity mode)
git-svn-id: trunk@33847 -
2016-05-29 15:52:43 +00:00
Károly Balogh
c509036c11 m68k: added REMS/REMU to the special formatting requirements list in the assembler writer
git-svn-id: trunk@33840 -
2016-05-28 15:30:48 +00:00
Károly Balogh
a2a630e9c5 m68k: fixed and enabled hardware mod/div support for coldfire, also it no longer depends on cpu family but cpu capability
git-svn-id: trunk@33821 -
2016-05-26 16:54:39 +00:00
Károly Balogh
931c14f0cf m68k: in second_int_to_bool, don't call TST after OR, since OR sets the flags as required already
git-svn-id: trunk@33819 -
2016-05-26 14:48:56 +00:00
Károly Balogh
766eeffc69 m68k: build fix. (changes before commit is a bad idea...)
git-svn-id: trunk@33817 -
2016-05-26 14:47:16 +00:00
Károly Balogh
2bfa1b995a m68k: added division/remainder cpu capabilities
git-svn-id: trunk@33816 -
2016-05-26 14:41:00 +00:00
Károly Balogh
6706445cb4 m68k: enable hardware divisions for all '020+, not only 020 itself
git-svn-id: trunk@33810 -
2016-05-26 10:38:08 +00:00
Károly Balogh
aa63aa95bb m68k: a bunch of '000 related fixes and cleanups. generated source now compiles for '000 again, which was broken due to recent improvements conflicting with limitations of the original '000
git-svn-id: trunk@33809 -
2016-05-26 10:33:29 +00:00
Károly Balogh
62e0eab89b m68k: also handle large register save/restore offsets on 68000
git-svn-id: trunk@33808 -
2016-05-26 00:04:55 +00:00
Károly Balogh
0dd5beb064 m68k: more unaligned access support in the base cg, also enabled the code
git-svn-id: trunk@33807 -
2016-05-26 00:03:25 +00:00
Károly Balogh
b6d845e732 m68k: needs_unaligned helper. returns true when the given reference with the given size needs to be loaded with unaligned support on the given cpu
git-svn-id: trunk@33806 -
2016-05-25 23:56:24 +00:00
Károly Balogh
7fbae10515 m68k: added more cpu capabilities (unaligned access, long addressing, various MULx), and the 68060 cpu target
git-svn-id: trunk@33804 -
2016-05-25 22:14:58 +00:00
Károly Balogh
5acd04d284 m68k: some experimental code for the unaligned access support on plain 68000. work in progress, inactive code for now
git-svn-id: trunk@33744 -
2016-05-22 00:32:41 +00:00
Károly Balogh
a6ee4a2ded m68k: cleaned up second_addordinal and included OP_SUB in the common codepath
git-svn-id: trunk@33743 -
2016-05-21 18:43:26 +00:00
Károly Balogh
47621f81cd m68k: implemented second_addordinal; for the most trivial cases. this allows the right node to be a reference. falls back to the generic implementation for nontrivial cases.
git-svn-id: trunk@33741 -
2016-05-21 16:46:12 +00:00
Károly Balogh
786aecabeb m68k: improved a_op_reg_ref, to support more operations. implemented a_op_ref_reg
git-svn-id: trunk@33739 -
2016-05-21 16:41:13 +00:00
Károly Balogh
25c34aedc2 m68k: implemented tcpucasenode.genlinearlist. 68k doesn't need cmp after sub, as sub sets the flags as expected. results in simpler, faster and more compact code
git-svn-id: trunk@33709 -
2016-05-19 21:33:45 +00:00
Károly Balogh
424f329173 m68k: use inlined realconsts also during normal float calculations on '881/040/060. also optimize them where possible
git-svn-id: trunk@33671 -
2016-05-10 18:19:41 +00:00
Károly Balogh
2dbfca4e8e m68k: optimize a few cases of comparisons against inlined realconsts
git-svn-id: trunk@33669 -
2016-05-10 15:39:08 +00:00
Károly Balogh
7710300c22 m68k: utilize FTST for comparing against float zero. also utilize FCMP realconst,fpreg on '881 for other realconst values
git-svn-id: trunk@33668 -
2016-05-10 15:38:13 +00:00
Károly Balogh
e7838dad39 m68k: initial asm-level infrastructure to let the codegenerator output float consts as operands, which is supported on 88x/040/060
git-svn-id: trunk@33667 -
2016-05-10 13:47:46 +00:00
Károly Balogh
3e2319ff3a m68k: do not allocate/free the regset dynamically having it as a normal field is perfectly fine
git-svn-id: trunk@33665 -
2016-05-10 13:03:17 +00:00
Károly Balogh
3b4822d320 m68k: utilize MVS and MVZ instructions to load values from references with zero/sign extend when they're available
git-svn-id: trunk@33656 -
2016-05-05 23:55:50 +00:00
Károly Balogh
bd17976cf1 m68k: added Coldfire CPU capability MVS/MVZ instructions. also fixed CFv4e capabilities
git-svn-id: trunk@33655 -
2016-05-05 23:54:37 +00:00
Károly Balogh
2e9ed396b4 m68k: convert non-int paraloc sizes to int in a_load_ref_cgpara, fixes build breaks with softfpu since r33651
git-svn-id: trunk@33653 -
2016-05-05 02:33:54 +00:00
Károly Balogh
1e6e5a1874 m68k: implemented a_load64_reg_ref and a_load64_ref_reg. avoids duplicated reference simplifications in the generated code during 64bit load/store
git-svn-id: trunk@33652 -
2016-05-05 00:58:21 +00:00
Károly Balogh
2b250a1b0a m68k: use a_load_ref_ref in a_load_ref_cgpara instead of a custom loading code which does the same. causes no changes in generated code
git-svn-id: trunk@33651 -
2016-05-05 00:55:52 +00:00
Károly Balogh
88e14dc456 m68k: only extend the dest reg to tosize during reg-reg moves. this removes a large amount of unnecessary sign and zero extensions from the generated code. this was attempted before, but thanks to other fixes it no longer causes testsuite regressions
git-svn-id: trunk@33648 -
2016-05-04 09:52:27 +00:00
Károly Balogh
524659b341 m68k: if we have a symbol in the location reference, that will be base, so try to insert an index register instead, reduces the amount of data->address register shuffling in the generated code
git-svn-id: trunk@33647 -
2016-05-03 23:55:27 +00:00
Károly Balogh
50a40062e2 m68k: fixed the build after r33614
git-svn-id: trunk@33617 -
2016-05-02 15:01:47 +00:00
Károly Balogh
92b2cf917d m68k: when saving/restoring FPU registers, use the right FPU register size on ColdFire to calculate the stored size
git-svn-id: trunk@33614 -
2016-05-02 14:18:30 +00:00
Károly Balogh
aa8b45904e m68k: use the existing g_call infrastructur to handle the register allocation in the helpers
git-svn-id: trunk@33589 -
2016-05-01 10:42:52 +00:00
Károly Balogh
0b7464e4cd m68k: fix large const loading to address registers
git-svn-id: trunk@33588 -
2016-05-01 10:41:40 +00:00
Károly Balogh
f48747adf5 m68k: reworked cg.g_concatcopy. generates shorter and faster code in most cases now.
git-svn-id: trunk@33575 -
2016-04-30 00:15:34 +00:00
Károly Balogh
2f23b5f0fd m68k: output some GAS specific pseudo instructions in the GNU as writer, so the assembler can do branch size optimization for us
git-svn-id: trunk@33559 -
2016-04-26 01:34:26 +00:00
Károly Balogh
4287f81b92 m68k: support and use float TResFlags in the rest of the CG. ColdFire FPU now works, and FSxx is no longer generated which is software supported on '060, and doesn't exist on CF. if we still want to support it later, we can add it to cg.g_flags2reg
git-svn-id: trunk@33558 -
2016-04-25 23:40:44 +00:00
Károly Balogh
23106882ac m68k: extended TResFlags with float resflags
git-svn-id: trunk@33557 -
2016-04-25 23:30:56 +00:00
Károly Balogh
9d2dad2463 m68k: added cpu type cfv4e, which is the only ColdFire with FPU, and GNU AS needs this to actually allow CF FPU code
git-svn-id: trunk@33556 -
2016-04-25 22:04:05 +00:00
Károly Balogh
bd564b8933 m68k: some code to support the ColdFire v4e FPU. not functional yet.
git-svn-id: trunk@33533 -
2016-04-18 03:25:32 +00:00
Károly Balogh
2e64db935a m68k: BSET and BCLR's dest operand is actually readwrite, not write only. fixes sets with regvars, when the regvar is spilled
git-svn-id: trunk@33476 -
2016-04-10 18:56:51 +00:00
Károly Balogh
4e964c2ed7 m68k: rewrote fixref and a_load_ref_ref, fixing a bunch of problems on ColdFire, unifying and simplifying the code a lot, and hopefully not killing anything in the process
git-svn-id: trunk@33446 -
2016-04-08 03:27:19 +00:00
Károly Balogh
96fe4313dd m68k: fixed spilling code interfering with some ADDQ/SUBQ/MOV3Q instructions, fixes paszlib failing since r32830
git-svn-id: trunk@33445 -
2016-04-08 03:21:09 +00:00
sergei
36043d13ae - Removed remains of tai_labeled_instruction, already commented out probably in 1.0 times.
git-svn-id: trunk@33074 -
2016-02-09 02:25:27 +00:00
Károly Balogh
b799ca40f8 m68k: various cleanups and improvements in the GAS assembler writer: pass operands to the helpers by reference, removed a few extra shortstring copies, cleanups
git-svn-id: trunk@32849 -
2016-01-05 04:12:00 +00:00
Károly Balogh
288fa53694 m68k: is_calljmp cleanup
git-svn-id: trunk@32848 -
2016-01-05 04:07:00 +00:00
Károly Balogh
2b3bd71735 m68k: include CMPI in the CMP to TST optimization
git-svn-id: trunk@32842 -
2016-01-04 01:14:34 +00:00
Károly Balogh
1e0763e251 m68k: use a_load_const_ref in a_load_const_cgpara to utilize the recently added optimized small const loading here too. this change alone shaves off ~80KB from the compiled FP IDE size...
git-svn-id: trunk@32841 -
2016-01-03 23:48:06 +00:00
Károly Balogh
185ee93312 m68k: if we're loading small (8 bit signed) values into long references, move them through a register (usually with MOVEQ). this is two bytes shorter and also faster on most 68k CPUs
git-svn-id: trunk@32837 -
2016-01-03 18:32:27 +00:00
sergei
f69f6336e9 * Replaced hacks with resetting 'c' to zero and decreasing inputpointer by boolean parameter to skipcomment and skipoldtpcomment. This parameter specifies whether first character of comment should be read.
- in_asm_string also rendered useless by r32828, removed.

git-svn-id: trunk@32836 -
2016-01-03 17:07:15 +00:00
Károly Balogh
ff7a0c5235 m68k: while updating reference, don't reallocate and copy the index to another register if we can apply scaling for it and we don't need to multiply, so the maybe_const_reg doesn't change. this improves generated code when a const reg (eg: a loop counter) is used as array index
git-svn-id: trunk@32830 -
2016-01-02 16:05:41 +00:00
Károly Balogh
92e7c0b03f m68k: assembler reader changes
* don't reimplement BuildStringConst, use the inherited one
* findopcode's string argument is now const, simplified the function and removed some dead code
* removed an intentional null ptr write in an error path, which was debug code and left in accidentally

git-svn-id: trunk@32829 -
2016-01-02 15:51:42 +00:00
sergei
bbfbab7e0c * Moved handling of comments and line breaks in assembler blocks from scanner to tokenizer level. Handling them at character level was causing compiler to accept comments in the middle of any assembler token, which should never happen. It was also causing Mantis #27459: a newline immediately after closing 'end' token was first handled in asmgetchar and then by normal parser, causing all subsequent line numbering to be off by one.
git-svn-id: trunk@32828 -
2016-01-02 06:17:14 +00:00
sergei
b1ee3dd5e5 * m68k assembler reader: call tscannerfile.illegal_char instead of reimplementing it.
git-svn-id: trunk@32819 -
2016-01-01 10:49:38 +00:00
Károly Balogh
aa424fc81f m68k: use R_SUBNONE instead of R_SUBWHOLE for FPU regs, indentation fixes of some old code and various cleanups
git-svn-id: trunk@32659 -
2015-12-13 19:24:44 +00:00
Károly Balogh
c82328e3fd m68k: implemented tcg68k.check_register_size for future use. use R_SUBNONE for FPU registers, because R_SUBWHOLE will change. use isregoverlap in a_load_reg_reg
git-svn-id: trunk@32658 -
2015-12-13 19:18:39 +00:00
Károly Balogh
001dfecdf5 m68k: use isregoverlap in is_same_reg_move, to determine if we're doing a no-op move
git-svn-id: trunk@32657 -
2015-12-13 18:14:21 +00:00
Károly Balogh
c47c6c0270 m68k: use std_regnum_search instead of prefixing the regname with % and calling gas_regnum_search
git-svn-id: trunk@32656 -
2015-12-13 18:04:30 +00:00
Károly Balogh
9c12615f09 m68k: new isregoverlap function, which returns true if the two registers overlap (same type and subreg). use the new r68kbss.inc for regnumber_count_bsstart. other minor tweaks.
git-svn-id: trunk@32655 -
2015-12-13 17:48:47 +00:00
Károly Balogh
2934424c43 m68k: updated/added some reg includes as generated by the new tool
git-svn-id: trunk@32654 -
2015-12-13 17:32:00 +00:00
Károly Balogh
9133964676 m68k: new 68k register data file format, which eases future subregister support
git-svn-id: trunk@32653 -
2015-12-13 17:29:47 +00:00
Károly Balogh
3c0dca44d3 m68k: fixed a copypaste fail in tcg68k.g_restore_registers, which affected FPU register restoring
git-svn-id: trunk@32651 -
2015-12-13 13:15:51 +00:00
Jonas Maebe
fa3b0ca312 * support marking defs created via the getreusable*() class methods as
"don't free even if not registered"; use for defs that may not be written
    to a ppu file, but that must nevertheless survive the compilation of the
    current module
  * mark all defs created for para locations as "don't free even if not
    registered", because we don't discard and recalculate all para locations
    after a module has been compiled (since that's not needed)
   o solves issues if the paralocations for a routine in the interface of
     unit A are calculated while the implementation of unit B gets
     compiled, and a new reusable type is allocated at that point which
     is not used anywhere else (after r32160)

git-svn-id: trunk@32235 -
2015-11-04 20:46:18 +00:00
Jonas Maebe
991e1f49bd * store a pointer to the used tasminfo record in every assembler writer, so
that we can use assembler writers with different conventions from the
    currently set target_asm (e.g. an x86 assembler writer for inline assembly
    in LLVM IR)

git-svn-id: trunk@31628 -
2015-09-12 23:32:13 +00:00
Jonas Maebe
b3d0197f98 * factored out the output file handling (mostly writing data) from the
external assembler writer, so we can reuse the archtecture-specific
    writers to write inline assembly in LLVM IR files

git-svn-id: trunk@31625 -
2015-09-12 23:32:01 +00:00
Jeppe Johansen
3cb9be73bc Moved tcontrollerdatatype out into cpuinfo.
Added cputype and fputype info to tcontrollerdatatype arrays.

git-svn-id: trunk@31574 -
2015-09-07 20:36:54 +00:00
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
Jonas Maebe
f402b0d7df * changed getpointerdef() into a tpointerdef.getreusable() class method
o allows removing the ugly x86 hacks

git-svn-id: trunk@31144 -
2015-06-22 08:17:49 +00:00
florian
b222d0b663 * correctly handle LOC_SUBSETREG,LOC_CSUBSETREG,LOC_SUBSETREF,LOC_CSUBSETREF in second_int_to_bool, resolves issue #28007
git-svn-id: trunk@30765 -
2015-05-02 13:52:50 +00:00
florian
7dd1d6aa77 o fixes handling of iso i/o parameters/program parameters:
* explicit reset is needed
  * variable must be declared again

git-svn-id: trunk@30757 -
2015-05-01 20:58:31 +00:00
Jonas Maebe
61e4a1b811 + added tasmlist parameter to getintparaloc() (needed for llvm)
git-svn-id: trunk@30429 -
2015-04-04 14:29:16 +00:00
Jonas Maebe
201121d7c9 * synchronised with trunk till r30345
git-svn-id: branches/hlcgllvm@30349 -
2015-03-28 12:28:15 +00:00
Károly Balogh
87deec105d m68k: implemented 68k specific a_bit_set_const_ref and a_bit_set_reg_ref, using BSET/BCLR
git-svn-id: trunk@30278 -
2015-03-22 17:44:59 +00:00
Károly Balogh
c49c8210a3 m68k: some initial HLCG, use BSET/BCLR instructions for simple bit manipulation
git-svn-id: trunk@30275 -
2015-03-22 14:01:14 +00:00
Károly Balogh
ad301f8fa1 m68k: implemented t68kvecnode.update_reference_reg_packed. same as the generic one, but allocates int registers instead of address registers, because on 68k IMUL,SHR/SHL and AND can't work on address registers, which results in a lot of register shuffling
git-svn-id: trunk@30267 -
2015-03-21 20:09:35 +00:00
Károly Balogh
258b42de26 m68k: added support for FSIN/FCOS. these are software supported on the 68040, so we should have a separate 68040/060 FPU option too, to avoid these in the future.
git-svn-id: trunk@30257 -
2015-03-17 22:52:53 +00:00
Károly Balogh
b617345e43 m68k: disabled premature MOVEA #0,Ax to SUBA Ax,Ax in the CG, because it breaks with spilling temp replacement and moved it to the optimizer, where it belongs. this fixes some code with potentially heavy address register pressure, like the IDE.
git-svn-id: trunk@30245 -
2015-03-16 02:04:58 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Károly Balogh
2555f12394 m68k: improved handling of moves and sign/zero extensions targeting address regs
git-svn-id: trunk@30232 -
2015-03-15 01:44:43 +00:00
Károly Balogh
918c4add06 m68k: in do_spill_replace, exclude the case where the source register would be an address and the destination is a reference
git-svn-id: trunk@30191 -
2015-03-14 17:19:14 +00:00
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
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +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
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