Changeset 3389 for proto/Compiler


Ignore:
Timestamp:
Jul 7, 2013, 2:52:12 PM (6 years ago)
Author:
cameron
Message:

clear() method for stream struct carries

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r3132 r3389  
    377377  def visit_Call(self, callnode):
    378378    self.generic_visit(callnode)
     379#    if self.carryout == "" and is_BuiltIn_Call(callnode, 'simd_not', 1):
     380#      return [mkCall('simd_andc', [ast.Name('EOF_mask', ast.Load()), callnode.args[0]])]
    379381    if is_BuiltIn_Call(callnode, 'atEOF', 1):
    380382      if self.carryout != "": 
     
    787789                                                stream_function.initializations,
    788790                                                stream_function.statements)             
     791                clear_function = self.mk_clear(stream_function.carry_count)             
    789792
    790793                do_final_block_function = self.do_final_block(self.do_final_block_parameters(stream_function.parameters),
     
    806809                + "\n" + self.indent(icount) + constructor \
    807810                + "\n" + self.indent(icount) + do_block_function \
     811                + "\n" + self.indent(icount) + clear_function \
    808812                + "\n" + self.indent(icount) + do_final_block_function \
    809813                + "\n" + self.indent(icount) + carry_declaration \
     
    819823                return self.indent(icount) + "%s() { ""\n" % (type_name) + adv_n_decl + self.carry_init(carry_count) + one_inits + " }"
    820824                       
     825        def mk_clear(self, carry_count, icount=0):
     826                one_inits = self.strm_fn.ccgo.GenerateInitializations()
     827                return self.indent(icount) + "IDISA_INLINE void clear() { ""\n" + self.carry_init(carry_count) + one_inits + " }"
     828
    821829        def do_block(self, parameters, declarations, initializations, statements, icount=0):
    822830                pfx = (lower1(self.type_name) + "_" if self.use_C_syntax else "")
Note: See TracChangeset for help on using the changeset viewer.