Changeset 134

Show
Ignore:
Timestamp:
11/13/07 05:17:08 (10 months ago)
Author:
Don Clugston
Message:

Added workaround for DMD bug #1664. This allows SSE constant folding to work. Yay!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/blade/BladeDemo.d

    r133 r134  
    3232    } 
    3333 
    34     mixin(vectorize(" a   += d*2.01-z")); 
    35  //   mixin(vectorize(" a   += r*2.01")); 
    36  //   mixin(vectorize(" q   += q*2.01")); 
     34    mixin(vectorize(" a   += d*2.01*a[2]-z")); 
     35    mixin(vectorize(" a   += r*2.01")); 
     36    mixin(vectorize(" q   += q*2.01")); 
    3737     
    3838    writefln("a=", a); 
  • trunk/blade/SyntaxTree.d

    r130 r134  
    330330{ 
    331331    // This function would just return sym.stringof, except for a couple of compiler bugs. 
    332     // (1) 1.23.stringof fails to compile. Fortunately (1.23).stringof works. 
     332    // (1) 1.23.stringof fails to compile. 
     333    //  Fortunately (1.23).stringof works. IF you append "" to it! 
    333334    // (2) x.stringof doesn't compile, if x is a function. Just return x instead. 
    334335    //     We also return x if x doesn't compile (eg, is an undefined variable). 
    335336    if (sym[0]>='0' && sym[0]<='9') { // numeric literal 
    336         return "(" ~ sym ~ ").stringof"
     337        return `(` ~ sym ~ `).stringof~""`
    337338    } 
    338339    return `mixin(is(typeof(` ~ sym ~ `)==function) || !is(typeof(` ~ sym ~ `))?` ~ wrapInQuotes(wrapInQuotes(sym)) ~ `:` ~ wrapInQuotes(sym ~ ".stringof") ~ ")"; 
  • trunk/blade/SyntaxTreeDemo.d

    r123 r134  
    102102    mixin(vec("QUAL^st")); 
    103103    mixin(vec("sin(3.45)")); 
     104     
     105    static z = [3.4, 565, 31.3, 0]; 
     106    double [] a = new double[4]; 
     107    double [] dun = [17.0, 28.25, 1, 56.2]; 
     108 
     109    mixin(vec(" a   += dun*(25.5*3.01)-z")); 
    104110}