Exemple #1
0
 def optimize_INT_SIGNEXT(self, op):
     b = self.getintbound(op.getarg(0))
     numbits = op.getarg(1).getint() * 8
     start = -(1 << (numbits - 1))
     stop = 1 << (numbits - 1)
     bounds = IntBound(start, stop - 1)
     if bounds.contains_bound(b):
         self.make_equal_to(op, op.getarg(0))
     else:
         return self.emit(op)
Exemple #2
0
 def optimize_INT_SIGNEXT(self, op):
     b = self.getintbound(op.getarg(0))
     numbits = op.getarg(1).getint() * 8
     start = -(1 << (numbits - 1))
     stop = 1 << (numbits - 1)
     bounds = IntBound(start, stop - 1)
     if bounds.contains_bound(b):
         self.make_equal_to(op, op.getarg(0))
     else:
         return self.emit(op)
Exemple #3
0
 def optimize_INT_SIGNEXT(self, op):
     value = self.getvalue(op.getarg(0))
     numbits = op.getarg(1).getint() * 8
     start = -(1 << (numbits - 1))
     stop = 1 << (numbits - 1)
     bounds = IntBound(start, stop - 1)
     if bounds.contains_bound(value.getintbound()):
         self.make_equal_to(op.result, value)
     else:
         self.emit_operation(op)
         vres = self.getvalue(op.result)
         vres.getintbound().intersect(bounds)
Exemple #4
0
 def optimize_INT_SIGNEXT(self, op):
     b = self.getintbound(op.getarg(0))
     numbits = op.getarg(1).getint() * 8
     start = -(1 << (numbits - 1))
     stop = 1 << (numbits - 1)
     bounds = IntBound(start, stop - 1)
     if bounds.contains_bound(b):
         self.make_equal_to(op, op.getarg(0))
     else:
         self.emit_operation(op)
         bres = self.getintbound(op)
         bres.intersect(bounds)
Exemple #5
0
 def optimize_INT_SIGNEXT(self, op):
     b = self.getintbound(op.getarg(0))
     numbits = op.getarg(1).getint() * 8
     start = -(1 << (numbits - 1))
     stop = 1 << (numbits - 1)
     bounds = IntBound(start, stop - 1)
     if bounds.contains_bound(b):
         self.make_equal_to(op, op.getarg(0))
     else:
         self.emit_operation(op)
         bres = self.getintbound(op)
         bres.intersect(bounds)