示例#1
0
 def exprEqual(self, expr, e):
     expr = EX.eval_expr(expr, self.use_esf)
     if self.use_esf:
         expand_esf_inplace(expr.vec)
         simplify_inplace(expr.vec)
     simplify_inplace(e.vec)
     simplify_inplace(expr.vec)
     self.assertEqual(expr, e)
示例#2
0
 def compute(self, vec, i, args, ctx, use_esf):
     if ((self.mask >> i) & 1) == 1:
         return imm(1)
     args = list(args)
     ret = esf(1, args)
     for i in range(2, len(args) + 1):
         ret += esf(i, args)
     if not use_esf:
         expand_esf_inplace(ret)
         simplify_inplace(ret)
     return ret
示例#3
0
    def compute_binop_(vec, i, X, Y, CC, use_esf):
        carry = CC.carry

        sum_args = simplify_inplace(X + Y)
        ret = simplify_inplace(sum_args + carry)
        carry = esf(2, [X + imm(1), Y, carry])
        if not use_esf:
            expand_esf_inplace(carry)
            carry = simplify_inplace(carry)

        CC.carry = carry
        return ret
示例#4
0
    def compute_binop_(vec, i, X, Y, CC, use_esf):
        carry = CC.carry

        sum_args = simplify_inplace(X + Y)
        ret = simplify_inplace(sum_args + carry)
        # TODO: optimize this like in mba_if
        carry = esf(2, [X, Y, carry])
        if not use_esf:
            expand_esf_inplace(carry)
            simplify_inplace(carry)

        CC.carry = carry
        return ret