This is such a tremendous pain in the ass. Most code that has to do an "if this isn't zero, then divide" could be written to "just work" if it could generally assume that the CSRs were always set to flush. But they can't, because it usually isn't.
-
-
In ASM you can work around some of these. In the previous example, you could presumably move the divide below the top jnz for the for loop, and have the bottom jnz jump back to after the divide, etc., so maybe it "costs you nothing" to do.
-
In C, on the other hand, you pretty much just have to manually type out additional if's every time. So you're going to always write if(Count) { int Step = Width / Count; for(int I = 0; I < Count; ++I) { // ... Step used here ... } } for no good reason.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
)