Skip to content

Commit ba53d41

Browse files
author
Claudiu Zissulescu
committed
Update umulsidi3/mulsidi3 when using mpy option 8 or greater.
1 parent cae17c2 commit ba53d41

File tree

2 files changed

+53
-4
lines changed

2 files changed

+53
-4
lines changed

gcc/ChangeLog.ARC

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2013-07-15 Claudiu Zissulescu <[email protected]>
2+
3+
* config/arc/arc.md (EXPAND mulsidi3): Use separate
4+
instructions when dealing with immediates, HS only.
5+
(EXPAND umulsidi3): Likewise.
6+
(mpyd_imm_arcv2hs): New pattern.
7+
(mpydu_imm_arcv2hs): Likewise.
8+
19
2013-06-30 Claudiu Zissulescu <[email protected]>
210

311
* config/arc/arc.h (DRIVER_SELF_SPECS): Add new mcpu options.

gcc/config/arc/arc.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,7 +2012,14 @@
20122012
{
20132013
if (TARGET_HS && (arc_mpy_option > 7))
20142014
{
2015-
emit_insn (gen_mpyd_arcv2hs (operands[0], operands[1], operands[2]));
2015+
if (CONST_INT_P (operands[2]))
2016+
{
2017+
emit_insn (gen_mpyd_imm_arcv2hs (operands[0], operands[1], operands[2]));
2018+
}
2019+
else
2020+
{
2021+
emit_insn (gen_mpyd_arcv2hs (operands[0], operands[1], operands[2]));
2022+
}
20162023
DONE;
20172024
}
20182025
else if ((TARGET_ARC700 && TARGET_MPY_SET) || EM_MULTI)
@@ -2252,7 +2259,14 @@
22522259
{
22532260
if (TARGET_HS && (arc_mpy_option > 7))
22542261
{
2255-
emit_insn (gen_mpydu_arcv2hs (operands[0], operands[1], operands[2]));
2262+
if (CONST_INT_P (operands[2]))
2263+
{
2264+
emit_insn (gen_mpydu_imm_arcv2hs (operands[0], operands[1], operands[2]));
2265+
}
2266+
else
2267+
{
2268+
emit_insn (gen_mpydu_arcv2hs (operands[0], operands[1], operands[2]));
2269+
}
22562270
DONE;
22572271
}
22582272
else if ((TARGET_ARC700 && TARGET_MPY_SET) || EM_MULTI)
@@ -5782,9 +5796,22 @@
57825796
(set_attr "cond" "canuse,nocond,nocond,canuse,nocond")])
57835797

57845798
(define_insn "mpyd_arcv2hs"
5799+
[(set (match_operand:DI 0 "nonimmediate_operand" "=Rcr, r")
5800+
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" " 0, c"))
5801+
(sign_extend:DI (match_operand:SI 2 "register_operand" " c, c"))))
5802+
(clobber (reg:DI 56))]
5803+
"TARGET_HS && (arc_mpy_option > 7)"
5804+
"mpyd%? %0, %1, %2"
5805+
[(set_attr "length" "4,4")
5806+
(set_attr "iscompact" "false")
5807+
(set_attr "type" "multi")
5808+
(set_attr "predicable" "yes,no")
5809+
(set_attr "cond" "canuse,nocond")])
5810+
5811+
(define_insn "mpyd_imm_arcv2hs"
57855812
[(set (match_operand:DI 0 "nonimmediate_operand" "=Rcr, r,r,Rcr, r")
57865813
(mult:DI (sign_extend:DI (match_operand:SI 1 "register_operand" " 0, c,0, 0, c"))
5787-
(sign_extend:DI (match_operand:SI 2 "nonmemory_operand" " cL,cL,I,Cal,Cal"))))
5814+
(match_operand 2 "immediate_operand" " L, L,I,Cal,Cal")))
57885815
(clobber (reg:DI 56))]
57895816
"TARGET_HS && (arc_mpy_option > 7)"
57905817
"mpyd%? %0, %1, %2"
@@ -5795,9 +5822,22 @@
57955822
(set_attr "cond" "canuse,nocond,nocond,canuse_limm,nocond")])
57965823

57975824
(define_insn "mpydu_arcv2hs"
5825+
[(set (match_operand:DI 0 "nonimmediate_operand" "=Rcr, r")
5826+
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" " 0, c"))
5827+
(zero_extend:DI (match_operand:SI 2 "register_operand" " c, c"))))
5828+
(clobber (reg:DI 56))]
5829+
"TARGET_HS && (arc_mpy_option > 7)"
5830+
"mpydu%? %0, %1, %2"
5831+
[(set_attr "length" "4,4")
5832+
(set_attr "iscompact" "false")
5833+
(set_attr "type" "multi")
5834+
(set_attr "predicable" "yes,no")
5835+
(set_attr "cond" "canuse,nocond")])
5836+
5837+
(define_insn "mpydu_imm_arcv2hs"
57985838
[(set (match_operand:DI 0 "nonimmediate_operand" "=Rcr, r,r,Rcr, r")
57995839
(mult:DI (zero_extend:DI (match_operand:SI 1 "register_operand" " 0, c,0, 0, c"))
5800-
(zero_extend:DI (match_operand:SI 2 "nonmemory_operand" " cL,cL,I,Cal,Cal"))))
5840+
(match_operand 2 "immediate_operand" " L, L,I,Cal,Cal")))
58015841
(clobber (reg:DI 56))]
58025842
"TARGET_HS && (arc_mpy_option > 7)"
58035843
"mpydu%? %0, %1, %2"
@@ -5807,6 +5847,7 @@
58075847
(set_attr "predicable" "yes,no,no,yes,no")
58085848
(set_attr "cond" "canuse,nocond,nocond,canuse_limm,nocond")])
58095849

5850+
58105851
(define_insn "*movdi_hsll64"
58115852
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,m")
58125853
(match_operand:DI 1 "nonimmediate_operand" "m,c"))]

0 commit comments

Comments
 (0)