summaryrefslogtreecommitdiffstats
path: root/content/zettel/1c6e.md
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-05-11 19:38:03 +0100
committerYann Herklotz <git@yannherklotz.com>2023-05-11 19:38:03 +0100
commit47c1289ff658a5aec71635d79ffe30bb29a07876 (patch)
tree56cf6b959e37fed88c492d34defd3d7ec40e7148 /content/zettel/1c6e.md
parentfbe0fc62120348f582dc4db2b614078943d0764b (diff)
downloadzk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.tar.gz
zk-web-47c1289ff658a5aec71635d79ffe30bb29a07876.zip
Add content
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.