diff options
author | Nate Begeman <natebegeman@mac.com> | 2010-06-09 05:11:55 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2010-06-09 05:11:55 +0000 |
commit | 007afe4b4b3f440ea1d5caebe47f7d329a71766d (patch) | |
tree | 5d94c2eb05e74ab57f091fed872f07573d292e87 /utils | |
parent | 34aa4238142371d35d3774435b21cb966b2a2c28 (diff) | |
download | llvm-007afe4b4b3f440ea1d5caebe47f7d329a71766d.tar.gz llvm-007afe4b4b3f440ea1d5caebe47f7d329a71766d.tar.bz2 llvm-007afe4b4b3f440ea1d5caebe47f7d329a71766d.tar.xz |
Specialize I-Class instructions better so that we have less work to do in codegen.
Parenthesize macro args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/NeonEmitter.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/utils/TableGen/NeonEmitter.cpp b/utils/TableGen/NeonEmitter.cpp index 1aafff9cf5..8b90bb18c1 100644 --- a/utils/TableGen/NeonEmitter.cpp +++ b/utils/TableGen/NeonEmitter.cpp @@ -310,10 +310,14 @@ static std::string BuiltinTypeString(const char mod, StringRef typestr, return quad ? "V48c" : "V24c"; if (mod == '4') return quad ? "V64c" : "V32c"; - if (mod == 'f') + if (mod == 'f' || (ck == ClassI && type == 'f')) return quad ? "V4f" : "V2f"; - if (mod == 'x' || mod == 'u') + if (ck == ClassI && type == 's') + return quad ? "V8s" : "V4s"; + if (ck == ClassI && type == 'i') return quad ? "V4i" : "V2i"; + if (ck == ClassI && type == 'l') + return quad ? "V2LLi" : "V1LLi"; return quad ? "V16c" : "V8c"; } @@ -325,9 +329,16 @@ static std::string BuiltinTypeString(const char mod, StringRef typestr, return quad ? "V16cV16cV16c" : "V8cV8cV8c"; if (mod == '4') return quad ? "V16cV16cV16cV16c" : "V8cV8cV8cV8c"; - if (mod == 'f') - return quad ? "V4f" : "V2f"; + if (mod == 'f' || (ck == ClassI && type == 'f')) + return quad ? "V4f" : "V2f"; + if (ck == ClassI && type == 's') + return quad ? "V8s" : "V4s"; + if (ck == ClassI && type == 'i') + return quad ? "V4i" : "V2i"; + if (ck == ClassI && type == 'l') + return quad ? "V2LLi" : "V1LLi"; + return quad ? "V16c" : "V8c"; } @@ -658,7 +669,12 @@ static std::string GenBuiltin(const std::string &name, const std::string &proto, continue; } + // Parenthesize the args from the macro. + if (define) + s.push_back('('); s.push_back(arg); + if (define) + s.push_back(')'); if (structTypes && proto[i] != 's' && proto[i] != 'i' && proto[i] != 'l' && proto[i] != 'p' && proto[i] != 'c') { |