Changeset 3020


Ignore:
Timestamp:
Apr 14, 2013, 12:04:55 PM (6 years ago)
Author:
cameron
Message:

Fixes for multicarry while mode.

Location:
proto/Compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/CCGO_While.py

    r3018 r3020  
    6666          if dpth == 0: inits.append("Test%i = simd<1>::constant<0>()" % b)
    6767          else: inits.append("TestVector%i = simd<1>::constant<0>()" % b)
    68         return "".join(["BitBlock %s;\n" % i  for i in inits])
     68        return "".join(["%s;\n" % i  for i in inits])
    6969
    7070    def GenerateStreamFunctionDecls(self):
     
    109109    def GenerateCarryIfTest(self, block_no, ifTest):
    110110        if self.carryInfoSet.whileDepth(block_no) == 0: v = mkast.var("Test%i" % block_no)
    111         else: v = mkast.var("TestVector%i" % block_no)
     111        else: v = mkast.call("Dequeue_bit", [mkast.var("TestVector%i" % block_no)])
    112112        return mkast.TestHelper_Bitblock_Or(ifTest, v)
    113113
     
    132132    def GenerateLocalDeclare(self, block_no):
    133133       return [mkast.assign([mkast.var("iterCount%i" % block_no)],
    134                             ast.BinOp(mkast.var("iterCount%i" % block_no), ast.Add(), ast.Num(1)))]
     134                            ast.BinOp(mkast.var("iterCount%i" % block_no), ast.Add(), ast.Num(1))),
     135               mkast.assign([mkast.var("TestVector%i" % block_no)],
     136                            mkast.call("simd<64>::srli<1>", [mkast.var("TestVector%i" % block_no)]))]
    135137    def GenerateCarryWhileTest(self, block_no, testExpr):
    136138        return mkast.TestHelper_Bitblock_Or(testExpr, mkast.var("TestVector%i" % block_no))
  • proto/Compiler/pablo.py

    r3018 r3020  
    468468    carry_arglist = [ast.Num(carry_base), ast.Num(carries)]
    469469    #new_test = ast.BoolOp(ast.Or(), [ifNode.test, mkCall(ast.Attribute(self.carryvar, 'CarryTest', ast.Load()), carry_arglist)])
    470     #new_else_part = ifNode.orelse + [mkast.CallStmt(ast.Attribute(self.carryvar, 'CarryDequeueEnqueue', ast.Load()), carry_arglist)]
     470    #new_else_part = ifNode.orelse + [mkast.callStmt(ast.Attribute(self.carryvar, 'CarryDequeueEnqueue', ast.Load()), carry_arglist)]
    471471    if self.carryin == "": new_test = ifNode.test
    472472    else: new_test = self.ccgo.GenerateCarryIfTest(this_block, ifNode.test)
     
    540540    local_carry_decl = self.ccgo.GenerateLocalDeclare(this_block)
    541541    #local_carry_decl = []
    542     #local_carry_decl = mkast.CallStmt('LocalCarryDeclare', [local_carryvar, ast.Num(carries)])
     542    #local_carry_decl = mkast.callStmt('LocalCarryDeclare', [local_carryvar, ast.Num(carries)])
    543543    inner_while.body = local_carry_decl + inner_while.body
    544     #final_combine = mkast.CallStmt(ast.Attribute(self.carryvar, 'CarryCombine', ast.Load()), [ast.Attribute(local_carryvar, 'cq', ast.Load()),ast.Num(carry_base), ast.Num(carries)])
     544    #final_combine = mkast.callStmt(ast.Attribute(self.carryvar, 'CarryCombine', ast.Load()), [ast.Attribute(local_carryvar, 'cq', ast.Load()),ast.Num(carry_base), ast.Num(carries)])
    545545    final_combine = self.ccgo.GenerateCarryWhileFinalization(this_block)
    546546    inner_while.body += final_combine
     
    550550    if is_special:
    551551      # We combine the final carry into the one preceeding the loop.
    552       combine1 = mkast.CallStmt(ast.Attribute(self.carryvar, 'CarryCombine1', ast.Load()), [ast.Num(carry_base-1), ast.Num(carry_base+carries-1)])
     552      combine1 = mkast.callStmt(ast.Attribute(self.carryvar, 'CarryCombine1', ast.Load()), [ast.Num(carry_base-1), ast.Num(carry_base+carries-1)])
    553553      while_body_extend = [inner_while, combine1]
    554554      # The carry test can skip the final case.
     
    664664    self.generic_visit(t)
    665665    v = t.targets[0]
    666     dump_stmt = mkast.CallStmt(' print_register<BitBlock>', [ast.Str(Cgen.py2C().gen(v)), v])
     666    dump_stmt = mkast.callStmt(' print_register<BitBlock>', [ast.Str(Cgen.py2C().gen(v)), v])
    667667    return [t, dump_stmt]
    668668
     
    676676      self.generic_visit(t)
    677677      v = t.targets[0]
    678       dump_stmt = mkast.CallStmt(' ASSERT_BITBLOCK_ALIGN', [v])
     678      dump_stmt = mkast.callStmt(' ASSERT_BITBLOCK_ALIGN', [v])
    679679      return [t, dump_stmt]
    680680
     
    988988
    989989                #if stream_function.carry_count > 0:
    990                 #       node.body += [mkast.CallStmt('carryQ.CarryQ_Adjust', [ast.Num(stream_function.carry_count)])]
     990                #       node.body += [mkast.callStmt('carryQ.CarryQ_Adjust', [ast.Num(stream_function.carry_count)])]
    991991                node.body += stream_function.ccgo.GenerateStreamFunctionFinalization()
    992992
     
    10601060   
    10611061    #if self.main_carry_count > 0:
    1062                 #self.main_node.body += [mkast.CallStmt('CarryQ_Adjust', [ast.Name('carryQ', ast.Load()), ast.Num(self.main_carry_count)])]
     1062                #self.main_node.body += [mkast.callStmt('CarryQ_Adjust', [ast.Name('carryQ', ast.Load()), ast.Num(self.main_carry_count)])]
    10631063    #self.main_node.body += ccgo.GenerateStreamFunctionFinalization()
    10641064   
Note: See TracChangeset for help on using the changeset viewer.