Rafael Espindola
94a2c5642d
Rename features to match what gcc and clang use.
...
There is no advantage in being different and using the same names simplifies
clang a bit.
llvm-svn: 189141
2013-08-23 20:21:34 +00:00
Jim Cownie
b09bb1ce19
Checking commit access; added one space
...
llvm-svn: 189111
2013-08-23 15:51:37 +00:00
Elena Demikhovsky
c35219e3ee
AVX-512: Added masked SHIFT commands, more encoding tests
...
llvm-svn: 189005
2013-08-22 12:18:28 +00:00
Elena Demikhovsky
33d447a2d6
AVX-512: Added SHIFT instructions.
...
llvm-svn: 188899
2013-08-21 09:36:02 +00:00
Craig Topper
77df9cdd0b
Synchronize VEX JIT encoding code with the MCJIT version. Fix a bug in the MCJIT code where CurOp was being incremented even if the operand it was pointing at wasn't used. Maybe only matters if there are any EVEX_K instructions that aren't VEX_4V.
...
llvm-svn: 188868
2013-08-21 05:57:45 +00:00
Nadav Rotem
7efc04cb40
In LLVM FMA3 operands are dst, src1, src2, src3, however dst is not encoded as it is always src1. This was causing the encoding of the operands to be off by one.
...
Patch by Chris Bieneman.
llvm-svn: 188866
2013-08-21 05:03:10 +00:00
Craig Topper
5c94bb8551
Rename mattr names for AVX-512 to from avx-512 -> avx512f, avx-512-pfi -> av512pf, avx-512-cdi -> avx512cd, avx-512-eri->avx512er. This matches better with official docs and what gcc patches appearto be using. I didn't touch the has* functions or the feature flag names to avoid change the td and lowering file while commits are still happening.
...
llvm-svn: 188859
2013-08-21 03:57:57 +00:00
NAKAMURA Takumi
de8880a23d
X86TargetMachine.cpp: Clarify to emit GOT in i686-{cygming|win32}-elf for mcjit.
...
I suppose all "lli -use-mcjit i686-*" should require GOT, (and to fail.)
llvm-svn: 188856
2013-08-21 02:37:25 +00:00
Elena Demikhovsky
540d582594
AVX-512: Added more patterns for VMOVSS, VMOVSD, VMOVD, VMOVQ
...
llvm-svn: 188786
2013-08-20 11:00:29 +00:00
Craig Topper
7a8cf01090
Fix formatting. No functional change.
...
llvm-svn: 188746
2013-08-20 05:23:59 +00:00
Craig Topper
e13a066c94
Add AVX-512 and related features to the CPUID detection code.
...
llvm-svn: 188745
2013-08-20 05:22:42 +00:00
Craig Topper
fd2b389263
Move AVX and non-AVX replication inside a couple multiclasses to avoid repeating each instruction for both individually.
...
llvm-svn: 188743
2013-08-20 04:24:14 +00:00
Elena Demikhovsky
1490c5eb5b
AVX-512: added arithmetic and logical operations.
...
ADD, SUB, MUL integer and FP types. OR, AND, XOR.
Added embeded broadcast form for these instructions.
llvm-svn: 188673
2013-08-19 13:26:14 +00:00
Elena Demikhovsky
3ce8dbbac2
AVX-512: Added VMOVD, VMOVQ, VMOVSS, VMOVSD instructions.
...
llvm-svn: 188637
2013-08-18 13:08:57 +00:00
Craig Topper
e6861c9ce5
Make more of the lowering helpers static. Also use MVT instead of EVT in a couple places.
...
llvm-svn: 188629
2013-08-18 08:53:01 +00:00
Craig Topper
8c929627d9
Don't use v16i32 for load pattern matching. All 512-bit loads are cated to v8i64.
...
llvm-svn: 188534
2013-08-16 06:07:34 +00:00
Bill Wendling
2851907cdb
Constify the function parameters.
...
llvm-svn: 188469
2013-08-15 18:46:14 +00:00
Craig Topper
8dbc7e9d35
Revert r188449 as it turns out we're just missing the instructions that need the v16i32/v16f32 matching.
...
llvm-svn: 188454
2013-08-15 08:38:25 +00:00
Craig Topper
2ffd06528d
Don't let isPermImmMask handle v16i32 since VPERMI doesn't match on that type. Remove 128-bit vector handling from isPermImmMask too, it's covered by isPSHUFDMask.
...
llvm-svn: 188449
2013-08-15 07:30:51 +00:00
Craig Topper
83e042a21b
Use MVT instead of EVT in X86ISelDAGToDAG since all the types should be legal.
...
llvm-svn: 188446
2013-08-15 05:57:07 +00:00
Craig Topper
6f4dd2dacf
Use MVT in place of EVT in more X86 operation lowering functions.
...
llvm-svn: 188445
2013-08-15 05:33:45 +00:00
Craig Topper
5671010cbb
Replace getValueType().getSimpleVT() with getSimpleValueType(). Also remove one weird cast from MVT->EVT just to call getSimpleVT().
...
llvm-svn: 188441
2013-08-15 02:33:50 +00:00
Craig Topper
d03748cf5e
Make more helper methods into static functions.
...
llvm-svn: 188366
2013-08-14 07:53:41 +00:00
Craig Topper
7b7b159574
Remove tab characters.
...
llvm-svn: 188365
2013-08-14 07:35:18 +00:00
Craig Topper
d905fded68
Make some helper methods static.
...
llvm-svn: 188364
2013-08-14 07:34:43 +00:00
Craig Topper
60769e050d
Use MVT in more lowering code.
...
llvm-svn: 188363
2013-08-14 07:04:42 +00:00
Craig Topper
52b00359b1
Replace EVT with MVT in isVectorShift. Keeps compiler from generating unneeded checks and handling for extended types.
...
llvm-svn: 188362
2013-08-14 06:21:10 +00:00
Craig Topper
67476d7485
Replace EVT with MVT in many of the shuffle lowering functions. Keeps compiler from generating unneeded checks and handling for extended types.
...
llvm-svn: 188361
2013-08-14 05:58:39 +00:00
Evgeniy Stepanov
7dee697faa
Fix compiler warnings.
...
../lib/Target/X86/X86ISelLowering.cpp:9715:7: error: unused variable 'OpVT' [-Werror,-Wunused-variable]
EVT OpVT = Op0.getValueType();
^
../lib/Target/X86/X86ISelLowering.cpp:9763:14: error: unused variable 'NumElems' [-Werror,-Wunused-variable]
unsigned NumElems = VT.getVectorNumElements();
llvm-svn: 188269
2013-08-13 14:04:20 +00:00
Elena Demikhovsky
60b1f289f2
AVX-512: Added CMP and BLEND instructions.
...
Lowering for SETCC.
llvm-svn: 188265
2013-08-13 13:24:07 +00:00
Kevin Enderby
b03f3fe4e8
Fix a crash with X86 Mach-O and a subtraction expression where both symbols are
...
undefined and produce an error message instead as this is a non-relocatable
expression with X86 Mach-O.
rdar://8920876
llvm-svn: 188218
2013-08-12 22:45:44 +00:00
Elena Demikhovsky
5fed3b95db
AVX-512: Added more tests for BROADCAST
...
llvm-svn: 188148
2013-08-11 12:29:16 +00:00
Elena Demikhovsky
cf5b1458e6
AVX-512: Added VPERM* instructons and MOV* zmm-to-zmm instructions.
...
Added a test for shuffles using VPERM.
llvm-svn: 188147
2013-08-11 07:55:09 +00:00
Benjamin Kramer
21585fd9c1
Add a overload to CostTable which allows it to infer the size of the table.
...
Use it to avoid repeating ourselves too often. Also store MVT::SimpleValueType
in the TTI tables so they can be statically initialized, MVT's constructors
create bloated initialization code otherwise.
llvm-svn: 188095
2013-08-09 19:33:32 +00:00
Michael J. Spencer
126973ba93
[Object] Split the ELF interface into 3 parts.
...
* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.
llvm-svn: 188022
2013-08-08 22:27:13 +00:00
Jakub Staszak
9c34922ff2
Use pop_back() instead of pop_back_val() when the returned value is not used.
...
llvm-svn: 187986
2013-08-08 15:48:46 +00:00
Jakub Staszak
b5ab81d5d0
Fix the comment.
...
llvm-svn: 187984
2013-08-08 15:19:25 +00:00
Elena Demikhovsky
45c54ad8dc
AVX-512 set: Added BROADCAST instructions
...
with lowering logic and a test.
llvm-svn: 187884
2013-08-07 12:34:55 +00:00
Craig Topper
c5b0ad27ab
Simplify code. No functional change intended.
...
llvm-svn: 187870
2013-08-07 08:16:07 +00:00
Tim Northover
a4415854db
Refactor isInTailCallPosition handling
...
This change came about primarily because of two issues in the existing code.
Niether of:
define i64 @test1(i64 %val) {
%in = trunc i64 %val to i32
tail call i32 @ret32(i32 returned %in)
ret i64 %val
}
define i64 @test2(i64 %val) {
tail call i32 @ret32(i32 returned undef)
ret i32 42
}
should be tail calls, and the function sameNoopInput is responsible. The main
problem is that it is completely symmetric in the "tail call" and "ret" value,
but in reality different things are allowed on each side.
For these cases:
1. Any truncation should lead to a larger value being generated by "tail call"
than needed by "ret".
2. Undef should only be allowed as a source for ret, not as a result of the
call.
Along the way I noticed that a mismatch between what this function treats as a
valid truncation and what the backends see can lead to invalid calls as well
(see x86-32 test case).
This patch refactors the code so that instead of being based primarily on
values which it recurses into when necessary, it starts by inspecting the type
and considers each fundamental slot that the backend will see in turn. For
example, given a pathological function that returned {{}, {{}, i32, {}}, i32}
we would consider each "real" i32 in turn, and ask if it passes through
unchanged. This is much closer to what the backend sees as a result of
ComputeValueVTs.
Aside from the bug fixes, this eliminates the recursion that's going on and, I
believe, makes the bulk of the code significantly easier to understand. The
trade-off is the nasty iterators needed to find the real types inside a
returned value.
llvm-svn: 187787
2013-08-06 09:12:35 +00:00
Craig Topper
cf969eadaf
Simplify vector lane handling math a bit. No functional change intended.
...
llvm-svn: 187783
2013-08-06 07:23:12 +00:00
Craig Topper
7418ff460c
Simplify math a little bit.
...
llvm-svn: 187781
2013-08-06 06:54:25 +00:00
NAKAMURA Takumi
aaf66c7357
Target/*/CMakeLists.txt: Add the dependency to CommonTableGen explicitly for each corresponding CodeGen.
...
Without explicit dependencies, both per-file action and in-CommonTableGen action could run in parallel.
It races to emit *.inc files simultaneously.
llvm-svn: 187780
2013-08-06 06:38:37 +00:00
Craig Topper
9bc00b65b6
Replace EVT with MVT in isHorizontalBinOp as it is only called with legal types.
...
llvm-svn: 187779
2013-08-06 06:05:05 +00:00
Craig Topper
47d7c5c8fe
Simplify code slightly. No functional change.
...
llvm-svn: 187771
2013-08-06 04:12:40 +00:00
Aaron Ballman
5b4634576e
Silencing an MSVC11 type conversion warning.
...
llvm-svn: 187727
2013-08-05 13:47:03 +00:00
Elena Demikhovsky
40864b690b
AVX-512 set: added mask operations, lowering BUILD_VECTOR for i1 vector types.
...
Added intrinsics and tests.
llvm-svn: 187717
2013-08-05 08:52:21 +00:00
Benjamin Kramer
5bc180c14f
X86: Turn fp selects into mask operations.
...
double test(double a, double b, double c, double d) { return a<b ? c : d; }
before:
_test:
ucomisd %xmm0, %xmm1
ja LBB0_2
movaps %xmm3, %xmm2
LBB0_2:
movaps %xmm2, %xmm0
after:
_test:
cmpltsd %xmm1, %xmm0
andpd %xmm0, %xmm2
andnpd %xmm3, %xmm0
orpd %xmm2, %xmm0
Small speedup on Benchmarks/SmallPT
llvm-svn: 187706
2013-08-04 12:05:16 +00:00
Elena Demikhovsky
cd46691728
AVX-512 set: added VEXTRACTPS instruction
...
llvm-svn: 187705
2013-08-04 10:46:07 +00:00
Tim Northover
ecc018c7b7
X86: correct tail return address calculation
...
Due to the weird and wondeful usual arithmetic conversions, some
calculations involving negative values were getting performed in
uint32_t and then promoted to int64_t, which is really not a good
idea.
Patch by Katsuhiro Ueno.
llvm-svn: 187703
2013-08-04 09:35:57 +00:00