Commit Graph

85 Commits

Author SHA1 Message Date
florian
6218254e53 * allow also 8 byte string constants in assembler, resolves #28640
git-svn-id: trunk@49066 -
2021-03-27 17:13:14 +00:00
florian
4be5f07f27 + support for .dc.a directive
* read multiple section flags

git-svn-id: trunk@48903 -
2021-03-07 22:28:17 +00:00
florian
482698e566 + add endsym to ConcatConstSymbol
git-svn-id: trunk@47668 -
2020-12-02 21:44:12 +00:00
Jonas Maebe
9376f5a43a * AArch64: added SIMD instructions (only plain ARMv8-A for now)
o added AArch64 regset parsing support in assembler reader, means that "{"
     no longer starts comments there (like in the ARM assembler reader)
   o added AArch64 indexed SIMD register support and removed old cg hacks
     that worked around its absence

git-svn-id: trunk@47116 -
2020-10-15 20:29:36 +00:00
florian
a7c0fa0def o patch for Xtensa by Christo Crause, resolves #37099
+ Added postfix parsing in tattreader.GetToken
    - Removed all postfixed versions of OpCodes from the instruction list
    + Added all missing OpCodes from Xtensa ISA
    * Changed branch OpCode to A_B, similar to ARM
    + Added missing branch condition flags BCI and BSI
    * Updated existing compiler code that referred to the old postfixed instructions
    + Added prefix and postfix handling in TxtensaInstrWriter.WriteInstruction
    * Updated TCPUAddNode.second_addfloat to specify .S postfix
    * Updated tcpuunaryminusnode.second_float to specify .S postfix
    + Implemented prefix and postfix identification in txtensaattreader.is_asmopcode
    * Adapted branch condition extraction to respect postfixes
    * Changed itcpugas to call findreg_by_name_table from raatt.pas (same as issue #0037121, difficult to test these changes without including a fix for the register name search problem)

git-svn-id: trunk@45672 -
2020-06-21 14:51:40 +00:00
florian
245b58c249 + support for arm attributes
* abi notes fixed

git-svn-id: trunk@43157 -
2019-10-09 17:45:40 +00:00
florian
3949be6989 * be able to set an AT_* for datablocks
* set AT_TLS if needed

git-svn-id: trunk@43076 -
2019-09-25 21:19:07 +00:00
florian
eeadf618b8 + abi tag for i386
* arm abi tag moved into pascal file

git-svn-id: trunk@40454 -
2018-12-02 22:56:12 +00:00
florian
0cc3be49fa * GAS readers and writers can handle section flags
git-svn-id: trunk@39998 -
2018-10-20 18:23:24 +00:00
Jeppe Johansen
f781c8942e Write real atomic operations, and add memory barrier operations.
Add support for fence, and acquire/release syntax to assembler reader.
Fix broken register aliases.

git-svn-id: branches/laksen/riscv_new@39524 -
2018-07-29 16:43:09 +00:00
florian
3ca6034523 * inserted type casts on opr.val again, but depending on the type of opr.val, avoids range check errors
git-svn-id: trunk@38341 -
2018-02-25 15:32:38 +00:00
florian
d0dd3bd74e * patch by Christo Crause to support ~ in att assembler
* allow -128 to 255 as a constant for instructions taking a byte sized constants (this is also what GNU As accepts), resolves #32039

git-svn-id: trunk@38316 -
2018-02-22 20:14:56 +00:00
florian
d16a22e42b * remove type case when loading constant in tattreader.BuildConstantOperand, resolves #33202, should not hurt other targets
git-svn-id: trunk@38307 -
2018-02-21 20:24:10 +00:00
nickysn
d591e698ac + added parameter 'hasofs' to ConcatConstSymbol. Will be used to support 'dd xx'
vs 'dd offset xx' being different on i8086.

git-svn-id: trunk@38148 -
2018-02-07 15:23:48 +00:00
nickysn
629be9cee1 + add a 'constsize' parameter to ConcatConstSymbol, so it can be used to
distinguish between e.g. 16-bit and 32-bit offsets on i8086

git-svn-id: trunk@38141 -
2018-02-06 16:22:41 +00:00
florian
a29f968b3b * patch by Christo Crause: generate parameter location information in att assembler mode, resolves #32915
* forbid that parameters are subscribed in assembler, if they are references and take more than one register
+ test

git-svn-id: trunk@38125 -
2018-02-05 22:11:00 +00:00
florian
1a69c49e81 * fix range check errors by explicit casts
git-svn-id: trunk@37945 -
2018-01-11 21:00:18 +00:00
nickysn
29558a74cd + support exporting labels from asm blocks in intel syntax asm blocks via the
'public' directive

git-svn-id: trunk@37530 -
2017-10-30 16:44:13 +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
Jonas Maebe
aa82e00615 * fixed check to determine whether a record parameter can be subscripted
directly in inline assembly: that's only possible if it's a register
    parameter where the address of the record was passed (rather than the
    record itself), or if a parameter has been explicitly typecasted in
    Intel-style assembly using ".size"

git-svn-id: trunk@35959 -
2017-04-26 19:43:35 +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
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
sergei
cc3e09ee46 * Handle possible relocation types in assembler reader using a single AS_RELTYPE token, rather than with individual tokens for each case. Since possible relocations are target-dependent, this will allow to support any amount of them without modifying the base tattreader class.
git-svn-id: trunk@33117 -
2016-02-23 21:28:46 +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
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
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
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
914e9e7b49 Merged from trunk
git-svn-id: branches/laksen/armiw@30146 -
2015-03-08 12:33:46 +00:00
Jonas Maebe
558b8967b6 + Aarch64 assembler reader
git-svn-id: trunk@29913 -
2015-02-23 22:52:36 +00:00
Jonas Maebe
1dd5f579e6 * support record fields with the same name as registers in subscripts in
the assembler reader

git-svn-id: trunk@29822 -
2015-02-23 22:47:53 +00:00
Jeppe Johansen
7390acc426 Merged from recent trunk.
git-svn-id: branches/laksen/armiw@29369 -
2015-01-01 23:54:40 +00:00
sergei
d2187257e7 - removed unused type and variable
git-svn-id: trunk@29323 -
2014-12-25 10:25:21 +00:00
Jeppe Johansen
9e5979e8be Implemented UAL syntax support in the ARM assembler reader. Can be toggled with a field for now, but not implemented yet. Still using pre-UAL syntax for now.
Switched codegeneration of VFPv2 and VFPv3 to use UAL mnemonics and syntax.
Updated VFP code in RTL to use UAL syntax too.
Added preliminary ELF support for ARM.
Added support for linking of WinCE COFF files. Should work for with a standard ARMv4-I target.

git-svn-id: branches/laksen/armiw@29247 -
2014-12-10 20:44:34 +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
Jeppe Johansen
d89b9a4311 Add support in ARM assembler reader for ldr reg, =literal syntax
git-svn-id: trunk@25157 -
2013-07-21 16:06:57 +00:00
Jeppe Johansen
0977d76f42 Mark global symbols with assembler references as non-regable
git-svn-id: trunk@25155 -
2013-07-21 13:41:10 +00:00
sergei
d2995cbf14 - Removed ConcatPasString procedure, it duplicates ConcatString (it the past they probably used to differ, but today both preserve null characters).
git-svn-id: trunk@23662 -
2013-02-25 22:09:39 +00:00
florian
6fb90850e9 * lastdirective should be always AS_END
* changed some helper variables into aints

git-svn-id: trunk@22793 -
2012-10-21 10:03:04 +00:00
Jeppe Johansen
8e00978108 Added support for .section, .set, .weak, and .thumb_set directive for GAS assembler reader
IFDEF'ed JVM specific assembler directives, to prevent ait_* set to exceed 32 elements

git-svn-id: branches/laksen/arm-embedded@22580 -
2012-10-08 03:10:44 +00:00
pierre
c0690d1bdc + New virtual method TATTReader.HandleDollar, useful for MIPS reader
git-svn-id: trunk@20220 -
2012-02-02 23:45:22 +00:00
sergei
6a3fe72de9 + Support .rva directive in AT&T reader. Put it into base class because it generally applies to all targets with COFF output, but enabled for Windows targets only (others need additional testing).
+ Support .seh_handlerdata directive in Win64.

git-svn-id: trunk@19546 -
2011-10-25 15:18:47 +00:00
sergei
89c0663c56 + AT&T asmreader: added methods that can be overridden in descendant readers to handle target-specific directives.
git-svn-id: trunk@19364 -
2011-10-04 12:12:06 +00:00
Jonas Maebe
780e75bfac o patch by Jeppe Johansen to fix mantis #17472:
* generate add.w instead of add for thumb-2 in case one of the registers
      is > r8
    * add register interferences for the "add" instruction so the register
      allocator can detect invalid instruction forms (even for assembler code)
    * fixed error in thumb2.inc detected by the previous change

git-svn-id: trunk@16633 -
2010-12-24 15:54:39 +00:00
Jonas Maebe
025ec34e4d + "CExtended" type that is the same as "extended", but conforming to the
properties/behaviour of the equivalent of Extended in C (i.e., to
    "long double" on i386 and x86_64 platforms that support a 10 byte
    long double, and to "double" elsewhere)

git-svn-id: trunk@14912 -
2010-02-14 13:45:58 +00:00
tom_at_work
cc911887a8 * undo accidently committed changes from r11398
git-svn-id: trunk@11399 -
2008-07-18 15:33:48 +00:00
tom_at_work
6958bbfdda * allow explicit conversion of enumeration values (in addition to integers) to object references in Delphi mode
git-svn-id: trunk@11398 -
2008-07-18 15:30:20 +00:00
Jonas Maebe
f36e5411af * split cpu64bit compiler define into
a) cpu64bitaddr, which means that we are generating a compiler which
       will generate code for targets with a 64 bit address space/abi
    b) cpu64bitalu, which means that we are generating a compiler which
       will generate code for a cpu with support for 64 bit integer
       operations (possibly running in a 32 bit address space, depending
       on the cpu64bitaddr define)
   All cpus which had cpu64bit set now have both the above defines set,
   and none of the 32 bit cpus have cpu64bitalu set (and none will
   compile with it currently)
  + pint and puint types, similar to aint/aword (not pword because that
    that conflicts with pword=^word)
  * several changes from aint/aword to pint/pword
  * some changes of tcgsize2size[OS_INT] to sizeof(pint)

git-svn-id: trunk@10320 -
2008-02-13 20:44:00 +00:00
florian
4151029ee5 + .fini section support
git-svn-id: trunk@8174 -
2007-07-28 08:40:10 +00:00
tom_at_work
99bc1ccb75 * merged some code which was ifdefed separately for POWERPC and POWERPC64 code but is equal
git-svn-id: trunk@6383 -
2007-02-08 22:52:11 +00:00
Jonas Maebe
c866400823 + support for VMTOFFSET in assembler readers to get VMT offset of virtual
methods (mantis #8153)

git-svn-id: trunk@6168 -
2007-01-24 18:26:23 +00:00