5 ms·
Great observation! That's a compuational mode we are discussing. It's actually trivial to implement.
by dnautics 9y ago
Great observation! That's a compuational mode we are discussing. It's actually trivial to implement.
- cesarb 9y agoAnother option could be to borrow a trick from floating point, and have a separate status register with bits that represent the kinds of errors encountered. Before a many-step calculation, software could clear these bits, and if any of them is set after the calculation, there was an error somewhere. Of course, since you don't have a NaN, you have to specify the bit pattern which will be returned by each kind of failing operation (like RISC-V does with integer divide by zero). That doesn't help if the result could be partially valid, but if a "square root of minus one" or similar anywhere in the calculation means the result is invalid (and would be a NaN under floating point), sticky error bits in a status register could be sufficient.
- dnautics 9y agoquestion: How do you access this status register using standard C? (because if you can't, basically no one will use it)