Commit Graph

82 Commits

Author SHA1 Message Date
florian
d6e4af8279 + applied remaining patches of Torsten Grundke: adds gather instructions of avx2
git-svn-id: trunk@29745 -
2015-02-17 21:43:46 +00:00
florian
842e027a9f + prove of concept how FMA4 could be supported in inline assembler
git-svn-id: trunk@27214 -
2014-03-20 21:25:38 +00:00
florian
a79be2b05c + support for FMA instructions in inline assembler
+ extended avx test code with FMA

git-svn-id: trunk@27209 -
2014-03-20 20:06:56 +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
7028210817 + tzcnt assembler instruction
git-svn-id: trunk@26506 -
2014-01-18 12:11:50 +00:00
florian
f132a804d6 + handle 32 bit references on x86-64 so lea can be used for 32 bit arithmetics
git-svn-id: trunk@25909 -
2013-11-01 19:01:39 +00:00
nickysn
0f69362edd - rm LEA reg,imm from x86ins.dat, as that's not a valid x86 instruction,
using it in inline asm causes an internal error and removing it didn't show
  any regressions after running the testsuite on i386-linux.

git-svn-id: trunk@25827 -
2013-10-18 23:26:58 +00:00
nickysn
4aa010eedc + support LEA with 16-bit operand size
git-svn-id: trunk@25808 -
2013-10-17 16:11:08 +00:00
florian
9b6094a58c + added a few BMI instructions to see if they can be encoded
git-svn-id: trunk@24907 -
2013-06-16 09:35:21 +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
fc569e224d * handle all operand combinations of xadd, resolves #21146
git-svn-id: trunk@20177 -
2012-01-25 21:26:59 +00:00
sergei
e11c880b1e x86 assembler improvements:
* Don't generate rex.w for "CALL|JMP|LCALL|LJMP regmem", they are 64-bit by default.
* LCALL,LJMP flagged as calljump instructions.
* LCALL,LJMP encode only far jumps and don't accept register operands.
* GAS writer: fixed writing rip-relative operands of calljump instructions.
+ test.

git-svn-id: trunk@19413 -
2011-10-08 11:34:04 +00:00
florian
c011949765 + iretq for x86_64
git-svn-id: trunk@18273 -
2011-08-19 12:56:26 +00:00
florian
8308b46a94 + support for assembler instructions with four operands
+ support for insertq, resolves #19910

git-svn-id: trunk@18206 -
2011-08-14 16:46:35 +00:00
sergei
0231863fce + Added missing PMULLD instruction, part of Mantis #19910
git-svn-id: trunk@18106 -
2011-08-06 06:59:33 +00:00
sergei
354d0520b7 + x86 assembler: fixed MOVABS instruction (it is a x86_64-only subset of MOV with 8-byte immediates/offsets) and same-form encodings of MOV instruction.
git-svn-id: trunk@17666 -
2011-06-05 17:32:18 +00:00
sergei
d89aeeadaf x86 assembler:
* Adjust rip-relative offsets using values known from calcsize, instead of reinterpreting the tail of instruction. This is simpler and remains the same regardless of particular codes used in opcode table.
* Reduced maxinfolen to 8.
- 'jmp imm64' and 64-bit versions of 'in' do not exist, removed.

git-svn-id: trunk@17546 -
2011-05-23 20:43:50 +00:00
sergei
504e0c6816 x86 assembler fixes:
* mkx86ins.pp: 'regmem' operand type in x86ins.dat must be converted to OT_RM_GPR, not OT_REGMEM. The latter does not restrict register type, allowing to use e.g. xmm registers in place of regular ones. 
* Finished 'movd' and 'movq', added some tests for them to tasm2.pp.

git-svn-id: trunk@17515 -
2011-05-20 20:39:35 +00:00
sergei
1aa5c4ac0e * Fixed wrong ModRM byte in movq encoding, causing regression of test/cg/tcalext6 in r17490.
git-svn-id: trunk@17493 -
2011-05-18 14:55:26 +00:00
sergei
9e8a31193b x86 assembler:
* Optimized the opcode representation of movq and remaining 3DNow instructions
* Disallow immediates not fitting in 32 bits (Mantis #14685) + test
* Disallow push/pop with 32-bit operands in x86_64 + test

git-svn-id: trunk@17490 -
2011-05-17 20:06:12 +00:00
sergei
c28197bac3 * PSADBW second operand is xmmrm, not xmmreg
+ A couple of tests related to the recent assembler changes

git-svn-id: trunk@17460 -
2011-05-14 18:59:06 +00:00
sergei
958954890e A big update of x86 instruction table, part 2:
- Removed remaining address-size control codes \300 and \301
- Also removed codes \323, they are no longer necessary once REX is being written on the first literal.

git-svn-id: trunk@17457 -
2011-05-14 16:36:42 +00:00
sergei
3b979fef6d * Re-commit r17437 after more testing and fixing aasmcpu.pp in r17449.
git-svn-id: trunk@17452 -
2011-05-14 11:04:52 +00:00
sergei
b257231203 * Revert r17437, it breaks builds with -O2 and builds on i386 (although -O- on x86_64 is ok).
git-svn-id: trunk@17439 -
2011-05-12 23:53:18 +00:00
sergei
1d81a1244b A big update of x86 instruction table, part 1 (mostly SIMD instructions):
* Using ot_mmxrm and ot_xmmrm operand types to match arguments, reduces number of required entries by half.
* Replaced all literal $66, $F2 and $F3 prefixes with control codes (\361, \334 and \333, respectively).
* Prefix control codes imply writing REX, so code \323 after them is no longer necessary, removed.
* Fixed technology flags (SSSE3, SSE4.1, SSE4.2)
- Removed codes \300 and \301 (intended to generate address size prefix). FPC does not support this feature (the prefix itself is generated, but process_ea rejects operands needing non-default address size). Probably we don't even need to support it. But if we do, a much simpler solution is check all operands, like today's NASM does.
* Fixed/added some instructions along the way, namely CRC32, UNPCKHPD, CMPNEQSD.

git-svn-id: trunk@17437 -
2011-05-12 19:49:19 +00:00
sergei
de8ae0f873 x86 assembler improvements:
* Simplified REX handling: instead of useless adjusting instruction length on every REX change, adjust it just once, based on the final REX value.
* Similar for omitting REX.W in certain instructions: set a flag and consider it once the entire instruction has been processed. This removes the requirement for \335 to be the last opcode.
* maybewriterex also after $F2 prefix
* Fixed behavior of codes \310 and \311 (16- and 32-bit address respectively), this is needed for a few fancy instructions like LOOP and JCXZ, which honor address-size prefix instead of REX.
+ control code \361 for $66 prefix
+ IF_SSSE3, IF_SSE41, IF_SSE42 instruction flags (with dummy values)

x86/x86ins.dat:
* replaced literal $67 prefixes with \310 or \311
* marked encodings containing code \310 as NOX86_64
* replaced literal $48 prefixes with \326

git-svn-id: trunk@17433 -
2011-05-12 13:09:51 +00:00
sergei
6739cec2b9 * Flagged with NOX86_64 instructions/encodings that are invalid in 64-bit mode.
* AESKEYGENASSIST is not ATT-specific name, it is used by Intel-style assemblers as well. Also updated tests/test/taes1.pp to reflect the change.
+ Added SCASQ, resolves #16730 (other opcodes mentioned in that report were added/fixed earlier)

git-svn-id: trunk@17431 -
2011-05-11 15:50:59 +00:00
sergei
9bb0dc6cfe * mkx86ins.pp: ot_signed flag must not be set by literal opcodes. Ignore 2- and 3-byte literal sequences, not just 1-byte ones.
* x86ins.dat: replaced codes \17 with literal zeros. They aren't necessary for FPC, and they were removed from NASM quite a while ago.

git-svn-id: trunk@17430 -
2011-05-11 12:31:18 +00:00
florian
9279c6955e * support for SSSE3, SSE4,1, SSE4.2, AES instructions set by Emelyanov Roman, resolves #18527
+ test for aes support

git-svn-id: trunk@17256 -
2011-04-05 20:22:57 +00:00
florian
af020e8ebc * fix assembling of ljmp mem, resolves #18556
git-svn-id: trunk@16802 -
2011-01-23 12:18:14 +00:00
florian
d6d3791939 * fix compilation of cmpxchg16b
git-svn-id: trunk@16283 -
2010-11-01 08:13:27 +00:00
Jonas Maebe
9273856e84 * disallow pusha*/popa* for x86_64 (mantis #14862)
* disallow pushfd/popfd for x86_64 (mantis #14862)
  * fixed assembling popfq with the internal assembler (it needs a rex.w
    prefisx, while pushfq doesn't)
  * changed the default opcode size of pushf/popf/pusha/popa in
    {$asmmode intel} from "native size" to 16 bit (compatible with Intel
    manuals and Kylix; in AT&T mode, the default size for those operations
    remains the native one)
  * changed pushf/popf in rtl/i386/* into pushfd/popfd because of the
    previous change

git-svn-id: trunk@15546 -
2010-07-10 16:22:46 +00:00
Jonas Maebe
d3976c858b * fixed 64 bit check for "movd xmmreg, mem" and "movd mem, xmmreg" (patch by
Jasper Neumann, mantis #13294)
  * moved "reg64, xmmreg" and "xmmreg, reg64" combo's from movd to movq
    (movd is always 32 bit)

git-svn-id: trunk@15538 -
2010-07-09 21:16:48 +00:00
florian
694f563079 * fixed assembler tables for sse4 instructions, resolves #13186
git-svn-id: trunk@12787 -
2009-02-24 20:07:11 +00:00
florian
49195b0ac0 * fixes assembling of mov ax,<mem16>
* fixes assembling of test <mem8>,reg8; resolves #11786

git-svn-id: trunk@12040 -
2008-11-09 10:24:59 +00:00
florian
965bb41288 * fixed more rex placements
git-svn-id: trunk@9069 -
2007-11-02 21:30:43 +00:00
florian
82c7896d8d * more ins. dat issues popped up, did I mention I start to hate it :(?
git-svn-id: trunk@8968 -
2007-10-28 14:08:04 +00:00
florian
c1d62172fe * the saga continues, fixed previously broken assembler table entries
git-svn-id: trunk@8967 -
2007-10-28 13:01:58 +00:00
florian
f32831c44a * fixed assembling of fisttp of sse3 instruction set
+ sse3 optimized trunc() using fisttp
+ -Cfsse3 for x86-64

git-svn-id: trunk@8962 -
2007-10-27 20:50:46 +00:00
florian
46e1587395 * another bunch of assembler fixes, win64 builds again
git-svn-id: trunk@8957 -
2007-10-27 19:49:53 +00:00
florian
8f5a4cc514 * more, hopefully correct, x86-64 assembler fixes
git-svn-id: trunk@8952 -
2007-10-26 20:44:57 +00:00
florian
c5f492ef50 * fixed assembling of movq mem,xmmreg
git-svn-id: trunk@8923 -
2007-10-24 20:45:38 +00:00
peter
43c2694d50 * fixed REX placement for xmm opcodes
git-svn-id: trunk@8850 -
2007-10-18 23:30:35 +00:00
florian
bb314e5456 * regenerated
git-svn-id: trunk@8788 -
2007-10-14 09:32:15 +00:00
florian
5d31cd02a7 * regenerated
git-svn-id: trunk@8786 -
2007-10-14 09:04:56 +00:00
florian
342ba323cf * fixed assembling of cvtsi2ss with rex
git-svn-id: trunk@8777 -
2007-10-13 14:53:27 +00:00
Jonas Maebe
a8191abd16 * fixed parsing of "rcl/rcr rm,imm" (mantis #9025)
git-svn-id: trunk@8272 -
2007-08-12 13:50:52 +00:00
florian
447276c5bb * Jcc reads the flags, this was not in the dat yet, resolves #9278
* disabled 4 ops variant of insertq for now

git-svn-id: trunk@8133 -
2007-07-22 16:40:44 +00:00
daniel
62b6fcead8 * Fix operator count.
git-svn-id: trunk@7835 -
2007-06-27 20:31:58 +00:00
florian
0e96eda236 + some sse4 instructions supported, resolves #9046
git-svn-id: trunk@7613 -
2007-06-09 19:45:06 +00:00