ARM: Fix storing bytes in the stack frame.

* lib/arm-mes/arm.M1 (strb___%r0,0x8(%ebp)): Rename to...
(strb___%r0,(%fp,+#$i8)): ... this.
(strb___%r0,(%fp,-#$i8)): New macro.
* module/mescc/armv4/as.scm (armv4:byte-r->local+n): Use them.
This commit is contained in:
Danny Milosavljevic 2019-04-12 17:44:28 +02:00 committed by Jan Nieuwenhuizen
parent cf0c7db11f
commit b9b744001a
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 7 additions and 2 deletions

View File

@ -248,7 +248,8 @@ DEFINE strb___%r1,(%r1) 0010c1e5 # strb r1, [r1]
DEFINE strb___%r2,(%r2) 0020c2e5 # strb r2, [r2]
DEFINE strb___%r3,(%r3) 0030c3e5 # strb r3, [r3]
DEFINE strb___%r4,(%r4) 0040c4e5 # strb r4, [r4]
DEFINE strb___%r0,0x8(%ebp) 00cbe5 # strb r0, [fp, #xx]
DEFINE strb___%r0,(%fp,+#$i8) 00cbe5 # strb r0, [fp, +#xx]
DEFINE strb___%r0,(%fp,-#$i8) 004be5 # strb r0, [fp, -#xx]
DEFINE strh___%r0,(%r0) b000c0e1 # strh r0, [r0]
DEFINE strh___%r1,(%r1) b010c1e1 # strh r1, [r1]
DEFINE strh___%r2,(%r2) b020c2e1 # strh r2, [r2]

View File

@ -463,7 +463,11 @@
(let* ((n (+ (- 0 (* 4 id)) n))
(r (get-r info)))
`(,(if (< (abs n) #x80)
`((#:immediate1 ,n) ,(string-append "strb___%" r ",0x8(%ebp)"))
(if (< n 0)
`((#:immediate1 ,(abs n))
,(string-append "strb___%" r ",(%fp,-#$i8)"))
`((#:immediate1 ,n)
,(string-append "strb___%" r ",(%fp,+#$i8)")))
`(,(string-append "strb___%" r ",0x32(%ebp)") (#:immediate ,n))))))
(define (armv4:word-r->local+n info id n)