MCPcopy Create free account
hub / github.com/AliveToolkit/alive2 / isNaNInt

Method isNaNInt

ir/type.cpp:550–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550bool FloatType::isNaNInt(const expr &e) const {
551 if (!e.isValid())
552 return false;
553
554 // expr var = s.getFreshNondetVar("#NaN", expr::mkUInt(0, 2));
555 // var.sign().concat(expr::mkInt(-1, exp_bits)).concat(fraction)
556 auto bw = bits();
557
558 expr exponent = e.extract(bw - 2, fractionBits());
559 assert(exponent.bits() == expBits());
560
561 expr nan;
562 unsigned h, l;
563 return exponent.isAllOnes() &&
564 e.sign().isExtract(nan, h, l) &&
565 h == 1 && h == 1 &&
566 nan.fn_name().starts_with("#NaN");
567}
568
569expr FloatType::sizeVar() const {
570 return defined ? expr::mkUInt(bits(), var_bw_bits) : Type::sizeVar();

Callers

nothing calls this directly

Calls 7

isAllOnesMethod · 0.80
isExtractMethod · 0.80
signMethod · 0.80
fn_nameMethod · 0.80
isValidMethod · 0.45
extractMethod · 0.45
bitsMethod · 0.45

Tested by

no test coverage detected