summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-02-25 11:13:42 +0000
committerTim Northover <tnorthover@apple.com>2014-02-25 11:13:42 +0000
commitfb7e000aa81db25ced208e290b6221f9e56f11c1 (patch)
tree7c5e39c53bb3387c093d7d6a57fb9bcea8aa88e3 /utils
parent8fc5af7b95ee8d55ef8e2ecd43494023cbdd360e (diff)
downloadclang-fb7e000aa81db25ced208e290b6221f9e56f11c1.tar.gz
clang-fb7e000aa81db25ced208e290b6221f9e56f11c1.tar.bz2
clang-fb7e000aa81db25ced208e290b6221f9e56f11c1.tar.xz
ARM NEON: add _f16 support to a couple of vector-shuffling intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202137 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/NeonEmitter.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp
index 932af9a8e8..165e749b33 100644
--- a/utils/TableGen/NeonEmitter.cpp
+++ b/utils/TableGen/NeonEmitter.cpp
@@ -1436,7 +1436,7 @@ static void GenerateChecksForIntrinsic(const std::string &Name,
/// UseMacro - Examine the prototype string to determine if the intrinsic
/// should be defined as a preprocessor macro instead of an inline function.
-static bool UseMacro(const std::string &proto) {
+static bool UseMacro(const std::string &proto, StringRef typestr) {
// If this builtin takes an immediate argument, we need to #define it rather
// than use a standard declaration, so that SemaChecking can range check
// the immediate passed by the user.
@@ -1449,6 +1449,12 @@ static bool UseMacro(const std::string &proto) {
proto.find('c') != std::string::npos)
return true;
+ // It is not permitted to pass or return an __fp16 by value, so intrinsics
+ // taking a scalar float16_t must be implemented as macros.
+ if (typestr.find('h') != std::string::npos &&
+ proto.find('s') != std::string::npos)
+ return true;
+
return false;
}
@@ -1463,7 +1469,7 @@ static bool MacroArgUsedDirectly(const std::string &proto, unsigned i) {
// Generate the string "(argtype a, argtype b, ...)"
static std::string GenArgs(const std::string &proto, StringRef typestr,
const std::string &name) {
- bool define = UseMacro(proto);
+ bool define = UseMacro(proto, typestr);
char arg = 'a';
std::string s;
@@ -1642,7 +1648,7 @@ static std::string GenOpString(const std::string &name, OpKind op,
const std::string &proto, StringRef typestr) {
bool quad;
unsigned nElts = GetNumElements(typestr, quad);
- bool define = UseMacro(proto);
+ bool define = UseMacro(proto, typestr);
std::string ts = TypeString(proto[0], typestr);
std::string s;
@@ -2386,7 +2392,7 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
// sret-like argument.
bool sret = IsMultiVecProto(proto[0]);
- bool define = UseMacro(proto);
+ bool define = UseMacro(proto, typestr);
// Check if the prototype has a scalar operand with the type of the vector
// elements. If not, bitcasting the args will take care of arg checking.
@@ -2531,7 +2537,7 @@ static std::string GenIntrinsic(const std::string &name,
StringRef outTypeStr, StringRef inTypeStr,
OpKind kind, ClassKind classKind) {
assert(!proto.empty() && "");
- bool define = UseMacro(proto) && kind != OpUnavailable;
+ bool define = UseMacro(proto, outTypeStr) && kind != OpUnavailable;
std::string s;
// static always inline + return type