summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/NeonEmitter.cpp
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2010-12-01 19:49:51 +0000
committerBob Wilson <bob.wilson@apple.com>2010-12-01 19:49:51 +0000
commit65a96d082a11769cfa0bdbf768770e387005c89e (patch)
tree4446a796f6bd6bc8297e17a5fb12fa8de500c312 /llvm/utils/TableGen/NeonEmitter.cpp
parentdc35e067c110895df29dbcaaf17124499f2214db (diff)
downloadbcm5719-llvm-65a96d082a11769cfa0bdbf768770e387005c89e.tar.gz
bcm5719-llvm-65a96d082a11769cfa0bdbf768770e387005c89e.zip
Cleanup: simplify checks for integers between 2 and 4.
llvm-svn: 120595
Diffstat (limited to 'llvm/utils/TableGen/NeonEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/NeonEmitter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/NeonEmitter.cpp b/llvm/utils/TableGen/NeonEmitter.cpp
index 24dcaeddfe8..aa6daaf3794 100644
--- a/llvm/utils/TableGen/NeonEmitter.cpp
+++ b/llvm/utils/TableGen/NeonEmitter.cpp
@@ -337,7 +337,7 @@ static std::string BuiltinTypeString(const char mod, StringRef typestr,
// returning structs of 2, 3, or 4 vectors which are returned in a sret-like
// fashion, storing them to a pointer arg.
if (ret) {
- if (mod == '2' || mod == '3' || mod == '4')
+ if (mod >= '2' && mod <= '4')
return "vv*";
if (mod == 'f' || (ck != ClassB && type == 'f'))
return quad ? "V4f" : "V2f";
@@ -704,7 +704,7 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
// If this builtin returns a struct 2, 3, or 4 vectors, pass it as an implicit
// sret-like argument.
- bool sret = (proto[0] == '2' || proto[0] == '3' || proto[0] == '4');
+ bool sret = (proto[0] >= '2' && proto[0] <= '4');
// If this builtin takes an immediate argument, we need to #define it rather
// than use a standard declaration, so that SemaChecking can range check
@@ -755,7 +755,7 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto,
// Handle multiple-vector values specially, emitting each subvector as an
// argument to the __builtin.
- if (proto[i] == '2' || proto[i] == '3' || proto[i] == '4') {
+ if (proto[i] >= '2' && proto[i] <= '4') {
for (unsigned vi = 0, ve = proto[i] - '0'; vi != ve; ++vi) {
s += args + ".val[" + utostr(vi) + "]";
if ((vi + 1) < ve)
@@ -1131,7 +1131,7 @@ void NeonEmitter::runHeader(raw_ostream &OS) {
// Builtins that return a struct of multiple vectors have an extra
// leading arg for the struct return.
- if (Proto[0] == '2' || Proto[0] == '3' || Proto[0] == '4')
+ if (Proto[0] >= '2' && Proto[0] <= '4')
++immidx;
// Add one to the index for each argument until we reach the immediate
OpenPOWER on IntegriCloud