@jqgregory Is there a more detailed explanation somewhere of the "pipeline stall" discussed in this passage from your book? I was asked about it, and I can't think of anything to which it could be referring. (https://imgur.com/76F458o )
[1/2] Does Alexandrescu have an explanation somewhere? That slide set doesn't really talk about it. I am having a very hard time convincing myself that there is a practical scenario where a[++i] compiles to a pipeline stall but a[i++] does not...
-
-
[2/2] I can believe some compilers would better handle a[0] a[1] a+=2 than a[i++] a[i++], but a[++i] vs. a[i++] I can't really think of how the compiler would reliably produce more stalls with one than the other.
-
Preincrement introduces a data hazard, because you need to wait for ++a to be calculated before it can be used. Whereas the value of a++ can be used immediately, while the increment op makes its way thru the pipeline sans data hazard.
- 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.
