int bid_fetestexcept( int excepts _EXC_FLAGS_PARAM ) { /* Take only supported exceptions */ excepts &= DEC_FE_ALL_EXCEPT; return get_bid_sw() & excepts; }
void bid_feclearexcept( int excepts _EXC_FLAGS_PARAM ) { _IDEC_flags new_sw; /* Take only supported exceptions */ excepts &= DEC_FE_ALL_EXCEPT; if (excepts) { /* Do we have anyting to do? */ new_sw = get_bid_sw() & ~excepts; // set BID status word set_bid_sw(new_sw); } }
void bid_fegetexceptflag( fexcept_t *flagp, int excepts _EXC_FLAGS_PARAM ) { _IDEC_flags new_sw; /* Take only supported exceptions */ excepts &= DEC_FE_ALL_EXCEPT; if( excepts ) { /* Do we have anything to do? */ /* Erase the old state of specified exception flags */ *flagp &= ~excepts; /* Read status word */ new_sw = get_bid_sw(); /* Store the current state of specified exception flags */ *flagp |= new_sw & excepts; } }