Changeset 325 for proto/parabix2


Ignore:
Timestamp:
Oct 29, 2009, 6:13:54 AM (10 years ago)
Author:
cameron
Message:

Remove false optimization of adc(0,0)=>0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/Compiler/bitstream_compiler.py

    r324 r325  
    172172            return expr
    173173    elif isinstance(expr, bitexpr.Add):
    174         if isinstance(expr.operand1, bitexpr.FalseLiteral) and isinstance(expr.operand1, bitexpr.FalseLiteral):
    175             return bitexpr.FalseLiteral()
    176         else:
     174#  The following simplification does not work because there may be a carry bit.
     175#        if isinstance(expr.operand1, bitexpr.FalseLiteral) and isinstance(expr.operand1, bitexpr.FalseLiteral):
     176#            return bitexpr.FalseLiteral()
     177#        else:
    177178            return expr
    178179    elif isinstance(expr, bitexpr.Sub):
     
    455456        s=r"""def u8u16(u8, u8bit):
    456457        u8.unibyte = (~u8bit[0]);
     458#        optimize(u8bit[0], allzero)
    457459        optimize(u8.unibyte, allone)
    458460        u8.prefix = (u8bit[0] & u8bit[1]);
     
    463465        u8.prefix4 = (u8.prefix & temp2);
    464466        u8.suffix = (u8bit[0] &~ u8bit[1]);
    465         maxtwo = u8.prefix2 | u8.unibyte | u8.suffix
    466         optimize(maxtwo, allone)
     467#        maxtwo = u8.prefix2 | u8.unibyte | u8.suffix
     468#        optimize(maxtwo, allone)
    467469        temp3 = (u8bit[2] | u8bit[3]);
    468470        temp4 = (u8.prefix &~ temp3);
     
    498500        u8lastscope = u8.scope22 | u8.scope33 | u8.scope44
    499501        u8anyscope = u8lastscope | u8.scope32 | u8.scope42 | u8.scope43
    500        
     502        optimize(u8anyscope,allzero)
    501503        # C0-C1 and F5-FF are illegal
    502504        error_mask = u8.badprefix
Note: See TracChangeset for help on using the changeset viewer.