Changeset 2787


Ignore:
Timestamp:
Dec 17, 2012, 9:05:39 AM (6 years ago)
Author:
cameron
Message:

Update HMCGS_CCGO2 for @any_carry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/CCGO_HMCPS.py

    r2786 r2787  
    208208#    while finalize  carry combine:   round up and |= into structure
    209209#
    210     def carry_pack_full(self, ub, mode = ast.Load()):
    211        return make_att(make_index(self.carryGroupVar, ub), '_128', mode)
     210    def carry_pack_full(self, ub, v = None, mode = ast.Load()):
     211       if v == None: v = self.carryGroupVar
     212       return make_att(make_index(v, ub), '_128', mode)
    212213
    213214    def carry_pack_index(self, fw, ub, rp, mode = ast.Load()):
     
    215216
    216217    def local_pack_full(self, ub, mode = ast.Load()):
    217        return make_att(make_index("sub" + self.carryGroupVar, ub), '_128', mode)
     218       return self.carry_pack_full(ub, "sub" + self.carryGroupVar, mode)
    218219
    219220
     
    355356          shift_op = "simd<%i>::srli<%i>" % (self.fw, self.fw-1)
    356357          storable_carry_in_form = make_call(shift_op, [mk_var(self.cg_temp(self.field_count - 1, 0))])
    357           assigs.append(make_assign(self.carry_pack_full(ub, ast.Store()), storable_carry_in_form))
     358          assigs.append(make_assign(self.carry_pack_full(ub, mode = ast.Store()), storable_carry_in_form))
    358359        return assigs
    359360    def GenerateAdvanceInAccess(self, operation_no): pass
     
    368369        if self.ubitblock_count == 0: return ast.Num(0)
    369370        else:
    370             t = make_att(make_index(make_att(instance_name, self.carryGroupVar), 0), '_128')
     371            v = make_att(instance_name, self.carryGroupVar)
     372            t = self.carry_pack_full(0, v)
    371373            for i in range(1, self.ubitblock_count):
    372               t2 = make_att(make_index(make_att(instance_name, self.carryGroupVar), i), '_128')
     374              t2 = self.carry_pack_full(i, v)
    373375              t = make_call('simd_or', [t, t2])
    374376            return make_call('bitblock::any', [t])
     
    410412          shift_op = "simd<%i>::srli<%i>" % (self.fw, self.fw-1)
    411413          storable_carry_in_form = make_call(shift_op, [mk_var(self.cg_temp(self.field_count - 1, 0))])
    412           assigs.append(make_assign(self.carry_pack_full(ub, ast.Store()), storable_carry_in_form))
     414          assigs.append(make_assign(self.carry_pack_full(ub, mode = ast.Store()), storable_carry_in_form))
    413415        return assigs
    414416
     
    457459        assigs = []
    458460        for i in range(n):
    459           assigs.append(make_assign(self.carry_pack_full(ub + i, ast.Store()), make_call('simd_or', [self.carry_pack_full(ub + i), self.local_pack_full(i)])))
     461          assigs.append(make_assign(self.carry_pack_full(ub + i, mode = ast.Store()), make_call('simd_or', [self.carry_pack_full(ub + i), self.local_pack_full(i)])))
    460462        return assigs
    461463    def GenerateStreamFunctionFinalization(self):
     
    467469class HMCPS_CCGO2(HMCPS_CCGO):
    468470
    469     def carry_pack_full(self, ub, mode = ast.Load()):
    470        return make_index(self.carryGroupVar, ub, mode)
     471    def carry_pack_full(self, ub, v = None, mode = ast.Load()):
     472       if v == None: v = self.carryGroupVar
     473       return make_index(v, ub, mode)
    471474
    472475    def carry_pack_index(self, fw, ub, rp, mode = ast.Load()):
    473476       return make_call("mvmd<%i>::extract<%i>" % (fw, rp), [self.carry_pack_full(ub)])
    474 
    475     def local_pack_full(self, ub, mode = ast.Load()):
    476        return make_index("sub" + self.carryGroupVar, ub, mode)
    477477
    478478    def GenerateCarryDecls(self):
Note: See TracChangeset for help on using the changeset viewer.