Changeset 2041 for proto/Compiler


Ignore:
Timestamp:
Apr 22, 2012, 11:10:14 AM (7 years ago)
Author:
cameron
Message:

Support for AdvanceThenScan?{To,Thru}, SpanUpTo?, and {In,Ex}clusive_Span

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r2009 r2041  
    232232    return node
    233233
     234
     235
    234236#
    235237# Carry Introduction Transformation
     
    238240  def visit_Call(self, callnode):
    239241    self.generic_visit(callnode)
    240     if is_BuiltIn_Call(callnode,'Advance', 1) or is_BuiltIn_Call(callnode,'ScanThru', 2) or is_BuiltIn_Call(callnode,'ScanTo', 2) or is_BuiltIn_Call(callnode,'ScanToFirst', 1):       
     242    if is_BuiltIn_Call(callnode,'Advance', 1) or is_BuiltIn_Call(callnode,'ScanThru', 2) or is_BuiltIn_Call(callnode,'ScanTo', 2) or is_BuiltIn_Call(callnode,'ScanToFirst', 1) or is_BuiltIn_Call(callnode,'AdvanceThenScanThru', 2) or is_BuiltIn_Call(callnode,'AdvanceThenScanTo', 2) or is_BuiltIn_Call(callnode,'SpanUpTo', 2) or  is_BuiltIn_Call(callnode,'InclusiveSpan', 2) or is_BuiltIn_Call(callnode,'ExclusiveSpan', 2):         
    241243      self.carry_count += 1
    242244  def visit_BinOp(self, exprnode):
     
    312314      rtn = self.carryvar.id + "." + "BitBlock_scanthru_ci_co"
    313315      c = mkCall(rtn, callnode.args + carry_args)
     316      self.current_carry += 1
     317      return c
     318    elif is_BuiltIn_Call(callnode, 'AdvanceThenScanThru', 2):
     319      #CARRYSET
     320      rtn = self.carryvar.id + "." + "BitBlock_advance_then_scanthru"
     321      c = mkCall(rtn, callnode.args + carry_args)
     322      self.current_carry += 1
     323      return c
     324    elif is_BuiltIn_Call(callnode, 'AdvanceThenScanTo', 2):
     325      #CARRYSET
     326      rtn = self.carryvar.id + "." + "BitBlock_advance_then_scanthru"
     327      if self.carryout == "":  scanclass = mkCall('simd_andc', [ast.Name('EOF_mask', ast.Load()), callnode.args[1]])
     328      else: scanclass = mkCall('simd_not', [callnode.args[1]])
     329      c = mkCall(rtn, [callnode.args[0], mkCall('simd_andc', [scanclass, callnode.args[0]])] + carry_args)
     330      self.current_carry += 1
     331      return c
     332    elif is_BuiltIn_Call(callnode, 'SpanUpTo', 2):
     333      #CARRYSET
     334      rtn = self.carryvar.id + "." + "BitBlock_span_upto"
     335      c = mkCall(rtn, callnode.args + carry_args)
     336      self.current_carry += 1
     337      return c
     338    elif is_BuiltIn_Call(callnode, 'InclusiveSpan', 2):
     339      #CARRYSET
     340      rtn = self.carryvar.id + "." + "BitBlock_span_upto"
     341      c = mkCall('simd_or', [mkCall(rtn, callnode.args + carry_args), callnode.args[1]])
     342      self.current_carry += 1
     343      return c
     344    elif is_BuiltIn_Call(callnode, 'ExclusiveSpan', 2):
     345      #CARRYSET
     346      rtn = self.carryvar.id + "." + "BitBlock_span_upto"
     347      c = mkCall('simd_andc', [mkCall(rtn, callnode.args + carry_args), callnode.args[0]])
    314348      self.current_carry += 1
    315349      return c
Note: See TracChangeset for help on using the changeset viewer.