ARM: Fix multiplication.
* lib/arm-mes/arm.M1: Delete "mul____%r1" macro. Add "mul____%r1,%r0" and "mul____%r0,%r1" macros. * module/mescc/armv4/as.scm (armv4:r0*r1): Use them.
This commit is contained in:
parent
311a955b0b
commit
c4c94d68fe
|
@ -248,7 +248,8 @@ DEFINE SYS_getcwd b70090
|
|||
|
||||
# These are x86 ABI remnants:
|
||||
|
||||
DEFINE mul____%r1 910089e0 # umull r0, r9, r1, r0
|
||||
DEFINE mul____%r1,%r0 910089e0 # umull r0, r9, r1, r0
|
||||
DEFINE mul____%r0,%r1 910089e0 # umull r0, r9, r1, r0
|
||||
DEFINE mov____%ebp,%r0 0b00a0e1
|
||||
DEFINE mov____%ebp,%r1 0b10a0e1
|
||||
DEFINE push___%ebp 04b02de5 # str fp, [sp, #-4]!
|
||||
|
|
|
@ -312,27 +312,10 @@
|
|||
((#:immediate1 ,(* n 4)) "add____$i8,%esp"))))
|
||||
|
||||
(define (armv4:r0*r1 info)
|
||||
(let ((allocated (.allocated info))
|
||||
(r0 (get-r0 info))
|
||||
;; FIXME: Signedness.
|
||||
(let ((r0 (get-r0 info))
|
||||
(r1 (get-r1 info)))
|
||||
(if (not (member "edx" allocated)) ; FIXME
|
||||
`(,@(if (equal? r0 "r0") '()
|
||||
`(("push___%r0")
|
||||
(,(string-append "mov____%" r0 ",%r0"))))
|
||||
(,(string-append "mul____%" r1))
|
||||
,@(if (equal? r0 "r0") '()
|
||||
`((,(string-append "mov____%r0,%" r0))
|
||||
("pop____%r0"))))
|
||||
`(("push___%r0")
|
||||
("push___%r1")
|
||||
("push___%edx")
|
||||
(,(string-append "mov____%" r1 ",%r1"))
|
||||
(,(string-append "mov____%" r0 ",%r0"))
|
||||
(,(string-append "mul____%" r1))
|
||||
("pop____%edx")
|
||||
("pop____%r1")
|
||||
(,(string-append "mov____%r0,%" r0))
|
||||
("pop____%r0")))))
|
||||
`((,(string-append "mul____%" r0 ",%" r1)))))
|
||||
|
||||
(define (armv4:r0<<r1 info)
|
||||
(let ((r0 (get-r0 info))
|
||||
|
|
Loading…
Reference in New Issue