Changeset 762


Ignore:
Timestamp:
Dec 1, 2010, 9:38:34 PM (8 years ago)
Author:
cameron
Message:

Move CarryDecl? to declarations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r760 r762  
    185185
    186186
    187 CARRYQ_SIZE = 64
    188 
    189 def Carry_decls_of_fn_direct(fndef):
    190   global CARRYQ_SIZE
     187def Carry_decl_of_fn(fndef):
    191188  carry_count = CarryCounter().count(fndef)
    192189  if carry_count == 0: return ""
    193   Ccode = "  uint%i_t carryQ_0" % CARRYQ_SIZE
    194   currentQ = 0
    195   carry_count -= CARRYQ_SIZE
    196   while carry_count > 0:
    197     currentQ += 1
    198     Ccode += ", carryQ_%i" % currentQ
    199     carry_count -= CARRYQ_SIZE
    200   return Ccode + ";\n"
    201 
    202 def Carry_decls_of_fn(fndef):
    203   carry_count = CarryCounter().count(fndef)
    204   if carry_count == 0: return ""
    205   else: return "  DeclareCarryContainers(%i);\n" % carry_count
     190  else: return "  CarryDeclare(carryvar, %i);\n" % carry_count
    206191
    207192                   
     
    219204    if carry_count == 0: return fndef
    220205    self.generic_visit(fndef)
    221     fndef.body.insert(0, mkCallStmt('CarryDeclare', [self.carryvar, ast.Num(carry_count)]))
     206#   
     207#    fndef.body.insert(0, mkCallStmt('CarryDeclare', [self.carryvar, ast.Num(carry_count)]))
    222208    return fndef
    223209  def generic_xfrm(self, node):
     
    366352def gen_declarations(main_module, main_fn):
    367353  Cdecls = StreamStructGen().gen(main_module)
    368   Cdecls +=  BitBlock_decls_of_fn(main_fn)
     354  Cdecls += BitBlock_decls_of_fn(main_fn)
     355  Cdecls += Carry_decl_of_fn(main_fn)
    369356  return Cdecls
    370357
Note: See TracChangeset for help on using the changeset viewer.