Changeset 142
- Timestamp:
- 11/19/07 02:54:57 (11 months ago)
- Files:
-
- trunk/blade/Blade.d (modified) (4 diffs)
- trunk/blade/BladeDemo.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/blade/Blade.d
r141 r142 69 69 { 70 70 RevisedExpression revised = simplifySyntaxTree(tree); 71 72 71 VecExpressionType exprType = categorizeExpression(tree, revised); 73 72 if (exprType == VecExpressionType.SSE2Expression || exprType == VecExpressionType.SSE1Expression) { … … 145 144 } 146 145 if (r>'1') return VecExpressionType.DExpression; // can only do scalars and vectors right now. 147 146 148 147 // At this point, all compounds are an original symbol + indexing/slicing. 149 148 int x = revised.mapping[i]-'A'; 150 149 int y = x; // for compounds, get the original type 151 if (x>tree.symbolTable.length) y = revised.compounds[x ][0]-'A';150 if (x>tree.symbolTable.length) y = revised.compounds[x-tree.symbolTable.length][0]-'A'; 152 151 153 152 char [] t = tree.symbolTable[y].element; … … 239 238 if (rnk=='0') result ~= SSE2? ",double" : ",float"; 240 239 else result ~= SSE2? ",double*" : ",float*"; 241 vals ~= "," ~ getValueForSymbol(revised.mapping[i], tree, revised); 240 vals ~= ","; 241 if (rnk=='1') vals ~= "&"; 242 vals ~= getValueForSymbol(revised.mapping[i], tree, revised); 242 243 // for vectors, we only need the pointer, not the length 243 if (rnk=='1') vals ~= ".ptr"; 244 // if (rnk=='1') vals ~= ".ptr"; 245 if (rnk=='1') vals ~= "[0]"; 244 246 } 245 247 … … 328 330 else v ~= d; 329 331 } 330 return "(" ~ v ~ ")";332 return v; //"(" ~ v ~ ")"; 331 333 } 332 334 trunk/blade/BladeDemo.d
r141 r142 27 27 idouble [] p = [2.3i, 254i, 0.1i, 1.2i]; 28 28 for(int i=0; i<r.length;++i) { 29 // r[i]= q[i]+ a[i]*2213.3;30 29 r[i]= q[i]*2213.3L; 31 30 } 31 double [4][] another = [[33.1, 4543, 43, 878.7], [5.14, 455, 554, 2.43]]; 32 real k=3.4; 32 33 33 mixin(vectorize(" a += d*2.01*a[2]-z"));34 mixin(vectorize(" a += r*2.01"));34 mixin(vectorize(" a += d*2.01*a[2]-z+another[1]")); 35 mixin(vectorize(" a -= 2.01*(3.04+k)*r")); 35 36 mixin(vectorize(" q += q*2.01")); 36 37 37 writefln("a=", a); 38 writefln("a=", a); 38 39 }
