aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2017-02-15 12:33:42 -0800
committerAndrew Waterman <andrew@sifive.com>2017-02-15 12:33:42 -0800
commit1efca13c0b75caa358a86a00a62fad77556acefe (patch)
tree3330aeeed5a897df1e654b60ac8b03a60127f368 /src
parentaa0915932e79278ab63352713792a7a5e120b33e (diff)
downloadriscv-isa-manual-1efca13c0b75caa358a86a00a62fad77556acefe.zip
riscv-isa-manual-1efca13c0b75caa358a86a00a62fad77556acefe.tar.gz
riscv-isa-manual-1efca13c0b75caa358a86a00a62fad77556acefe.tar.bz2
Add signed array bounds comparison note
Diffstat (limited to 'src')
-rw-r--r--src/rv32.tex5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rv32.tex b/src/rv32.tex
index bc84ac5..c1571ae 100644
--- a/src/rv32.tex
+++ b/src/rv32.tex
@@ -788,6 +788,11 @@ using signed and unsigned comparison respectively. Note, BGT, BGTU,
BLE, and BLEU can be synthesized by reversing the operands to BLT,
BLTU, BGE, and BGEU, respectively.
+\begin{commentary}
+Signed array bounds may be checked with a single BLTU instruction, since
+any negative index will compare greater than any nonnegative bound.
+\end{commentary}
+
Software should be optimized such that the sequential code path is the
most common path, with less-frequently taken code paths placed out of
line. Software should also assume that backward branches will be