]> granicus.if.org Git - clang/commitdiff
Do not assert on shifts of Neon polynomial types.
authorBob Wilson <bob.wilson@apple.com>
Fri, 10 Dec 2010 19:45:06 +0000 (19:45 +0000)
committerBob Wilson <bob.wilson@apple.com>
Fri, 10 Dec 2010 19:45:06 +0000 (19:45 +0000)
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

lib/Sema/SemaChecking.cpp

index f53086e33c6240b68f2a2e15f82c6c9c32ba7b4a..b699f5a318cf295609fcd13bd1ed9d403a5a8912 100644 (file)
@@ -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;