Commit Graph

276 Commits

Author SHA1 Message Date
Nikolay Nikolov
09f2fa0daf + support the f32.const and f64.const instructions in twasmreader.HandlePlainInstruction 2024-07-15 20:20:13 +03:00
florian
8b08486fa1 * do not warn on lea e/rsp with negative address offset, part of #40113
+ tests
2023-01-15 23:06:05 +01:00
Jonas Maebe
8c67a4370b rautils: don't interpret ".L3" as potentially meaning "unitx.identifier"
Fixes compilation of webtbs/tw10641.pp with a compiler compiled with
range checking
2022-05-29 13:33:27 +02:00
florian
bcab6185b9 * hopefully final fix for absolute references to absolute symbols 2022-02-16 21:30:14 +01:00
Pierre Muller
2c80b2419e Fix invalid typecast by postponing sym change to after address resolution in 44094dba 2022-02-15 09:04:24 +00:00
ccrause
44094dba2f Resolve address of a symbol defined as absolute of another symbol, in assembler code. 2022-02-14 20:51:14 +00:00
florian
1c99c2655e * more helpful message if an unknown field is accessed in the assembler reader, resolves #38475
git-svn-id: trunk@48651 -
2021-02-11 20:51:53 +00:00
florian
482698e566 + add endsym to ConcatConstSymbol
git-svn-id: trunk@47668 -
2020-12-02 21:44:12 +00:00
Károly Balogh
6b1c5861af * remove obsolete comment from rautils/ConcatConstant, issue reported/initial patch by Marcel Kilgus in QLForum.co.uk
git-svn-id: trunk@47549 -
2020-11-24 05:47:09 +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
80111a0a60 * make local variables in assembler blocks working again after r44933
* test for #37218

git-svn-id: trunk@45667 -
2020-06-20 20:17:53 +00:00
florian
84a1f614d9 * fix several double ;
git-svn-id: trunk@45488 -
2020-05-24 17:52:09 +00:00
nickysn
957eaf721b * fixed handling of 16-bit consts in the Z80 asm reader
git-svn-id: branches/z80@44807 -
2020-04-18 23:37:10 +00:00
Jonas Maebe
dcf4e4cb2c * support taking the address of labels defined in assembler blocks in the
LLVM code genrator (for the rtti unit's thunk hacking)

git-svn-id: trunk@42969 -
2019-09-09 18:33:33 +00:00
Jonas Maebe
98f55b1d86 * also register symbols referenced from assembler via asolutevarsyms
git-svn-id: trunk@42307 -
2019-06-29 16:27:10 +00:00
Jonas Maebe
853e622fb7 * fix case completeness warnings
git-svn-id: branches/debug_eh@42051 -
2019-05-12 18:46:47 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
Jonas Maebe
281b3ad276 * fix case completeness and unreachable code warnings in compiler that would
be introduced by the next commit

git-svn-id: trunk@42046 -
2019-05-12 14:29:03 +00:00
Jonas Maebe
016882ca82 * do not add references to external procedures and variables to the used
compiler symbols of the current module (useless, and moreover crashes
    clang)

git-svn-id: branches/debug_eh@41215 -
2019-02-03 21:10:11 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
Jonas Maebe
51e68eb302 * fixed several places where the interface crc could change:
o unsetting po_inline while parsing the implementation for various reasons
     (interprocedural goto/label, accessing a local in a parent frame,
      having nested procedures)
   o instead handle this via the pio_inline_not_possible flag
   o noreturn can no longer be specified only in the implementation

git-svn-id: trunk@40789 -
2019-01-06 20:35:56 +00:00
Jonas Maebe
68ce5dc91f * register static symbols references from assembly code as "used" so that LLVM won't
remove them if there are no references from regular code

git-svn-id: branches/debug_eh@40432 -
2018-12-01 20:30:27 +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
nickysn
d1fc31de94 + add support for '[' and ']' parenthesis in addition to '(' and ')' in
rautils.TExprParse. They behave exactly like '(' and ')'. However, you cannot
  nest '(' with ']' and '[' with ')'. This is introduced in order to help
  implementing support for BP7 asm constants that are parsed like references,
  e.g. 'dd Rec.Str[5]' or 'dd 5[7]'.

git-svn-id: trunk@38849 -
2018-04-26 14:13:30 +00:00
nickysn
bbc364b245 * inline asm fix for accessing record variables when using the unitname (e.g.
'mov ax, unitname.varname.fieldname')

git-svn-id: trunk@38755 -
2018-04-12 16:35:21 +00:00
nickysn
2cee948b72 + support segment overrides in inline asm references to local variables or parameters on x86
git-svn-id: trunk@38392 -
2018-03-01 17:59:57 +00:00
nickysn
10cbeafd7d + always allow using @Result in inline asm sections of pascal routines (only in
pure assembler routines it is disallowed in certain cases)

git-svn-id: trunk@38292 -
2018-02-20 04:07:53 +00:00
florian
8731854165 * test code for avr assembler by Christo Crause
* fix size of val field in TOprRec for avr, resolves #32946

git-svn-id: trunk@38291 -
2018-02-19 21:23:28 +00:00
nickysn
6c69e10613 + fix for using the function name (as the function's entry point address,
instead of the function result variable, which is already accessible, using
  the @Result directive) in inline asm

git-svn-id: trunk@38289 -
2018-02-19 18:04:00 +00:00
nickysn
b9e41330d4 + ensure the callee size paraloc info is available, when setting up a local var
or parameter in RAUtils.TOperand.SetupVar(). This fixes a compiler crash, when
  a parent parameter or local var is accessed (in certain ways) inside a nested
  inline asm routine.

git-svn-id: trunk@38236 -
2018-02-14 14:14:34 +00:00
nickysn
b49c09b84c * convert the 'var' parameters of RAUtils.AsmSearchSym to 'out'
git-svn-id: trunk@38170 -
2018-02-09 15:59:18 +00:00
nickysn
4d0d143501 * converted the 'size' parameter to RAUtils.SearchType to 'out' instead of 'var'
git-svn-id: trunk@38169 -
2018-02-09 15:51:35 +00:00
nickysn
85c0b3854d * converted the 'var' parameters of RAUtils.GetRecordOffsetSize to 'out',
because they are output only

git-svn-id: trunk@38168 -
2018-02-09 15:49:00 +00:00
nickysn
11b1da0b9b + generate correct output on i8086 for 'DW xx', 'DW OFFSET xx', 'DD xx' and 'DD OFFSET xx'
git-svn-id: trunk@38151 -
2018-02-07 16:11:20 +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
nickysn
24d447716e * fixed support for access from inline asm to absolute vars, pointing to an
array element (previously, it would always point to the start of the array)

git-svn-id: trunk@37558 -
2017-11-06 16:06:34 +00:00
nickysn
9450beb99c * fixed bug in intel syntax i8086 inline asm, when certain 'jmp/call [v]'
instructions got erroneously converted to 'jmp/call v', if 'v' is an external
  far variable that points to certain things (like a local label, exported via
  public)

git-svn-id: trunk@37538 -
2017-10-31 16:49:38 +00:00
nickysn
d318ab086a * when handling absolute vars from within intel inline assembly, take the
absolute var size into account (not the type of the var it points to or no
  size at all, if it points to a fixed address)

git-svn-id: trunk@37525 -
2017-10-26 15:58:48 +00:00
nickysn
325e66287c * fix for inline asm of instructions with 32-bit constant operands on i8086
git-svn-id: trunk@37519 -
2017-10-25 18:03:22 +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
744facb7fc * properly support accepting register parameters of assembler routines in
the intel assembler reader: no longer parse them as register tokens,
    but as local operands that are later converted into registers. This
    ensures in particular that the type of the operand is set, which is
    necessary in case this operand later subscripted (as in tasm10a)

git-svn-id: trunk@36288 -
2017-05-21 20:17:15 +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
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
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
Jonas Maebe
2e0fea94b8 * set operand size information when accessing fields in assembly
(mantis #29096)

git-svn-id: trunk@32567 -
2015-12-02 15:53:22 +00:00
nickysn
ba66456bdb * properly determine the operand size for inline assembler references to procvar
variables without a manually specified size override such as 'dword ptr'.
  Mantis #29010.

git-svn-id: trunk@32379 -
2015-11-20 16:29:40 +00:00
nickysn
9e110e8e7e * treat interrupt procedures as 'near' in the i8086 inline assembler for TP7
compatibility

git-svn-id: trunk@32194 -
2015-10-29 22:43:41 +00:00
nickysn
dd9e5ea6f6 * convert 'call/jmp [proc]' properly to a near or far call/jmp, depending on
proc's call model

git-svn-id: trunk@32193 -
2015-10-29 22:05:09 +00:00