Wed Jan 24 21:00:40 CET 2007 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 24 Jan 2007 20:01:27 +0000 (20:01 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 24 Jan 2007 20:01:27 +0000 (20:01 -0000)
* arm/arm-codegen.h: fixed encoding of short/byte load/store
instructions with negative immediate offsets.

svn path=/trunk/mono/; revision=71622

mono/arch/ChangeLog
mono/arch/arm/arm-codegen.h

index 6aa593a133d97899f59b211a1f49423d8bd7d612..b6ae4d7c4afd05058423837566b7a17428980877 100644 (file)
@@ -1,4 +1,9 @@
 
+Wed Jan 24 21:00:40 CET 2007 Paolo Molaro <lupus@ximian.com>
+
+       * arm/arm-codegen.h: fixed encoding of short/byte load/store
+       instructions with negative immediate offsets.
+
 Mon Nov 20 17:36:45 CET 2006 Paolo Molaro <lupus@ximian.com>
 
        * arm/arm-codegen.h: added suppot for thumb interworking instructions.
index 41c4a93b6b4264c0cd14f5c1ab43e4b11e23fd85..d8c293a5fc839ac34f7721056e2dcaed34ba6125 100644 (file)
@@ -737,10 +737,10 @@ typedef struct {
 #define ARM_HXFER_TAG ((ARM_HXFER_ID << 25) | (ARM_HXFER_ID2 << 7) | (ARM_HXFER_ID3 << 4))
 
 #define ARM_DEF_HXFER_IMM_COND(imm, h, s, rd, rn, ls, wb, p, cond) \
-       ((imm) & 0xF)               | \
+       ((imm) < 0?(-(imm)) & 0xF:(imm) & 0xF)               | \
        ((h) << 5)                  | \
        ((s) << 6)                  | \
-       (((imm) << 4) & (0xF << 8)) | \
+       ((imm) < 0?((-(imm)) << 4) & 0xF00:((imm) << 4) & 0xF00) | \
        ((rd) << 12)                | \
        ((rn) << 16)                | \
        ((ls) << 20)                | \