[cfe-commits] r109814 - in /cfe/trunk: include/clang/Basic/BuiltinsARM.def lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaChecking.cpp
Nate Begeman
natebegeman at mac.com
Thu Jul 29 15:48:35 PDT 2010
Author: sampo
Date: Thu Jul 29 17:48:34 2010
New Revision: 109814
URL: http://llvm.org/viewvc/llvm-project?rev=109814&view=rev
Log:
Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.
Modified:
cfe/trunk/include/clang/Basic/BuiltinsARM.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/include/clang/Basic/BuiltinsARM.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsARM.def?rev=109814&r1=109813&r2=109814&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def Thu Jul 29 17:48:34 2010
@@ -17,8 +17,12 @@
// In libgcc
BUILTIN(__clear_cache, "v.", "")
BUILTIN(__builtin_thread_pointer, "v*", "")
+
+// Saturating arithmetic
BUILTIN(__builtin_arm_qadd, "iii", "nc")
BUILTIN(__builtin_arm_qsub, "iii", "nc")
+BUILTIN(__builtin_arm_ssat, "iiUi", "nc")
+BUILTIN(__builtin_arm_usat, "UiUiUi", "nc")
// NEON
#define GET_NEON_BUILTINS
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=109814&r1=109813&r2=109814&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Jul 29 17:48:34 2010
@@ -1062,7 +1062,7 @@
}
// Determine the type of this overloaded NEON intrinsic.
- assert(BuiltinID > ARM::BI__builtin_thread_pointer);
+ assert(BuiltinID > ARM::BI__builtin_arm_usat);
llvm::SmallVector<Value*, 4> Ops;
for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; i++)
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=109814&r1=109813&r2=109814&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Thu Jul 29 17:48:34 2010
@@ -298,6 +298,8 @@
unsigned i = 0, l = 0, u = 0;
switch (BuiltinID) {
default: return false;
+ case ARM::BI__builtin_arm_ssat: i = 1; l = 1; u = 31; break;
+ case ARM::BI__builtin_arm_usat: i = 1; u = 31; break;
#define GET_NEON_IMMEDIATE_CHECK
#include "clang/Basic/arm_neon.inc"
#undef GET_NEON_IMMEDIATE_CHECK
More information about the cfe-commits
mailing list