Changeset 3018 for proto/Compiler


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

Multicarry while mode: initial check-in

Location:
proto/Compiler
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/config.py

    r2612 r3018  
    4242                          default=False,
    4343                          help='Experimental version with CCGO support',
     44                          )
     45       
     46        parser.add_option('-W', '--multicarryWhileMode',
     47                          dest='multicarryWhileMode',
     48                          action='store_true',
     49                          default=False,
     50                          help='Multicarry while loops: one carry per operation per iteration',
    4451                          )
    4552       
  • 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))
  • proto/Compiler/pablomain.py

    r2612 r3018  
    8686
    8787        pablo.experimentalMode = options.experimental
     88        pablo.multicarryWhileMode = options.multicarryWhileMode
    8889       
    8990        if options.use_IDISA:
     
    104105        else:
    105106                s = Program(options.output_filename, options.template_filename).generate_code(input_string, options)
     107
Note: See TracChangeset for help on using the changeset viewer.