summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/builtins-x86.c
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Require last argument to LWPINS/LWPVAL builtins to be an ICE. Add ↵Craig Topper2019-09-221-0/+16
| | | | | | | | ImmArg to the llvm intrinsics. Update the isel patterns to use timm instead of imm. llvm-svn: 372534
* Fix reliance on lax vector conversions in tests for x86 intrinsics.Richard Smith2019-09-171-1/+1
| | | | llvm-svn: 372062
* [X86] Allow _MM_FROUND_CUR_DIRECTION and _MM_FROUND_NO_EXC to be used ↵Craig Topper2019-09-091-0/+13
| | | | | | | | | | together on instructions that only support SAE and not embedded rounding. Current for SAE instructions we only allow _MM_FROUND_CUR_DIRECTION(bit 2) or _MM_FROUND_NO_EXC(bit 3) to be used as the immediate passed to the inrinsics. But these instructions don't perform rounding so _MM_FROUND_CUR_DIRECTION is just sort of a default placeholder when you don't want to suppress exceptions. Using _MM_FROUND_NO_EXC by itself is really bit equivalent to (_MM_FROUND_NO_EXC | _MM_FROUND_TO_NEAREST_INT) since _MM_FROUND_TO_NEAREST_INT is 0. Since we aren't rounding on these instructions we should also accept (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC) as equivalent to (_MM_FROUND_NO_EXC). icc allows this, but gcc does not. Differential Revision: https://reviews.llvm.org/D67289 llvm-svn: 371430
* [X86] Fix the Sema checks for getmant builtins to only allow 4 and 8 for ↵Craig Topper2019-05-281-0/+8
| | | | | | | | | rounding immediates. These don't support embedded rounding so we shouldn't be setting HasRC. That way we only allow current direction and suppress all exceptions. llvm-svn: 361897
* [x86] Teach the builtin argument range check to allow invalid ranges inChandler Carruth2018-06-211-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dead code. This is important for C++ templates that essentially compute the valid input in a way that is constant and will cause all the invalid cases to be dead code that is deleted. Code in the wild actually does this and GCC also accepts these kinds of patterns so it is important to support it. To make this work, we provide a non-error path to diagnose these issues, and use a default-error warning instead. This keeps the relatively strict handling but prevents nastiness like SFINAE on these errors. It also allows us to safely use the system to diagnose this only when it occurs at runtime (in emitted code). Entertainingly, this required fixing the syntax in various other ways for the x86 test because we never bothered to diagnose that the returns were invalid. Since debugging these compile failures was super confusing, I've also improved the diagnostic to actually say what the value was. Most of the checks I've made ignore this to simplify maintenance, but I've checked it in a few places to make sure the diagnsotic is working. Depends on D48462. Without that, we might actually crash some part of the compiler after bypassing the error here. Thanks to Richard, Ben Kramer, and especially Craig Topper for all the help here. Differential Revision: https://reviews.llvm.org/D48464 llvm-svn: 335309
* [X86] Remove masking from avx512vbmi2 concat and shift by immediate ↵Craig Topper2018-06-131-36/+36
| | | | | | builtins. Use select builtins instead. llvm-svn: 334577
* [X86] Make __builtin_ia32_readeflags_u32 and __builtin_ia32_writeeflags_u32 ↵Craig Topper2018-04-261-0/+5
| | | | | | | | | | | | only available on 32-bit targets. These builtins can't be handled by the backend on 64-bit targets. So error up front instead of throwing an isel error. Fixes PR37225 Differential Revision: https://reviews.llvm.org/D46132 llvm-svn: 330987
* [X86][Sema] Range check the constant argument for the vpshld/vpshrd builtins ↵Craig Topper2018-01-111-0/+76
| | | | | | to ensure it fits in 8-bits. llvm-svn: 322247
* [Sema][X86] Update immediate check for gather/scatter prefetch instructions ↵Craig Topper2017-03-311-1/+1
| | | | | | | | | | to match the _MM_HINT_T0/T1 constant definitions Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too. Fixes PR32411. llvm-svn: 299233
* [X86] Add checking of the scale argument to scatter/gather builtinsCraig Topper2017-03-131-0/+14
| | | | | | | | The only valid values for scale immediate of scatter/gather builtins are 1, 2, 4, or 8. This patch enforces this in the frontend otherwise we generate invalid instruction encodings in the backend. Differential Revision: https://reviews.llvm.org/D30875 llvm-svn: 297642
* [AVX-512] Add initial support for checking rounding mode arguments of builtins.Craig Topper2016-09-231-0/+4
| | | | | | | | The backend can't encode all possible values of the argument and will fail isel. Checking in the frontend presents a friendlier experience to the user. I started with builtins that can only take _MM_CUR_DIRECTION or _MM_NO_EXC. More builtins coming in the future. llvm-svn: 282228
* [X86] Fix some illegal rounding modes in some builtin test cases to ones ↵Craig Topper2016-09-221-2/+2
| | | | | | that would properly compile to valid assembly. llvm-svn: 282137
* [X86] Add range checking on immediate arguments on XOP vpcom builtins.Craig Topper2015-02-131-0/+33
| | | | llvm-svn: 229067
* [x86] Teach Sema to check size of comparison immediate on avx512 cmpps/cmppd ↵Craig Topper2015-01-191-0/+14
| | | | | | buitins. llvm-svn: 226422
* [x86] Add range checking to the constant argument of cmpps/pd/ss/sd builtinas.Craig Topper2014-12-271-0/+20
llvm-svn: 224880
OpenPOWER on IntegriCloud