summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2014-09-17 11:49:30 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-09-17 11:50:57 +0800
commitc65c0087166a2194ece457d8739d06e86a857dbe (patch)
treec488f78143ef42eef9a7c7c1dfc080b6be4240ef
parent565d1eb00d9a5219c2848b3674e40ac07cb48b89 (diff)
Revert "improve the build performance of vector type built-in function."
This patch still has to be pending to fix the wide integer issue completely. Although we have a fallback mechanism which will try to build the module again by ignoring some passes to avoid the wide integer issue, it's broken now on master branch. As now all the builtin functions have been built statically, and those bitcode may already have i128/i512 etc. This reverts commit 565d1eb00d9a5219c2848b3674e40ac07cb48b89.
-rwxr-xr-xbackend/src/libocl/script/gen_vector.py45
1 files changed, 6 insertions, 39 deletions
diff --git a/backend/src/libocl/script/gen_vector.py b/backend/src/libocl/script/gen_vector.py
index de28552..a91dfcf 100755
--- a/backend/src/libocl/script/gen_vector.py
+++ b/backend/src/libocl/script/gen_vector.py
@@ -289,42 +289,9 @@ class builtinProto():
formatStr += ';'
self.append(formatStr)
return formatStr
- if self.functionName != 'select' and ptypeSeqs[0] == ptypeSeqs[self.paramCount-1] and ptype[1] > 4:
- formatStr += '\n{ \n union{'
- formatStr = self.append(formatStr, ' {0} va[{1}];'.format(vtype[0], vtype[1]))
- formatStr = self.append(formatStr, ' {0}{1} vv{2};'.format(vtype[0], vtype[1], vtype[1]))
- formatStr += '\n }uret;'
- formatStr += '\n union{'
- formatStr = self.append(formatStr, ' {0} pa[{1}];'.format(ptype[0], ptype[1]))
- formatStr = self.append(formatStr, ' {0}{1} pv{2};'.format(ptype[0], ptype[1], ptype[1]))
- formatStr += '\n }'
- for n in range(0, self.paramCount):
- formatStr += 'usrc{0}'.format(n)
- if n+1 != self.paramCount:
- formatStr +=', '
- formatStr += ';'
-
- for n in range(0, self.paramCount):
- formatStr = self.append(formatStr, ' usrc{0}.pv{1} = param{2};'.format(n, ptype[1], n))
- formatStr = self.append(formatStr, ' for(int i =0; i < {0}; i++)'.format(ptype[1]))
- formatStr += '\n uret.va[i] = '
- if self.prefix == 'relational' and self.functionName != 'bitselect' and self.functionName != 'select':
- formatStr += '-'
- formatStr += '{0}('.format(self.functionName)
-
- for n in range(0, self.paramCount):
- formatStr += 'usrc{0}.pa[i]'.format(n)
- if n+1 != self.paramCount:
- formatStr +=', '
- formatStr += ');'
- formatStr = self.append(formatStr, ' return uret.vv{0};'.format(vtype[1]))
- formatStr += '\n}'
- formatStr = self.append(formatStr)
- return formatStr
- else:
- formatStr = self.append(formatStr, '{{return ({0}{1})('.format(vtype[0], vtype[1]))
- self.indent = len(formatStr)
- for j in range(0, vtype[1]):
+ formatStr = self.append(formatStr, '{{return ({0}{1})('.format(vtype[0], vtype[1]))
+ self.indent = len(formatStr)
+ for j in range(0, vtype[1]):
if (j != 0):
formatStr += ','
if (j + 1) % 2 == 0:
@@ -359,10 +326,10 @@ class builtinProto():
formatStr += ')'
- formatStr += '); }\n'
- self.append(formatStr)
+ formatStr += '); }\n'
+ self.append(formatStr)
- return formatStr
+ return formatStr
def output(self):
for line in self.outputStr: