aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-10 19:45:06 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-10 19:45:06 +0000
commit42499f94069c73d7a9c82da98a4245ea9fe2c526 (patch)
treeba926625383d725ade5d41be5e21d49874c899b3 /lib/Sema/SemaChecking.cpp
parent3922ed09db588c27282369622afb613acaee6a22 (diff)
Do not assert on shifts of Neon polynomial types.
Most Neon shift intrinsics do not have variants for polynomial types, but vsri_n and vsli_n do support them, and we need to properly range-check the shift immediates for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index f53086e33c..b699f5a318 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -198,11 +198,9 @@ static unsigned RFT(unsigned t, bool shift = false) {
assert(!shift && "cannot shift float types!");
return (2 << (int)quad) - 1;
case 5: // poly8
- assert(!shift && "cannot shift polynomial types!");
- return (8 << (int)quad) - 1;
+ return shift ? 7 : (8 << (int)quad) - 1;
case 6: // poly16
- assert(!shift && "cannot shift polynomial types!");
- return (4 << (int)quad) - 1;
+ return shift ? 15 : (4 << (int)quad) - 1;
case 7: // float16
assert(!shift && "cannot shift float types!");
return (4 << (int)quad) - 1;