checks: Add additional carry checks - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Cercueil <paul@crapouillou.net>2024年04月30日 15:34:26 +0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2024年04月30日 11:06:38 -0300
commitec02f673ded7d8a962b62a9911a940a5c9f9c81a (patch)
tree04405a3a6ab0b33f52ed83979d9377c43ad63bf5
parent7ca09037aab05465899d49625bb2fb16d0275707 (diff)
downloadlightning-ec02f673ded7d8a962b62a9911a940a5c9f9c81a.tar.gz
checks: Add additional carry checks
A substraction that results in a value with a different sign than the operands is not necesarily an underflow / overflow. For instance, these two substractions don't cause any underflow / overflow: 0 - 2 == -ひく2 -ひく1 -ひく -ひく1 == 0 Add two new checks to verify that the implementations are compliant. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Diffstat
-rw-r--r--check/carry.tst 2
1 files changed, 2 insertions, 0 deletions
diff --git a/check/carry.tst b/check/carry.tst
index 180d896..615d964 100644
--- a/check/carry.tst
+++ b/check/carry.tst
@@ -136,6 +136,8 @@ ok:
fadd(__LINE__, , r0, r1, x7fe, x1, x7f)
tsub(__LINE__, , r0, r1, x80, x1, x7f)
fsub(__LINE__, , r0, r1, x7f, x1, x7fe)
+ fsub(__LINE__, , r0, r1, x0, x1, ff)
+ fsub(__LINE__, , r0, r1, ff, ff, x0)
tadd(__LINE__, _u, r0, r1, ff, x1, x0)
fadd(__LINE__, _u, r0, r1, x7f, x1, x80)
tsub(__LINE__, _u, r0, r1, x0, x1, ff)
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月08日 12:06:56 +0000

AltStyle によって変換されたページ (->オリジナル) /