Exemplo n.º 1
0
 def pack_load(self, vec_reg_size):
     """ Returns the load of the pack a vector register would hold
         just after executing the operation.
         returns: < 0 - empty, nearly empty
                  = 0 - full
                  > 0 - overloaded
     """
     left = self.leftmost()
     if left.returns_void():
         if rop.is_primitive_store(left.opnum):
             # make this case more general if it turns out this is
             # not the only case where packs need to be trashed
             descr = left.getdescr()
             bytesize = descr.get_item_size_in_bytes()
             return bytesize * self.numops() - vec_reg_size
         else:
             assert left.is_guard() and left.getopnum() in \
                    (rop.GUARD_TRUE, rop.GUARD_FALSE)
             vecinfo = forwarded_vecinfo(left.getarg(0))
             bytesize = vecinfo.bytesize
             return bytesize * self.numops() - vec_reg_size
         return 0
     if self.numops() == 0:
         return -1
     if left.is_typecast():
         # casting is special, often only takes a half full vector
         if left.casts_down():
             # size is reduced
             size = left.cast_input_bytesize(vec_reg_size)
             return left.cast_from_bytesize() * self.numops() - size
         else:
             # size is increased
             #size = left.cast_input_bytesize(vec_reg_size)
             return left.cast_to_bytesize() * self.numops() - vec_reg_size
     vecinfo = forwarded_vecinfo(left)
     return vecinfo.bytesize * self.numops() - vec_reg_size
Exemplo n.º 2
0
 def pack_load(self, vec_reg_size):
     """ Returns the load of the pack a vector register would hold
         just after executing the operation.
         returns: < 0 - empty, nearly empty
                  = 0 - full
                  > 0 - overloaded
     """
     left = self.leftmost()
     if left.returns_void():
         if rop.is_primitive_store(left.opnum):
             # make this case more general if it turns out this is
             # not the only case where packs need to be trashed
             descr = left.getdescr()
             bytesize = descr.get_item_size_in_bytes()
             return bytesize * self.numops() - vec_reg_size
         else:
             assert left.is_guard() and left.getopnum() in \
                    (rop.GUARD_TRUE, rop.GUARD_FALSE)
             vecinfo = forwarded_vecinfo(left.getarg(0))
             bytesize = vecinfo.bytesize
             return bytesize * self.numops() - vec_reg_size
         return 0
     if self.numops() == 0:
         return -1
     if left.is_typecast():
         # casting is special, often only takes a half full vector
         if left.casts_down():
             # size is reduced
             size = left.cast_input_bytesize(vec_reg_size)
             return left.cast_from_bytesize() * self.numops() - size
         else:
             # size is increased
             #size = left.cast_input_bytesize(vec_reg_size)
             return left.cast_to_bytesize() * self.numops() - vec_reg_size
     vecinfo = forwarded_vecinfo(left)
     return vecinfo.bytesize * self.numops() - vec_reg_size
Exemplo n.º 3
0
 def opcount_filling_vector_register(self, op, vec_reg_size):
     assert rop.is_primitive_store(op.opnum)
     descr = op.getdescr()
     return vec_reg_size // descr.get_item_size_in_bytes()
Exemplo n.º 4
0
 def opcount_filling_vector_register(self, op, vec_reg_size):
     assert rop.is_primitive_store(op.opnum)
     descr = op.getdescr()
     return vec_reg_size // descr.get_item_size_in_bytes()