Example #1
0
def _uitofp(term, smt):
  v = smt.eval(term.arg)
  src = smt.type(term.arg)
  tgt = smt.type(term)

  w = 2**(tgt.exp-1)

  if src.width >= w:
    m = 2**w
    conds = [z3.ULE(v, m)]
  else:
    conds = []

  return smt._conditional_conv_value(conds,
    z3.fpToFPUnsigned(z3.get_default_rounding_mode(), v, _ty_sort(tgt)),
    term.name)
Example #2
0
def _uitofp(term, smt):
  v = smt.eval(term.arg)
  src = smt.type(term.arg)
  tgt = smt.type(term)

  w = 2**(tgt.exp-1)

  if src.width >= w:
    m = 2**w
    conds = [z3.ULE(v, m)]
  else:
    conds = []

  return smt._conditional_conv_value(conds,
    z3.fpToFPUnsigned(z3.get_default_rounding_mode(), v, _ty_sort(tgt)),
    term.name)
Example #3
0
def _uitofp(term, smt):
  x = smt.eval(term._args[0])
  tgt = smt.type(term)

  return z3.fpToFPUnsigned(z3.RTZ(), x, _ty_sort(tgt))
Example #4
0
def _uitofp(term, smt):
    x = smt.eval(term._args[0])
    tgt = smt.type(term)

    return z3.fpToFPUnsigned(z3.RTZ(), x, _ty_sort(tgt))