Changeset 2801


Ignore:
Timestamp:
Dec 28, 2012, 11:15:58 AM (6 years ago)
Author:
cameron
Message:

Add CarryThenFinalization? method for all CCGO objects - initially empty

Location:
proto/Compiler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/CCGO.py

    r2799 r2801  
    3333    def GenerateTestAll(self, instance_name): return ast.Num(0)
    3434    def GenerateCarryIfTest(self, block_no, ifTest): return ifTest
     35    def GenerateCarryThenFinalization(self, block_no): return []
    3536    def GenerateCarryElseFinalization(self, block_no): return []
    3637    def GenerateLocalDeclare(self, block_no): return []
  • proto/Compiler/CCGO_HMCPS.py

    r2800 r2801  
    552552
    553553    def allocate_all(self):
    554         self.aligned_size = determine_aligned_block_sizes(self.field_count, self.carryInfoSet)
     554        self.aligned_size = determine_aligned_block_sizes(self.field_count, self.carryInfoSet, min_block_size = 8)
    555555        self.carryPack_count = (self.aligned_size[0] + self.BLOCK_SIZE - 1) / self.BLOCK_SIZE
    556556        self.totalPack_count = self.carryPack_count + self.carryInfoSet.adv_n_count
     
    675675
    676676#
    677 #  TO DO:
    678 #
    679677    def GenerateCarryWhileFinalization(self, block_no):
    680678        posn = self.block_base[block_no]
  • proto/Compiler/pablo.py

    r2800 r2801  
    473473    if self.carryin == "": new_test = ifNode.test
    474474    else: new_test = self.ccgo.GenerateCarryIfTest(this_block, ifNode.test)
     475    new_then_part = ifNode.body + self.ccgo.GenerateCarryThenFinalization(this_block)
    475476    new_else_part = ifNode.orelse + self.ccgo.GenerateCarryElseFinalization(this_block)
    476     newIf = ast.If(new_test, ifNode.body, new_else_part)
     477    newIf = ast.If(new_test, new_then_part, new_else_part)
    477478    self.last_stmt = newIf
    478479    self.last_stmt_carries = carries
Note: See TracChangeset for help on using the changeset viewer.