This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] fix m32c operand shift
- From: DJ Delorie <dj at delorie dot com>
- To: binutils at sourceware dot org
- Date: Sat, 3 Jul 2010 00:10:23 -0400
- Subject: [patch] fix m32c operand shift
Applied.
* m32c.cpu (f-dsp-8-s24): Mask high byte after shifting it.
* m32c-ibld.c: Regenerate.
Index: cpu/m32c.cpu
===================================================================
RCS file: /cvs/src/src/cpu/m32c.cpu,v
retrieving revision 1.18
diff -p -U3 -r1.18 m32c.cpu
--- cpu/m32c.cpu 6 Jan 2010 05:30:18 -0000 1.18
+++ cpu/m32c.cpu 3 Jul 2010 04:08:42 -0000
@@ -572,10 +572,10 @@
)
(df f-dsp-8-s24 "24 bit signed" (all-isas) 8 24 INT
((value pc) (or SI
- (or (srl value 16) (and value #xff00))
+ (or (and (srl value 16) #xff) (and value #xff00))
(sll (ext INT (trunc QI (and value #xff))) 16)))
((value pc) (or SI
- (or (srl value 16) (and value #xff00))
+ (or (and (srl value 16) #xff) (and value #xff00))
(sll (ext INT (trunc QI (and value #xff))) 16)))
)