Changeset 1997 for proto


Ignore:
Timestamp:
Apr 5, 2012, 12:59:08 PM (7 years ago)
Author:
cameron
Message:

Pablo compiler updates for separate carry-in/carry-out parameters.

Location:
proto/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/config.py

    r1900 r1997  
    4444                          )
    4545       
     46        parser.add_option('-A', '--ALWAYS_INLINE',
     47                          dest='always_inline',
     48                          action='store_true',
     49                          default=False,
     50                          help='set IDISA_ALWAYS_INLINE for do_block/do_final_block',
     51                          )
     52       
    4653        # Group options
    4754        # 'dump'
  • proto/Compiler/pablo.py

    r1957 r1997  
    1010
    1111name_substitution_map = {}
     12do_block_inline_decorator = 'IDISA_INLINE '
     13do_final_block_inline_decorator = ''
    1214
    1315def is_BuiltIn_Call(fncall, builtin_fnname, builtin_arg_cnt, builtin_fnmod_noprefix='pablo'):
     
    239241    self.generic_visit(callnode)
    240242    #CARRYSET
    241     carry_args = [ast.Num(self.current_carry)]
    242     adv32_args = [ast.Subscript(ast.Name('pending32', ast.Load()), ast.Num(self.current_adv32), ast.Load())]
     243    #carry_args = [ast.Num(self.current_carry)]
     244    #adv32_args = [ast.Subscript(ast.Name('pending32', ast.Load()), ast.Num(self.current_adv32), ast.Load())]
     245    adv32_pending = ast.Subscript(ast.Name('pending32', ast.Load()), ast.Num(self.current_adv32), ast.Load())
     246    if self.carryin == "_ci":
     247        carry_args = [mkCall(self.carryvar.id + "." + 'get_carry_in', [ast.Num(self.current_carry)]), ast.Num(self.current_carry)]
     248        adv32_args = [adv32_pending, adv32_pending]
     249    else:
     250        carry_args = [mkCall('simd<1>::constant<0>', []), ast.Num(self.current_carry)]
     251        adv32_args = [ast.Num(0), adv32_pending]
     252
    243253    if is_BuiltIn_Call(callnode, 'Advance', 1):         
    244254      #CARRYSET
    245       rtn = self.carryvar.id + "." + "BitBlock_advance%s_co" % (self.carryin)
     255      rtn = self.carryvar.id + "." + "BitBlock_advance_ci_co"
    246256      c = mkCall(rtn, callnode.args + carry_args)
    247257      self.current_carry += 1
     
    249259    elif is_BuiltIn_Call(callnode, 'Advance32', 1):     
    250260      #CARRYSET
    251       rtn = self.carryvar.id + "." + "BitBlock_advance32%s_co" % (self.carryin)
     261      rtn = self.carryvar.id + "." + "BitBlock_advance32_ci_co"
    252262      c = mkCall(rtn, callnode.args + adv32_args)
    253263      self.current_adv32 += 1
     
    255265    elif is_BuiltIn_Call(callnode, 'ScanThru', 2):
    256266      #CARRYSET
    257       rtn = self.carryvar.id + "." + "BitBlock_scanthru%s_co" % (self.carryin)
     267      rtn = self.carryvar.id + "." + "BitBlock_scanthru_ci_co"
    258268      c = mkCall(rtn, callnode.args + carry_args)
    259269      self.current_carry += 1
     
    263273      # in having a separate BitBlock_scanto routine.
    264274      #CARRYSET
    265       rtn = self.carryvar.id + "." + "BitBlock_scanthru%s_co" % (self.carryin)
     275      rtn = self.carryvar.id + "." + "BitBlock_scanthru_ci_co"
    266276      if self.carryout == "":  scanclass = mkCall('simd_andc', [ast.Name('EOF_mask', ast.Load()), callnode.args[1]])
    267277      else: scanclass = mkCall('simd_not', [callnode.args[1]])
     
    563573                        + "\\\n" + self.indent(icount) + escape_newlines(statements) \
    564574                        + "\\\n" + self.indent(icount + 2) + "} while (0)"
    565                 return self.indent(icount) + "IDISA_INLINE void " + pfx + "do_block(" + parameters + ") {" \
     575                return self.indent(icount) + do_block_inline_decorator + "void " + pfx + "do_block(" + parameters + ") {" \
    566576                + "\n" + self.indent(icount) + declarations \
    567577                + "\n" + self.indent(icount) + initializations \
     
    580590                        + "\\\n" + self.indent(icount) + escape_newlines(statements) \
    581591                        + "\\\n" + self.indent(icount + 2) + "} while (0)"
    582                 return self.indent(icount) + "void " + pfx + "do_final_block(" + parameters + ") {" \
     592                return self.indent(icount) + do_final_block_inline_decorator + "void " + pfx + "do_final_block(" + parameters + ") {" \
    583593                + "\n" + self.indent(icount) + declarations \
    584594                + "\n" + self.indent(icount) + initializations \
  • proto/Compiler/pablomain.py

    r1902 r1997  
    8686                pablo.name_substitution_map = {'bitblock_has_bit' : 'bitblock::any',
    8787                                             'simd_const_1' : 'mvmd<1>::fill'}
    88                
     88        if options.always_inline:
     89                pablo.do_block_inline_decorator = 'IDISA_ALWAYS_INLINE '
     90                pablo.do_final_block_inline_decorator = 'IDISA_ALWAYS_INLINE '
     91
    8992        # Compiler modes
    9093        if options.struct_decs:
Note: See TracChangeset for help on using the changeset viewer.