19 "reduction operand bitvector shall have width at least one");
21 enum { O_OR, O_AND, O_XOR } op;
25 if(
id==ID_reduction_or ||
id==ID_reduction_nor)
27 else if(
id==ID_reduction_and ||
id==ID_reduction_nand)
29 else if(
id==ID_reduction_xor ||
id==ID_reduction_xnor)
36 for(std::size_t i=1; i<op_bv.size(); i++)
40 case O_OR: l=
prop.
lor(l, op_bv[i]);
break;
41 case O_AND: l=
prop.
land(l, op_bv[i]);
break;
42 case O_XOR: l=
prop.
lxor(l, op_bv[i]);
break;
46 if(
id==ID_reduction_nor ||
47 id==ID_reduction_nand ||
48 id==ID_reduction_xnor)
60 "reduction operand bitvector shall have width at least one");
62 enum { O_OR, O_AND, O_XOR } op;
66 if(
id==ID_reduction_or ||
id==ID_reduction_nor)
68 else if(
id==ID_reduction_and ||
id==ID_reduction_nand)
70 else if(
id==ID_reduction_xor ||
id==ID_reduction_xnor)
77 if(op_type.
id()!=ID_verilog_signedbv ||
78 op_type.
id()!=ID_verilog_unsignedbv)
81 (expr.
type().
id() == ID_verilog_signedbv ||
82 expr.
type().
id() == ID_verilog_unsignedbv) &&
90 for(std::size_t i=2; i<op_bv.size(); i+=2)
109 if(
id==ID_reduction_nor ||
110 id==ID_reduction_nand ||
111 id==ID_reduction_xnor)
Pre-defined bitvector types.
const bitvector_typet & to_bitvector_type(const typet &type)
Cast a typet to a bitvector_typet.
std::size_t get_width() const
virtual const bvt & convert_bv(const exprt &expr, const std::optional< std::size_t > expected_width={})
Convert expression to vector of literalts, using an internal cache to speed up conversion if availabl...
virtual literalt convert_reduction(const unary_exprt &expr)
virtual bvt convert_bv_reduction(const unary_exprt &expr)
bvt conversion_failed(const exprt &expr)
Print that the expression of x has failed conversion, then return a vector of x's width.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
typet & type()
Return the type of the expression.
const irep_idt & id() const
virtual literalt land(literalt a, literalt b)=0
virtual literalt lselect(literalt a, literalt b, literalt c)=0
virtual literalt lxor(literalt a, literalt b)=0
virtual literalt lor(literalt a, literalt b)=0
The type of an expression, extends irept.
Generic base class for unary expressions.
std::vector< literalt > bvt
literalt const_literal(bool value)
#define UNREACHABLE
This should be used to mark dead code.