summaryrefslogtreecommitdiffstats
path: root/content/zettel/1c6e.md
diff options
context:
space:
mode:
Diffstat (limited to 'content/zettel/1c6e.md')
-rw-r--r--content/zettel/1c6e.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/zettel/1c6e.md b/content/zettel/1c6e.md
new file mode 100644
index 0000000..ac07ade
--- /dev/null
+++ b/content/zettel/1c6e.md
@@ -0,0 +1,24 @@
++++
+title = "Speculation does not have a cost"
+date = "2022-04-29"
+author = "Yann Herklotz"
+tags = []
+categories = []
+backlinks = ["1c6d"]
+forwardlinks = []
+zettelid = "1c6e"
++++
+
+It is interesting to note that speculating on an instruction does not
+really incur a cost in itself. The idea is that if one is always wrong
+with the speculation, one really only reverts back to the non-pipelined
+instructions. So in the worst case one is only sequential. However, if
+one speculates, then it is highly unlikely that one is always wrong, and
+one will therefore always benefit from it.
+
+Therefore, in the speculative loop pipelining, it does not really matter
+in the end which instructions are picked to speculate on, and often the
+most efficient will be the shortest path in the pipeline. For example,
+Steven showed that even when one speculates on a binary search algorithm
+to two iterations (where one then has a 25% chance of being right), one
+still benefits from speculating going into one of the directions.