Commit Graph

254 Commits

Author SHA1 Message Date
Jonas Maebe
c9c1c1686c --- Merging r46880 into '.':
U    rtl/aarch64/mathu.inc
--- Recording mergeinfo for merge of r46880 into '.':
 U   .
--- Merging r40512 into '.':
A    tests/webtbs/tw33607.pp
--- Recording mergeinfo for merge of r40512 into '.':
 G   .
--- Merging r42961 into '.':
U    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r42961 into '.':
 G   .
--- Merging r44932 into '.':
G    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r44932 into '.':
 G   .
--- Merging r44933 into '.':
U    compiler/aarch64/racpugas.pas
--- Recording mergeinfo for merge of r44933 into '.':
 G   .
--- Merging r44998 into '.':
U    compiler/aarch64/racpu.pas
--- Recording mergeinfo for merge of r44998 into '.':
 G   .
--- Merging r45667 into '.':
G    compiler/aarch64/racpugas.pas
U    compiler/rautils.pas
A    tests/webtbs/tw37218.pp
--- Recording mergeinfo for merge of r45667 into '.':
 G   .
--- Merging r45814 into '.':
U    compiler/aarch64/rgcpu.pas
A    tests/webtbs/tw37393.pp
--- Recording mergeinfo for merge of r45814 into '.':
 G   .
--- Merging r46690 into '.':
G    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r46690 into '.':
 G   .
--- Merging r46871 into '.':
U    compiler/aarch64/cgcpu.pas
--- Recording mergeinfo for merge of r46871 into '.':
 G   .

git-svn-id: branches/fixes_3_2@47756 -
2020-12-11 15:40:07 +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
nickysn
ef5e368327 + support local label data access in the i8086 inline asm (fixes test tlbldat1.pp)
git-svn-id: trunk@32179 -
2015-10-28 17:22:37 +00:00
nickysn
cb36b2d3bd * i8086 inline asm: convert 'call symbol' to 'call far symbol' only for symbols
that are an entry point of a function with a far call model

git-svn-id: trunk@32169 -
2015-10-28 00:17:54 +00:00
nickysn
e9c790f4eb + support 'SEG' in the i8086 inline assembler
git-svn-id: trunk@31428 -
2015-08-26 15:57:44 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
00b819307a + condition and shifterop operands for AArch64 assembler reader
git-svn-id: trunk@29895 -
2015-02-23 22:51:38 +00:00
florian
726a78be08 * fix possible range check errors, resolves #27461
git-svn-id: trunk@29743 -
2015-02-17 21:14:47 +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
sergei
475a9e1617 * Asm readers: allow using procedure symbols in references, resolves #22376.
* rax86int.pas: reject RIP-relative references to locals/parameters.

git-svn-id: trunk@29087 -
2014-11-17 05:34:55 +00:00
sergei
42d251da1c - x86 assembler readers: cleaned out operand swapping code. Operands of TInstruction are kept in AT&T order, Intel reader attaches operands right-to-left. It was effectively the same way before the change (except Intel reader attaching operands left-to-right, followed by a single swap), operand order checks all over the place were just reducing readability.
git-svn-id: trunk@29081 -
2014-11-16 16:37:26 +00:00
Jonas Maebe
b18ba8e85b * syncrhonised with trunk up till r28471
git-svn-id: branches/hlcgllvm@28495 -
2014-08-19 20:23:11 +00:00
Jonas Maebe
4005290b54 * aint -> asizeint (immediate operand vs offset size)
git-svn-id: trunk@28459 -
2014-08-18 23:00:17 +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
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
sergei
adc8cdb5af * Calling tlabelsym.mangledname should not define the label. This was causing "already defined" errors if a label was referenced before it was defined.
+ Test.
+ Check duplicate labels in assembler blocks. This was impossible due to above bug and duplicate labels were detected only at assembling stage where no location information could be provided.

git-svn-id: trunk@27472 -
2014-04-05 01:17:36 +00:00
florian
4d5119bf1c * fixes several issues which cause warnings by the dfa code when using it to detect uninitialized variables
git-svn-id: trunk@26161 -
2013-12-01 17:02:08 +00:00
florian
babbc21afd * fix handling of register sets on m68k: it is required that they are stored as two tcpuregistersets because address registers and data registers have different register types
git-svn-id: trunk@25726 -
2013-10-09 18:15:06 +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
paul
51825b6f2e compiler: change ret_in_param to accept tabstractprocdef instead of tproccalloption to allow check more options (required for record constructor implementation)
git-svn-id: trunk@23394 -
2013-01-16 01:14:23 +00:00
florian
283ff05127 * merged avx support in inline assembler developed by Torsten Grundke
git-svn-id: trunk@22568 -
2012-10-06 19:47:18 +00:00
florian
54d3d736f5 * patch by Jeppe Johansen to add support for handling different flags for xPSR regs,
and add usermode parsing of LDM/STM ops
  This patch basically extends the ARM assembly reader a bit to properly parse CPSR and 
  SPSR flags for the MSR opcode, and allows the reader to understand 
  the ^ modifer for register lists for STMxx and LDMxx.

  Previously the following combinations weren't possible in straight assembler:
     MRS R0, CPSR
     MRS R0, SPSR
     MSR CPSR_CX, R0
     LDMIA SP, {R0-R15}^
     etc.. 

git-svn-id: trunk@22502 -
2012-09-29 08:23:40 +00:00
pierre
934980ec62 Record filepos in TInstruction class, to avoid problems with wrong source lines
in GDB for assembler instructions followed by {$ifdef XXX} lines.

git-svn-id: trunk@22472 -
2012-09-27 15:34:20 +00:00
svenbarth
d87b203a0a Do not call ret_in_param of the current parameter manager when parsing a generic method/function. This fixes Mantis #21921.
* pparautl.pas, insert_funcret_para:
    assume that the result in a generic function/method can not be passed in a param
* pparautl.pas, insert_funcret_local: 
    don't call ret_in_param, but create the symbol as we need a valid funcretsym
* pstatmnt.pas, assembler_block:
    don't modify the framepointer for a generic method/function
* rautils.pas, TOperand.SetupResult:
    don't assume that we can't use the result for a generic function/method

git-svn-id: trunk@21608 -
2012-06-14 12:11:11 +00:00