Commit Graph

288 Commits

Author SHA1 Message Date
svenbarth
c6bfb0064f * keep track of the sections that are created in the asmlists
git-svn-id: trunk@35408 -
2017-02-10 14:38:53 +00:00
Károly Balogh
69a502db37 instead of stringdup(ppufile.getstring), have a getpshortstring function in entfile, and use it whereever possible. this avoids an extra shortstring copy, compared to the earlier solution
git-svn-id: trunk@35233 -
2017-01-04 19:19:50 +00:00
florian
c2af5a104e * patch by Emelyanov Roman to allow 64 byte alignment in the $codealign directive, resolves #30934
git-svn-id: trunk@35033 -
2016-12-01 21:21:42 +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
Jonas Maebe
d2873e433e + top_asmlist operand type for LLVM inline assembly "call" instructions
git-svn-id: trunk@34889 -
2016-11-13 16:06:23 +00:00
nickysn
77dedfdcf5 - removed tai_const.create_pint and .create_pint_aligned, because they use the
pint type, which is now deprecated (as it does not always represent the
  correct pointer type in all i8086 memory models); replacements methods, which
  should be used instead are .create_sizeint, .create_int_dataptr or
  .create_int_codeptr (or their _unaligned counterparts)

git-svn-id: trunk@34838 -
2016-11-07 15:52:52 +00:00
nickysn
594290a16e + added *_unaligned counterparts to taiconst.create_[int|nil]_[code|data]ptr
git-svn-id: trunk@34836 -
2016-11-07 15:28:52 +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
nickysn
710c830859 + added constructors taiconst.Create_sizeint and .Create_sizeint_unaligned. They
create constants, corresponding to the SizeInt type for the current target and
  are intended to eventually replace .Create_pint, since the pint type is now
  deprecated (because it does not correspond to the size of a pointer in certain
  i8086 memory models).

git-svn-id: trunk@34620 -
2016-10-04 14:08:33 +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
Jonas Maebe
60fe7c2888 - removed unused section_symbol_start/end() routines
git-svn-id: trunk@34161 -
2016-07-20 20:52:50 +00:00
Jonas Maebe
ee5a64c2f8 - removed tai_varloc.oldlocation: it is not used anywhere
git-svn-id: trunk@34083 -
2016-07-08 07:46:41 +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
nickysn
178dab45d3 + added new asm directive 'asd_cpu' (specifies the CPU's instruction set) in the
compiler's internal assembly representation. It is not yet generated by the
  compiler and is only implemented properly in the NASM writer (but will
  eventually be implemented in the other assembler writers as well, including
  the internal assembler). In the future, it is intended to allow:
  1) catching instructions, generated by the compiler and not supported by the
     target CPU, due to a bug in the code generator
  2) allowing a different instruction set to be used in inline asm blocks (I'm
     planning a new directive for that - {$asmcpu XXX}), because the code
     generator will be able to switch target CPU in the middle of the asm output
     stream

git-svn-id: trunk@33121 -
2016-02-25 21:47:13 +00:00
marcus
fc2069eca8 - Removed the string for tai_labeled_instruction, repairs m68k building after revision 33074
git-svn-id: trunk@33075 -
2016-02-09 08:08:18 +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
Jonas Maebe
110a5642c0 - removed ait_weak/tai_weak, and replaced it with the previously existing
asd_weak_reference/asd_weak_definition directives

git-svn-id: trunk@32879 -
2016-01-07 22:05:38 +00:00
florian
37cb35d780 + support for the .code directive in arm inline assembler
git-svn-id: trunk@32840 -
2016-01-03 22:08:25 +00:00
nickysn
995ca4fb12 + implemented the 'SEG @DATA' inline assembler directive for i8086
git-svn-id: trunk@32280 -
2015-11-10 17:26:21 +00:00
Jonas Maebe
c3a7d76c68 * ait_jcatch should not be skipped by optimizers, as it does result in
control flow

git-svn-id: trunk@31447 -
2015-08-29 10:08:15 +00:00
Jonas Maebe
3f9f498e0d - removed leftover alpha, ia64 and vis code
git-svn-id: trunk@31446 -
2015-08-28 22:31:29 +00:00
nickysn
e9c790f4eb + support 'SEG' in the i8086 inline assembler
git-svn-id: trunk@31428 -
2015-08-26 15:57:44 +00:00
Jeppe Johansen
59f164b948 Changed type of size argument from aint to asizeint. This previously broke things on 8bit targets.
git-svn-id: trunk@31319 -
2015-08-13 01:57:09 +00:00
Jonas Maebe
07141e92d3 + support for llvm "undef" operand
git-svn-id: trunk@30669 -
2015-04-19 21:37:27 +00:00
nickysn
1c5d0ed09a + support aitconst_farptr in tai_const.size
git-svn-id: trunk@30455 -
2015-04-05 23:33:41 +00:00
florian
02d9c676d3 * make offsets passed to tconst of type asizeint instead of aint
git-svn-id: trunk@30445 -
2015-04-05 19:18:52 +00:00
Jonas Maebe
3279cc052a * moved llvm-specific code from aasmtai to aasmllvm
* call add_reg_instruction_hook() for top_para parameters

git-svn-id: trunk@30423 -
2015-04-04 14:28:57 +00:00
Jeppe Johansen
e2272c8a7e Added aitconst_gs for AVR pointer references to Flash.
git-svn-id: trunk@30419 -
2015-04-04 10:29:11 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
Jonas Maebe
fb27dff638 * generate ".abiversion 2" directive when targeting ppc64/ELFv2
* generate code to load the TOC register if it's required, and
    emit the the ".localentry" directive to indicate to the linker
    where the actual function body starts
  * support the ".localentry" directive in the ppc64 assembler reader
   o disable the fpc_qword_to_double() assembler implementation for
     ELFv2, because we can't manually insert the .localentry directive
     before the stack allocation code
  * perform indirect calls on ppc64 via R12 in ncgcal, as R12 needs to
    contain the function address on entry on ppc64/ELFv2 (and it's
    a volatile register, so there's no problem with always using
    it)

git-svn-id: trunk@30198 -
2015-03-14 18:35:31 +00:00
Jonas Maebe
8445381929 * merged ait_set and ait_thumb_set into a single tai class
(tai_symbolpair)

git-svn-id: trunk@30197 -
2015-03-14 18:35:28 +00:00
Jeppe Johansen
52e505bff7 Fixed internal error in GOT related code for ARM internal assembler.
git-svn-id: trunk@30188 -
2015-03-14 16:03:16 +00:00
Jeppe Johansen
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
sergei
31fddaafe8 + New subtype of tai_regalloc, "ra_markused". It marks a physical register as used in procedure, triggering saving/restoring that register if it is non-volatile.
git-svn-id: trunk@30010 -
2015-02-25 21:38:23 +00:00
Jonas Maebe
1de8e53edd + AArch64 jump table support
git-svn-id: trunk@29964 -
2015-02-23 22:55:42 +00:00
Jonas Maebe
5041354b8e * recognise AArch64 PIC references
git-svn-id: trunk@29925 -
2015-02-23 22:53:14 +00:00
Jonas Maebe
d246ababff + condition code operand for aarch64
+ taicpu.op_reg_cond() constructor
  * use this operand for cset

git-svn-id: trunk@29889 -
2015-02-23 22:51:19 +00:00
Jeppe Johansen
47dbec3111 Rebase to trunk revision
git-svn-id: branches/laksen/armiw@29708 -
2015-02-15 16:08:18 +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
Jeppe Johansen
6976af8365 Change .thumb_func to be an ait_directive instead of it's own tai type.
git-svn-id: branches/laksen/armiw@29334 -
2014-12-26 23:13:14 +00:00
pierre
0d9783e9a6 Avoid referencing an empty ansistring in tai_stabs.create_ansistr
git-svn-id: trunk@28990 -
2014-11-05 20:29:18 +00:00
nickysn
366dc179b6 * use tai_const.Create_int_code/dataptr(0) in tai_const.Create_nil_code/dataptr
git-svn-id: trunk@28725 -
2014-09-30 01:34:20 +00:00
nickysn
27a7c0863b + added constructors tai_const.Create_int_codeptr and .Create_int_dataptr. To be
used for emitting magic consts with the size of a code or data pointer (used
  in e.g. rtti data).

git-svn-id: trunk@28724 -
2014-09-30 01:26:16 +00:00
Jonas Maebe
23f34608ed * null-terminate tai_strings loaded from ppus
git-svn-id: branches/hlcgllvm@28133 -
2014-07-02 17:24:53 +00:00
Jonas Maebe
9f39188253 * moved the tai_*typedconst classes to aasmcnst to make use of def-related
helpers in a cleaner way (defutils would not belong in the uses clause of
    aasmtai)

git-svn-id: branches/hlcgllvm@28132 -
2014-07-02 17:24:50 +00:00
Jonas Maebe
1e7d9c9f0e + support for instruction operands that are tai themselves in the llvm
backend (required for inserting bitcasts/ptrtoint/... operations inside
    typed constant declarations)
   o taillvm constructors for creating bitcast-style and getlementptr
     operations that accept a tai as their source/base operand

git-svn-id: branches/hlcgllvm@28112 -
2014-07-01 16:30:22 +00:00
Jonas Maebe
e51b893c9e + "typed const" tai that combines a tai and its associated tdef information
git-svn-id: branches/hlcgllvm@28108 -
2014-07-01 16:30:09 +00:00
Jonas Maebe
b0ff41406a * grouped all tai_real* types into a single tai_realconst type,
to free up space for more ait_* types in taitype (can't have
    more than 32 because they have to fit in a small set)
   o factored out writing of floating point numbers as an array of
     byte in the external assemblers

git-svn-id: branches/hlcgllvm@28105 -
2014-07-01 16:29:58 +00:00