Changeset 347 for proto/parabix2


Ignore:
Timestamp:
Jan 6, 2010, 2:53:27 PM (10 years ago)
Author:
eamiri
Message:

minor changes

File:
1 edited

Legend:

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

    r344 r347  
    1010import ast, py2bitexpr, string
    1111
    12 #import bitexpr
    13 """
    14 Nop = 'nop'
    15 Andc = 'simd_andc'
    16 And = 'simd_and'
    17 Or = 'simd_or'
    18 Xor = 'simd_xor'
    19 Not = 'not'
    20 Sel = 'simd_if'
    21 Add = 'adc128'
    22 Sub = 'sbb128'
    23 If = 'simd_has_bit'
    24 
    25 
    26 """
    27 
    2812class Program:
    2913    def __init__(self):
     
    6852        livelist = ['u16hi[0]', 'u16hi[1]', 'u16hi[2]', 'u16hi[3]', 'u16hi[4]', 'u16hi[5]', 'u16hi[6]', 'u16hi[7]']
    6953        livelist += ['u16lo[0]','u16lo[1]','u16lo[2]','u16lo[3]','u16lo[4]','u16lo[5]','u16lo[6]','u16lo[7]', 'delmask', 'u8.error', 'error_mask', 'u8lastbyte', 'Cursor2',]
     54       
    7055        all_lives, s = py2bitexpr.eliminate_dead_code(s, set(livelist))
    7156
     
    8065        return s
    8166
    82         #livelist = ['u16hi[0]','u16hi[1]','u16hi[2]','u16hi[3]','u16hi[4]','u16hi[5]','u16hi[6]','u16hi[7]']
    83         #livelist += ['u16lo[0]','u16lo[1]','u16lo[2]','u16lo[3]','u16lo[4]','u16lo[5]','u16lo[6]','u16lo[7]', 'delmask', 'u8.error', 'error_mask', 'u8lastbyte']
    84 
    85 
    8667###############################################################
    8768
    88 #if __name__ == '__main__':
    89 #if __name__ == '__main__':
    90 
    91 if True:
    92         s=r"""def u8u16(u8bit):
     69if __name__ == '__main__':
     70        mycode=r"""def u8u16(u8bit):
    9371        temp1 = (u8bit[0] | u8bit[1]);
    9472        temp2 = (u8bit[2] & u8bit[3]);
     
    232210        ParseError |= EndTagEnds &~ RAngle
    233211        error_mask=ParseError"""
    234         s = Program().generate_code(s)
    235 
    236 #TODO: merge expr2simd() and a simplify_expr()
    237 #TODO: there is some unnecesary code in output  duplication that can be removed
    238 #TODO: removing unreachable code is developed but is incomplete. Currently the code is not used.
    239 #TODO: Support optimizing over subset of values
    240 #TODO: A mechanism for programmer to let the compiler know about relations between bitstreams. Some relations might
    241 #       be possibly extracted automatically, but it might be expensive.Look at the optimize(maxtwo, allone) in the current example.
    242 #       it does not help at all, while it is an important case. This is because thecompiler can not extract all the information
    243 #       implied by the assumption maxtwo = allone.
    244 #TODO: How variables redefined within a while loop should be dealt with for SSA generation?
    245 #TODO: How variables redefined within a while loop should be dealt if there is an optimization on them?
    246 #TODO: Numbering of temp variables generated by class BasicBlock
    247 #TODO: Cross-BasicBlock use of common expressions in class BasicBlock
    248 #######################################
    249 # Errors to consider and report to the programmer:
    250 # 1- Optimizaing on a variable that does not exist
    251 # 2- infinite while loop when the loop looks like this: while (AllOne>0)
     212        s = Program().generate_code(mycode)
Note: See TracChangeset for help on using the changeset viewer.