guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 01/06: Fix ARMv7 THUMB encoding for immediates.


From: Ludovic Courtès
Subject: [Guile-commits] 01/06: Fix ARMv7 THUMB encoding for immediates.
Date: Sun, 21 Jun 2020 09:14:47 -0400 (EDT)

civodul pushed a commit to branch master
in repository guile.

commit 1bb909a44d2303f88bb05125fc6742e97f80cd1d
Author: Andrew Gierth <andrew@tao11.riddles.org.uk>
AuthorDate: Fri Jun 19 17:07:34 2020 +0100

    Fix ARMv7 THUMB encoding for immediates.
    
    * lightening/arm-cpu.c (encode_thumb_immediate): Fix return value in
    third case.
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 lightening/arm-cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lightening/arm-cpu.c b/lightening/arm-cpu.c
index 4445266..2b4eecc 100644
--- a/lightening/arm-cpu.c
+++ b/lightening/arm-cpu.c
@@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
     return ((v & 0xff) | (1 << 12));
   /* abcdefgh 00000000 abcdefgh 00000000 */
   if (((v & 0xffff0000) >> 16) == (v & 0xffff) && (v & 0xff) == 0)
-    return ((v & 0x000000ff) | (2 << 12));
+    return (((v & 0x0000ff00) >> 8) | (2 << 12));
   /* abcdefgh abcdefgh abcdefgh abcdefgh */
   if ( (v &    0xff)        == ((v &     0xff00) >>  8) &&
        ((v &   0xff00) >> 8) == ((v &   0xff0000) >> 16) &&



reply via email to

[Prev in Thread] Current Thread [Next in Thread]