Users of ApInt may often have the need to check an ApInt instance for additive or multiplicative neutral elements. Currently users would need to create an ApInt with an equivalent bit width representing either 1 or 0 and compare it to their instance. This may be inefficient.
Adding ApInt::is_zero and ApInt::is_one allows for efficient alternatives in these situations.
Users of
ApInt
may often have the need to check anApInt
instance for additive or multiplicative neutral elements. Currently users would need to create anApInt
with an equivalent bit width representing either1
or0
and compare it to their instance. This may be inefficient.Adding
ApInt::is_zero
andApInt::is_one
allows for efficient alternatives in these situations.