This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
GCC-SH: fix muls.w and mulu.w mnemonics
- To: gcc-patches at gcc dot gnu dot org
- Subject: GCC-SH: fix muls.w and mulu.w mnemonics
- From: Toshi Morita <tm2 at best dot com>
- Date: Tue, 6 Mar 2001 14:09:25 -0800 (PST)
This patch should go into the gcc-3.0 branch, but not 2.95.x.
Historically, GCC has misspelled two Hitachi SH instructions: muls.w and mulu.w.
Joern and I agreed that these should be fixed a while back for the GCC-3.0 release.
The patches to support muls.w and mulu.w were applied to binutils a while
back, so it should be safe for GCC-3.0 to use these now.
Tue Mar 6 13:56:56 PST 2001 Toshiyasu Morita (toshiyasu.morita@hsa.hitachi.com)
* config/sh/sh.md (umulhisi3_i, mulhisi3_i): Fix mnemonics.
* config/sh/lib1funcs.asm (mulsi3): Convert mulu to mulu.w.
*** sh.md.bak Tue Mar 6 13:51:03 2001
--- sh.md Tue Mar 6 13:51:30 2001
***************
*** 1160,1166 ****
(zero_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
! "mulu %1,%0"
[(set_attr "type" "smpy")])
(define_insn "mulhisi3_i"
--- 1160,1166 ----
(zero_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
! "mulu.w %1,%0"
[(set_attr "type" "smpy")])
(define_insn "mulhisi3_i"
***************
*** 1170,1176 ****
(sign_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
! "muls %1,%0"
[(set_attr "type" "smpy")])
(define_expand "mulhisi3"
--- 1170,1176 ----
(sign_extend:SI
(match_operand:HI 1 "arith_reg_operand" "r"))))]
""
! "muls.w %1,%0"
[(set_attr "type" "smpy")])
(define_expand "mulhisi3"
*** lib1funcs.asm.bak Tue Mar 6 13:51:48 2001
--- lib1funcs.asm Tue Mar 6 13:52:15 2001
***************
*** 845,851 ****
!
GLOBAL(mulsi3):
! mulu r4,r5 ! multiply the lsws macl=bb*dd
mov r5,r3 ! r3 = ccdd
swap.w r4,r2 ! r2 = bbaa
xtrct r2,r3 ! r3 = aacc
--- 845,851 ----
!
GLOBAL(mulsi3):
! mulu.w r4,r5 ! multiply the lsws macl=bb*dd
mov r5,r3 ! r3 = ccdd
swap.w r4,r2 ! r2 = bbaa
xtrct r2,r3 ! r3 = aacc
***************
*** 855,863 ****
sts macl,r0
hiset: sts macl,r0 ! r0 = bb*dd
! mulu r2,r5 ! brewing macl = aa*dd
sts macl,r1
! mulu r3,r4 ! brewing macl = cc*bb
sts macl,r2
add r1,r2
shll16 r2
--- 855,863 ----
sts macl,r0
hiset: sts macl,r0 ! r0 = bb*dd
! mulu.w r2,r5 ! brewing macl = aa*dd
sts macl,r1
! mulu.w r3,r4 ! brewing macl = cc*bb
sts macl,r2
add r1,r2
shll16 r2