Commit Graph

67 Commits

Author SHA1 Message Date
nickysn
21c9712ea2 * allow 32-bit operand sizes in the i8086 version of Tx86Operand.SetSize, so
32-bit operands can work properly in i8086's inline asm. Fixes mantis #29188.

git-svn-id: trunk@32866 -
2016-01-06 18:06:34 +00:00
nickysn
3b80ca4376 + implemented the 'SEG @CODE' inline assembler directive for i8086
git-svn-id: trunk@32281 -
2015-11-10 18:02:10 +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
nickysn
43dabca8ab * moved the handling of the @Code and @Data inline assembler symbols to new methods Tx86operand.SetupCode and .SetupData
git-svn-id: trunk@32279 -
2015-11-10 14:04:40 +00:00
nickysn
910003848c * fixed code generation of indirect far calls and jumps on the i8086 from the
inline assembler

git-svn-id: trunk@31946 -
2015-10-05 02:19:32 +00:00
nickysn
e9c790f4eb + support 'SEG' in the i8086 inline assembler
git-svn-id: trunk@31428 -
2015-08-26 15:57:44 +00:00
nickysn
5c8965fea5 * in the inline asm reader, treat [var] reference as "word" instead of "dword"
when "var" is of dword size. This fixes spurious generation of a $66 prefix
  and makes the code consistent with what Tx86Operand.SetSize does (and what is
  then used for checking the operand sizes of all operands of the instruction in
  Tx86Instruction.CheckOperandSizes).

git-svn-id: trunk@30629 -
2015-04-17 19:58:06 +00:00
nickysn
3b5395e0e3 * set 16-bit opsize for OPR_SYMBOL operands on i8086
git-svn-id: trunk@30626 -
2015-04-17 19:10:13 +00:00
nickysn
c3515f743f * generate 16-bit (instead of 32-bit) instructions for push/pop of a segment
register in an inline asm block on i8086

git-svn-id: trunk@30616 -
2015-04-17 00:51:00 +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
5c8ae259c4 * handle GOT-relative loads in the assembler reader as reads of
sizeof(pint) bytes (mantis 23109)

git-svn-id: trunk@28789 -
2014-10-08 18:38:06 +00:00
florian
aa107b914c * merged avx2 branch, developed by Torsten Grundke
git-svn-id: trunk@27200 -
2014-03-20 12:03:52 +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
yury
8ae7c5784c * Sync with trunk r23500.
git-svn-id: branches/targetandroid@23501 -
2013-01-23 07:53:13 +00:00
yury
0960ee2034 * Add missing checks for android target.
git-svn-id: branches/targetandroid@23477 -
2013-01-21 12:08:25 +00:00
paul
5d74e0578a compiler: remove unused variables and unneeded assignments
git-svn-id: trunk@23467 -
2013-01-21 01:24:36 +00:00
Jonas Maebe
d180d6f241 * fixed size of movzx/movsx with 64bit operand in x86-64 Intel asm reader
git-svn-id: trunk@23131 -
2012-12-09 22:42:52 +00:00
florian
a499a30ca9 * fixes to avx support by Torsten Grundke
git-svn-id: trunk@22773 -
2012-10-19 16:45:53 +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
pierre
0a755be6fe * Fix assembler fileinfo position for x86 readers
git-svn-id: trunk@22501 -
2012-09-28 22:26:41 +00:00
Jonas Maebe
4d0e4e1b56 * treat "[var + rip]" in intel assembler mode as addr_pic_no_got on x86-64
(mantis #22665)
  + support "[var wrt ..gotpcrel]" nasm/yasm syntax in intel assembler mode
    for GOT-relative accesses on x86-64, + give an error when trying to do
    this on win64 (it doesn't have a GOT)
  * moved code that give a warning when using GOT-relative accesses to
    static data on x86-64 from the AT&T reader to rax86 so it's also
    active for the Intel assembler reader
  + added warning when not using GOT-relative accesses (but plain
    RIP-relative instead) to global data on non-Win64 x86-64

git-svn-id: trunk@22243 -
2012-08-25 15:12:49 +00:00
sergei
08e895cf7c * Fixed handling of 'movq' instruction by assembler reader, resolves #18205.
git-svn-id: trunk@17497 -
2011-05-19 06:44:24 +00:00
sergei
1bcc41c8c6 * x86 assembler reader: fixed bug in Tx86Instruction.AddReferenceSizes which was causing "Unable to determine operand size" error on instructions like "cmpss $0x10,(%rax),%xmm7" (3-operand instructions with reference being the source operand).
git-svn-id: trunk@17370 -
2011-04-25 21:35:36 +00:00
florian
e7fa076b70 * handle variables without explicit size prefix better in inline assembler, resolves #18009
git-svn-id: trunk@16859 -
2011-01-30 21:57:30 +00:00
Jonas Maebe
709f1e8344 * also recognise non-GOT based RIP-relative address expressions as PIC
git-svn-id: trunk@16565 -
2010-12-15 13:39:27 +00:00
pierre
f23695cf92 * Also declare GOT in main program
git-svn-id: trunk@16103 -
2010-10-07 22:14:58 +00:00
florian
9affb070b8 * don't force OT_BITS32 on x86-64, resolves #16622
git-svn-id: trunk@15595 -
2010-07-17 20:57:06 +00:00
florian
53ffda14f3 * fixes taking the address of an assembler block defined label
* create short jumps also for asm blocks, thanks to Sergej Gorelkin for the patch, resolves #11638

git-svn-id: trunk@12043 -
2008-11-09 21:14:45 +00:00
Jonas Maebe
18eb495d0f * give a regular error message instead of an internal error on x86
when using non-PIC references in assembler code when the compiler
    is configured to generate PIC code (on ppc, sparc and arm, no
    error message is given at all currently)

git-svn-id: trunk@9364 -
2007-12-01 11:28:15 +00:00
Jonas Maebe
8bcb6e689d * only check validity of assembler instructions in pass_2, after all
local operands have been resolved (mantis #8950)

git-svn-id: trunk@7516 -
2007-05-29 16:53:28 +00:00
pierre
f07349a774 * force S_IQ size for movq instruction, needed for nasm
git-svn-id: trunk@6835 -
2007-03-13 23:17:09 +00:00
pierre
fc66d46beb + added several warnings about use of references
involving (%ebp) or (%esp) in assembler code.
   Useful to track code that might suffer from regcall
   convention.

git-svn-id: trunk@5736 -
2006-12-29 09:37:15 +00:00
florian
85d63d9fa9 * settings refactored
git-svn-id: trunk@5094 -
2006-10-30 18:02:58 +00:00
peter
5de217f04c * movzx reference size fallback to byte for delphi mode
git-svn-id: trunk@4768 -
2006-10-02 17:33:52 +00:00
florian
4c9a08b12b * more x86_64 assembler support, rtl compilation works, executables don't work yet
git-svn-id: trunk@3038 -
2006-03-26 09:38:05 +00:00
peter
b7fe6797bf Merged revisions 2921-2922,2925 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2921 | peter | 2006-03-15 08:35:00 +0100 (Wed, 15 Mar 2006) | 2 lines

  * pass ObjectWriter to ObjectOuput

........
r2922 | peter | 2006-03-15 12:40:30 +0100 (Wed, 15 Mar 2006) | 2 lines

  * refactor asmdata

........
r2925 | peter | 2006-03-15 16:09:39 +0100 (Wed, 15 Mar 2006) | 3 lines

  * add cfi to asmdata
  * move asmlist, asmcfi, asmdata to own unit

........

git-svn-id: trunk@2932 -
2006-03-16 08:52:22 +00:00
peter
eb725d4e44 Merged revisions 2908,2911,2913-2917 via svnmerge from
http://svn.freepascal.org/svn/fpc/branches/linker/compiler

........
r2908 | peter | 2006-03-13 13:35:48 +0100 (Mon, 13 Mar 2006) | 2 lines

  * merge trunk upto r2907

........
r2911 | peter | 2006-03-13 18:08:00 +0100 (Mon, 13 Mar 2006) | 2 lines

  * rename values to make room for operand size codes

........
........
........
r2915 | peter | 2006-03-14 13:51:35 +0100 (Tue, 14 Mar 2006) | 2 lines

  * check aktcputype

........
r2916 | peter | 2006-03-14 15:06:32 +0100 (Tue, 14 Mar 2006) | 3 lines

  * merge 300 opcodes
  * more 64bit versions of opcodes

........
r2917 | peter | 2006-03-14 17:34:03 +0100 (Tue, 14 Mar 2006) | 3 lines

  * x86_64 tables
  * convert movq with normal registers to mov

........

git-svn-id: trunk@2931 -
2006-03-16 08:09:28 +00:00
peter
fdc4925fcd * basic framework for debuginfo class added
git-svn-id: trunk@1084 -
2005-09-15 08:34:51 +00:00
daniel
338d4fbe99 * Fix two issues with internal assembler
git-svn-id: trunk@614 -
2005-07-10 18:10:21 +00:00
daniel
3f03e67e48 * Jcc now also doesn't need operand size
git-svn-id: trunk@612 -
2005-07-10 14:07:27 +00:00
daniel
51e0368aa5 * Improve automatic adding of operand size.
git-svn-id: trunk@611 -
2005-07-10 14:03:35 +00:00
daniel
86da715b86 * Internal assembler refuses instructions with constant operand but
without opsize.
  * Opsize added for int,ret,push by assembler reader if not specified
    by programmer.

git-svn-id: trunk@608 -
2005-07-10 09:55:59 +00:00
daniel
45bcc5b07a * Add support for jmp $0011:$22334455 to Intel asm reader, request from
a user that is writing an operating system.
  * Fix mkx86ins bug to interpret imm16:imm32 as a single operand

git-svn-id: trunk@606 -
2005-07-10 07:42:14 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
peter
79eac1c0b3 * fix [regpara] in intel assembler 2005-01-31 17:07:50 +00:00
peter
c95a859f0a * generic tlocation
* move tlocation to cgutils
2004-10-31 21:45:02 +00:00
florian
8a9758c5e2 * logs truncated 2004-06-20 08:55:28 +00:00
florian
588e2c38bf * dwarf branch merged 2004-06-16 20:07:06 +00:00