Commit Graph

580 Commits

Author SHA1 Message Date
Rafael Espindola
641f2e122b Fix PR33625.
We were failing to convert this expression to pcrel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306573 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-28 17:56:07 +00:00
Coby Tayree
dd03b34042 [X86][AsmParser][MS-compatability] Binary/Unary operators enhancements
Introducing MOD binary operator
https://msdn.microsoft.com/en-us/library/hha180wt.aspx

Enhancing unary operators NEG and NOT, to support more complex patterns

Differential Revision: https://reviews.llvm.org/D33876


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-27 16:58:27 +00:00
Rafael Espindola
6f1c76b0b9 Add a common error checking for some invalid expressions.
This refactors a bit of duplicated code and fixes an assertion failure
on ELF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-22 17:25:35 +00:00
Andrew V. Tischenko
ff777b7559 The fix for PR22004: X86AsmParser.cpp asserts: OperandStack.size() > 1 && "Too few operands."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-26 13:23:34 +00:00
Oren Ben Simhon
f3cb5d6f7f [X86] Adding vpopcntd and vpopcntq instructions
AVX512_VPOPCNTDQ is a new feature set that was published by Intel.
The patch represents the LLVM side of the addition of two new intrinsic based instructions (vpopcntd and vpopcntq).

Differential Revision: https://reviews.llvm.org/D33169



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 13:45:23 +00:00
Simon Pilgrim
9226f72364 [X86][LWP] Add llvm support for LWP instructions (reapplied).
This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

Reapplied - this time without changing line endings of existing files.

Differential Revision: https://reviews.llvm.org/D32769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 15:51:39 +00:00
Simon Pilgrim
dad8f545ae Revert rL302028 due to accidental line ending changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 15:42:29 +00:00
Simon Pilgrim
0766da9258 [X86][LWP] Add llvm support for LWP instructions.
This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

Differential Revision: https://reviews.llvm.org/D32769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 15:18:34 +00:00
Andrew V. Tischenko
9ec7e0297d 2 tests that were lost in rL301390
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 10:20:35 +00:00
Ayman Musa
1ebb1b7a38 [X86][SSE2] Fix asm string for movq (Move Quadword) instruction.
Replace "mov{d|q}" with "movq".

Differential Revision: https://reviews.llvm.org/D32220



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 07:08:44 +00:00
Coby Tayree
7c1642caaf [X86][MS-compatability]Allow named synonymous for MS-assembly operators
This patch enhances X86AsmParser's immediate expression parsing abilities, to include a named synonymous for selected binary/unary bitwise operators: {and,shl,shr,or,xor,not}, ultimately achieving better MS-compatability
MASM reference:
https://msdn.microsoft.com/en-us/library/94b6khh4.aspx

Differential Revision: D31277



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 14:43:23 +00:00
David Blaikie
bd97f5e153 Check that line table entries don't spill over between sections even if they're empty at the end of a section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 00:52:18 +00:00
Craig Topper
4b9bffa31e [X86] Clzero intrinsic and its addition under znver1
This patch does the following.

1. Adds an Intrinsic int_x86_clzero which works with __builtin_ia32_clzero
2. Identifies clzero feature using cpuid info. (Function:8000_0008, Checks if EBX[0]=1)
3. Adds the clzero feature under znver1 architecture.
4. The custom inserter is added in Lowering.
5. A testcase is added to check the intrinsic.
6. The clzero instruction is added to assembler test.

Patch by Ganesh Gopalasubramanian with a couple formatting tweaks, a disassembler test, and using update_llc_test.py from me.

Differential revision: https://reviews.llvm.org/D29385

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 04:27:34 +00:00
Craig Topper
c9ff831ead [X86] Remove PCOMMIT instruction support since Intel has deprecated this instruction with no plans to release products with it.
Intel's documentation for the deprecation https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294405 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-08 05:45:39 +00:00
Craig Topper
7fa46d07d9 [X86] Fix printing of sha256rnds2 to include the implicit %xmm0 argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294132 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 18:33:31 +00:00
Craig Topper
cc54be0676 [X86] Fix printing of blendvpd/blendvps/pblendvb to include the implicit %xmm0 argument. This makes codegen output more obvious about the %xmm0 usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 18:33:24 +00:00
Peter Collingbourne
043d1a96c9 MC: Introduce the ABS8 symbol modifier.
@ABS8 can be applied to symbols which appear as immediate operands to
instructions that have a 8-bit immediate form for that operand. It causes
the assembler to use the 8-bit form and an 8-bit relocation (e.g. R_386_8
or R_X86_64_8) for the symbol.

Differential Revision: https://reviews.llvm.org/D28688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 18:28:44 +00:00
Eli Friedman
b643b21e99 Fix line endings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293554 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 22:04:23 +00:00
Chris Ray
47870eea3d [X86][Disassembler] Added SALC instruction
Reviewers: joe.abbey, craig.topper

Reviewed By: craig.topper

Subscribers: majnemer, llvm-commits

Differential Revision: https://reviews.llvm.org/D29201

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29 23:02:47 +00:00
Chris Ray
8a25ec8fd0 [X86] Adding FFREEP instruction.
Summary: Small change to get the FREEP instruction to decode properly.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29193

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293314 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 18:02:53 +00:00
Coby Tayree
4cfd2ebb6d [X86]Enable the use of 'mov' with a 64bit GPR and a large immediate
Enable the next form (intel style):
"mov <reg64>, <largeImm>"
which is should be available,
where <largeImm> stands for immediates which exceed the range of a singed 32bit integer

Differential Revision: https://reviews.llvm.org/D28988



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293030 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 07:09:42 +00:00
Marina Yatsina
be4bc8908b [X86] Fix for bugzilla 31576 - add support for "data32" instruction prefix
This patch fixes bugzilla 31576 (https://llvm.org/bugs/show_bug.cgi?id=31576).

"data32" instruction prefix was not defined in the llvm.
An exception had to be added to the X86 tablegen and AsmPrinter because both "data16" and "data32" are encoded to 0x66 (but in different modes).

Differential Revision: https://reviews.llvm.org/D28468



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 08:07:51 +00:00
Craig Topper
ead90cd47c [AVX-512] Add more gather/scatter encoding test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:58:20 +00:00
Craig Topper
00915333a9 [AVX-512] Correct memory operand size for VPGATHERQPS and VPGATHERQD
with ZMM index. Similar for SCATTER and the prefetch gather and scatter
instructions.

Fixes PR31618.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 00:55:58 +00:00
Ayman Musa
64a0af2928 [X86][AVX2] Passing the appropriate memory operand class to VPMADDWD instruction.
Replacing the memory operand in the ymm version of VPMADDWD from i128mem to i256mem.

Differential Revision: https://reviews.llvm.org/D28024



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-22 08:42:46 +00:00
Michael Zuckerman
1a2b5e0641 [X86] [AVX512] Minor fix in encoding of scalar EVEX instructions. NFC.
Commit on behalf of Gadi Haber  

Removed EVEX_V512 prefix from scalar EVEX instructions since HW ignores L'L bits anyway (LIG). 4 instructions are modified.
The changed encodings are validated with XED.
Rviewers: delena, igorb

Differential revision: https://reviews.llvm.org/D27802


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-18 14:29:00 +00:00
Asaf Badouh
400d54c239 [LMT] Restrict nop length to one
not all lakemont MCU support long nop.
we can't assume we can generate long nop by default for MCU.

Differential Revision: https://reviews.llvm.org/D26895

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-01 15:19:10 +00:00
Coby Tayree
bbc769fbf0 small fixup which enables the issuing of the aforementioned instruction (w/o operands), on MS/Intel syntax.
Differential Revision: https://reviews.llvm.org/D26913



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 15:50:56 +00:00
Coby Tayree
57e555600b The 'vpmultishiftqb' instruction was implemented falsely, this patch amend it.
More specifically - (MS dialect) broadcasting variants were implemented falsely.

Differential Revision: https://reviews.llvm.org/D26257



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 17:19:55 +00:00
Coby Tayree
89ba3f29a1 Some instructions were missing, other implemented falsely. this patch aims at amending those issues. full list:
vcvtps2pd
vcvtudq2pd
vcvtps2qq
vcvttps2qq
vcvtps2uqq
vcvttps2uqq

variants are:

[Dst]XMM(zero-masked/merge-masked/unmasked)
[Src]Mem64

Differential Revision: https://reviews.llvm.org/D26799



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 17:09:56 +00:00
Craig Topper
c41a51e935 [AVX-512] Add suffixless aliases for EVEX encoded vcvtsi2ss/vcvtsi2sd/vcvtusi2ss/vcvtusi2sd. This matches the VEX behavior.
Fixes another problem from PR28850.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 02:46:58 +00:00
Craig Topper
460a780d4f [X86] Cleanup 'x' and 'y' mnemonic suffixes for vcvtpd2dq/vcvttpd2dq/vcvtpd2ps and similar instructions.
-Don't print the 'x' suffix for the 128-bit reg/mem VEX encoded instructions in Intel syntax. This is consistent with the EVEX versions.
-Don't print the 'y' suffix for the 256-bit reg/reg VEX encoded instructions in Intel or AT&T syntax. This is consistent with the EVEX versions.
-Allow the 'x' and 'y' suffixes to be used for the reg/mem forms when we're assembling using Intel syntax.
-Allow the 'x' and 'y' suffixes on the reg/reg EVEX encoded instructions in Intel or AT&T syntax. This is consistent with what VEX was already allowing.

This should fix at least some of PR28850.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 01:53:29 +00:00
Peter Collingbourne
f43c9c6d35 X86: Allow expressions to appear as u8imm operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284688 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 01:58:34 +00:00
Michael Zuckerman
d5f902eb11 [x86][inline-asm][avx512] allow swapping of '{k<num>}' & '{z}' marks
Committing on behalf of Coby Tayree: After check-all and LGTM

Desc:

AVX512 allows dest operand to be followed by an op-mask register specifier ('{k<num>}', which in turn may be followed by a merging/zeroing specifier ('{z}')
 Currently, the following forms are allowed:
 {k<num>}
 {k<num>}{z}

This patch allows the following forms:
 {z}{k<num>}

and ignores the next form:
 {z}

Justification would be quite simple - GCC

Differential Revision: http://reviews.llvm.org/D25013



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 13:52:39 +00:00
Nirav Dave
c8f9ada8c6 [X86] Fix intel syntax push parsing bug
Change erroneous parsing of push immediate instructions in intel syntax
to default to pointer size by rewriting into the ATT style for matching.

This fixes PR22028.

Reviewers: majnemer, rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:28:08 +00:00
Douglas Katzman
8bebbdc0d0 [X86] Don't randomly encode %rip where illegal
Differential Revision: https://reviews.llvm.org/D25112

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 15:23:35 +00:00
Douglas Katzman
471e2909de [X86] Fix some tests that didn't assert anything
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 14:46:14 +00:00
Marina Yatsina
e9067af1d9 [x86] Accept 'retn' as an alias to 'ret[lqw]'\'ret' (At&t\Intel)
Implement 'retn' simply by aliasing it to the relevant 'ret' instruction

Commit on behalf of coby

Differential Revision: https://reviews.llvm.org/D24346



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 15:52:56 +00:00
Nirav Dave
134d28b393 Add support for Code16GCC
[X86] The .code16gcc directive parses X86 assembly input in 32-bit mode and
outputs in 16-bit mode. Teach parser to switch modes appropriately.

Reviewers: dwmw2, craig.topper

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 19:33:36 +00:00
Saleem Abdulrasool
6530b2f3a0 X86: loosen an overly aggressive MachO assertion
We would assert that the FP setup CFI used esp/rsp always.  This held up in
practice when the code was generated from IR.  However, with the integrated
assembler, it is possible to have the input be user specified assembly.  In such
a case, we cannot assume that the function implementation has a compact unwind
representation.  Loosen the assertion into a check and bail if we cannot
represent the frame pointer in the compact unwinding.

Addresses PR30453!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 17:05:04 +00:00
Craig Topper
8b5392fd41 [X86] Don't allow DR8-DR15 to be assembled in 32-bit mode. Add missing test for CR8-CR15.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-27 17:13:34 +00:00
Nirav Dave
cf83621dcd [X86] Improve code size on X86 segment moves
Moves of a value to a segment register from a 16-bit register is
equivalent to one from it's corresponding 32-bit register. Match gas's
behavior and rewrite instructions to the shorter of equivalent forms.

Reviewers: rnk, ab

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D23166

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 18:01:04 +00:00
Igor Breger
48f2d1dea0 [AVX512] Add aliases for vcvttss2si{l|q}, vcvttsd2si{l|q}, vcvttss2usi{l|q}, vcvttsd2usi{l|q} instructions.
Differential Revision: http://reviews.llvm.org/D23111

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 10:58:05 +00:00
Nirav Dave
c37e7b92f8 [MC] Fix Intel Operand assembly parsing for .set ids
Recommitting after fixing overaggressive fastpath return in parsing.

Fix intel syntax special case identifier operands that refer to a constant
(e.g. .set <ID> n) to be interpreted as immediate not memory in parsing.

Associated commit to fix clang test commited shortly.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22585

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 17:56:03 +00:00
Hans Wennborg
0e6a15a292 Revert r276895 "[MC][X86] Fix Intel Operand assembly parsing for .set ids"
This caused PR28805. Adding a regression test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 23:00:01 +00:00
Nirav Dave
27b2476a1f [MC][X86] Fix Intel Operand assembly parsing for .set ids
Fix intel syntax special case identifier operands that refer to a constant
(e.g. .set <ID> n) to be interpreted as immediate not memory in parsing.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22585

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-27 17:39:41 +00:00
Davide Italiano
e20e4c151f [MC] Don't crash when trying to emit a relocation against .bss.
Turn that into an error instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 18:16:33 +00:00
Nirav Dave
99b3da61b0 [X86][MC] Fix bracket expression parsing in intel-style assembly.
Only perform struct field check on Identifier tokens.

Fixes PR28547.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22361

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 17:37:05 +00:00
Ahmed Bougacha
6a16f1b7e6 [X86] Decode MPX BND registers.
We were able to assemble, but not disassemble.

Note that fixupRMValue was truncating EA_REG_BND0-3 because we hit
the uint8_t max.  The control registers were already squarely above
it, but I don't think they ever go in .r/m, only in .reg.

I also did notice an extra REX.W in our encoding, but I think that's
fine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-14 14:53:21 +00:00
Nirav Dave
6b00c9f9a9 Fix branch relaxation in 16-bit mode.
Thread through MCSubtargetInfo to relaxInstruction function allowing relaxation
to generate jumps with 16-bit sized immediates in 16-bit mode.

This fixes PR22097.

Reviewers: dwmw2, tstellarAMD, craig.topper, jyknight

Subscribers: jfb, arsenm, jyknight, llvm-commits, dsanders

Differential Revision: http://reviews.llvm.org/D20830

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-11 14:23:53 +00:00