Ignore:
Timestamp:
Apr 14, 2013, 8:27:30 AM (6 years ago)
Author:
cameron
Message:

Multicarry while mode: initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r3017 r3018  
    315315# Carry Introduction Transformation
    316316#
     317import CCGO_While
    317318
    318319def Strategic_CCGO_Factory(carryInfoSet):
    319320  BLOCK_SIZE = 128
    320   if experimentalMode:
     321  if multicarryWhileMode: ccgo = CCGO_While.CCGO_While1(BLOCK_SIZE, carryInfoSet)
     322  elif experimentalMode:
    321323    ops = carryInfoSet.operation_count
    322324    if ops == 0: ccgo = CCGO.CCGO()
     
    501503    return True
    502504
     505  def multicarry_While(self, whileNode):
     506    self.block_no += 1
     507    this_block = self.block_no
     508    original_test_expr = whileNode.test.args[0]
     509    if self.carryout == '':
     510      whileNode.test.args[0] = mkCall("simd_and", [original_test_expr, ast.Name('EOF_mask', ast.Load())])
     511
     512    self.generic_visit(whileNode)
     513    local_carry_decl = self.ccgo.GenerateLocalDeclare(this_block)
     514    whileNode.body = local_carry_decl + whileNode.body
     515    whileNode.test = self.ccgo.GenerateCarryWhileTest(this_block, whileNode.test)
     516    final_combine = self.ccgo.GenerateCarryWhileFinalization(this_block)
     517    return [whileNode] + final_combine
     518
     519
    503520  def visit_While(self, whileNode):
     521    if multicarryWhileMode: return self.multicarry_While(whileNode)
     522
    504523    # Determine the original test expression, now encloded in bitblock::any()
    505524    self.block_no += 1
     
    515534    #CARRYSET
    516535    if carries == 0: return whileNode
     536
    517537    local_carryvar = ast.Name('sub' + self.carryvar.id, ast.Load())
    518538    inner_while = self.local_while_xfrm(local_carryvar, copy.deepcopy(whileNode))
Note: See TracChangeset for help on using the changeset viewer.