aboutsummaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ChangeLog4
-rw-r--r--cpu/xstormy16.cpu2
2 files changed, 5 insertions, 1 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index c5a44ab..688c596 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-16 Alan Modra <amodra@gmail.com>
+
+ * xstormy16.cpu (f-rel12a): Avoid signed overflow.
+
2019-12-11 Alan Modra <amodra@gmail.com>
* epiphany.cpu (f-sdisp11): Don't sign extend with shifts.
diff --git a/cpu/xstormy16.cpu b/cpu/xstormy16.cpu
index ae7e042..aa5a464 100644
--- a/cpu/xstormy16.cpu
+++ b/cpu/xstormy16.cpu
@@ -393,7 +393,7 @@
(length 11)
(mode INT)
(encode (value pc) (sra SI (sub SI value (add SI pc 2)) 1))
- (decode (value pc) (add SI (sll value 1) (add SI pc 2)))
+ (decode (value pc) (add SI (mul value 2) (add SI pc 2)))
)
(dnop rel12a "12 bit relative address" () h-uint f-rel12a)