Commit Graph

26 Commits

Author SHA1 Message Date
Craig Topper b3f7cdc3d9 [X86] Update handling in CGBuiltin to be tolerant of out of range immediates.
D48464 contains changes that will loosen some of the range checks in SemaChecking to a DefaultError warning that can be disabled.

This patch adds explicit masking to avoid using the upper bits of immediates to gracefully handle the warning being disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335308 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21 23:39:47 +00:00
Craig Topper 26b20caa52 [X86] Add builtins for vector element insert and extract for different 128 and 256 bit vector types. Use them to implement the extract and insert intrinsics.
Previously we were just using extended vector operations in the header file.

This unfortunately allowed non-constant indices to be used with the intrinsics. This is incompatible with gcc, icc, and MSVC. It also introduces a different performance characteristic because non-constant index gets lowered to a vector store and an element sized load.

By adding the builtins we can check for the index to be a constant and ensure its in range of the vector element count.

User code still has the option to use extended vector operations themselves if they need non-constant indexing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334057 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 00:24:55 +00:00
Elad Cohen 1574e4336f [X86] Remove the mm_malloc.h include guard hack from the X86 builtins tests
The X86 clang/test/CodeGen/*builtins.c tests define the mm_malloc.h include
guard as a hack for avoiding its inclusion (mm_malloc.h requires a hosted
environment since it expects stdlib.h to be available - which is not the case
in these internal clang codegen tests).
This patch removes this hack and instead passes -ffreestanding to clang cc1.

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282581 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 11:59:09 +00:00
Reid Kleckner 648689ca82 In vector comparisons, handle scalar LHS just as we handle scalar RHS
Summary: Fixes PR27258

Reviewers: rsmith

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14 21:03:38 +00:00
Douglas Katzman adbb8c2aef Stop messing with the 'g' group of options in CompilerInvocation.
With this change, most 'g' options are rejected by CompilerInvocation.
They remain only as Driver options. The new way to request debug info
from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}"
and "-dwarf-version={2|3|4}". In the absence of a command-line option
to specify Dwarf version, the Toolchain decides it, rather than placing
Toolchain-specific logic in CompilerInvocation.

Also fix a bug in the Windows compatibility argument parsing
in which the "rightmost argument wins" principle failed.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-08 04:24:12 +00:00
Eli Friedman 860c518c99 Fix return type of _mm_extract_epi8 etc.
PR17300.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191120 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 00:05:25 +00:00
Bill Wendling 80d56a9956 Linux still needs these hacks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 00:12:59 +00:00
Bill Wendling da7700e818 Now that mm_malloc.h was rewritten to *not* include errno.h (see
http://llvm.org/viewvc/llvm-project?rev=116771&view=rev) we can get rid of these
hacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116853 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 20:08:12 +00:00
Benjamin Kramer 1e33f4fd37 Avoid including mm_malloc.h in a cc1 test, it pulls in system headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-21 13:39:38 +00:00
Chris Lattner d6b84b9455 fix some vector extractions to return properly zero extended values
(instead of sign extending) to match ICC.  GCC is changing this in 
a series of their own PRs (e.g. 41323).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20 16:08:33 +00:00
Daniel Dunbar 38b48afd33 clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-18 06:30:12 +00:00
Daniel Dunbar a5728872c7 Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-15 20:14:24 +00:00
Daniel Dunbar a31100e62f Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20 22:21:52 +00:00
Chris Lattner d0772882bc daniel really wants this in the testsuite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 20:37:18 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Eli Friedman 61d004a12e PR4339: make sure to properly extend/trunc the index of a vector element
insert/extract; the relevant instructions are defined to take only an 
i32.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-06 19:09:26 +00:00
Eli Friedman 3ded2006e6 Fix silly mistake in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 03:14:28 +00:00
Eli Friedman daa24a29f8 Misc small fixes/cleanups/comment changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-28 02:45:41 +00:00
Daniel Dunbar d7d5f0223b Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24 02:24:46 +00:00
Douglas Gregor b574e5630d Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 22:26:29 +00:00
Chris Lattner c8e9cd6e32 eliminate some random .ll file outputs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 18:56:08 +00:00
Daniel Dunbar 2d6ca8d0f6 Update a number of CodeGen tests to not create .ll files in the test
directory.
 - Removed .ll from the svn:ignore lists to try and prevent this.
 - Added svn:ignore on test/Misc/Output


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55104 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 02:51:29 +00:00
Eli Friedman cfb313bd56 Fix constant vector init for initializer lists with an incomplete list
of elements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51769 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 12:02:14 +00:00
Anders Carlsson 4f45b465b0 Add RUN line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 04:49:12 +00:00
Anders Carlsson 2cec15fc2f Add trailing newline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01 23:27:51 +00:00
Anders Carlsson 79b67f351f Only OCU vectors can be splatted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-01 23:17:55 +00:00