[cfe-commits] r121509 - /cfe/trunk/lib/Sema/SemaChecking.cpp
Bob Wilson
bob.wilson at apple.com
Fri Dec 10 11:45:06 PST 2010
Author: bwilson
Date: Fri Dec 10 13:45:06 2010
New Revision: 121509
URL: http://llvm.org/viewvc/llvm-project?rev=121509&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=121509&r1=121508&r2=121509&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Fri Dec 10 13:45:06 2010
@@ -198,11 +198,9 @@
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;
More information about the cfe-commits
mailing list