* [PATCH 0/2] [ARC] Small fixes @ 2016-01-25 13:34 Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 1/2] [ARC] Fix arcset* pattern's predicate Claudiu Zissulescu ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2016-01-25 13:34 UTC (permalink / raw) To: gcc-patches; +Cc: Claudiu.Zissulescu, gnu, Francois.Bedard, jeremy.bennett Please find attached two small patches which are fixing two issues within the ARC backend: 1. The first one fixes predicates used by arcset* patterns. 2. The second one rejects constant-constant comparisons. This situation may happen durring CSE step. Ok to apply? Claudiu Claudiu Zissulescu (2): [ARC] Fix arcset* pattern's predicate. [ARC] Reject constant-constant comparison. gcc/config/arc/arc.md | 18 +++++++++++------- gcc/config/arc/predicates.md | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) -- 1.9.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] [ARC] Fix arcset* pattern's predicate. 2016-01-25 13:34 [PATCH 0/2] [ARC] Small fixes Claudiu Zissulescu @ 2016-01-25 13:34 ` Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 2/2] [ARC] Reject constant-constant comparison Claudiu Zissulescu 2016-01-25 14:49 ` [PATCH 0/2] [ARC] Small fixes Joern Wolfgang Rennecke 2 siblings, 0 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2016-01-25 13:34 UTC (permalink / raw) To: gcc-patches; +Cc: Claudiu.Zissulescu, gnu, Francois.Bedard, jeremy.bennett gcc/ 2016-01-25 Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc.md (cstoresi4): Force operand into register. (arcset<code>): Fix predicate. (arcsetltu): Likewise. (arcsetgeu): Likewise. (arcsethi): Likewise. (arcsetls): Likewise. --- gcc/config/arc/arc.md | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md index 222a468..602cf0b 100644 --- a/gcc/config/arc/arc.md +++ b/gcc/config/arc/arc.md @@ -3346,8 +3346,9 @@ (define_expand "cstoresi4" [(set (match_operand:SI 0 "dest_reg_operand" "") - (match_operator:SI 1 "ordered_comparison_operator" [(match_operand:SI 2 "nonmemory_operand" "") - (match_operand:SI 3 "nonmemory_operand" "")]))] + (match_operator:SI 1 "ordered_comparison_operator" + [(match_operand:SI 2 "nonmemory_operand" "") + (match_operand:SI 3 "nonmemory_operand" "")]))] "" { if (!TARGET_CODE_DENSITY) @@ -3358,6 +3359,9 @@ emit_insn (gen_scc_insn (operands[0], operands[1])); DONE; } + if (!register_operand (operands[2], SImode)) + operands[2] = force_reg (SImode, operands[2]); + }) (define_mode_iterator SDF [SF DF]) @@ -5414,7 +5418,7 @@ (define_insn "arcset<code>" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r,r") - (arcCC_cond:SI (match_operand:SI 1 "nonmemory_operand" "0,r,0,r,0,0,r") + (arcCC_cond:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0,0,r") (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I,n,n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "set<code>%? %0, %1, %2" @@ -5427,7 +5431,7 @@ (define_insn "arcsetltu" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r, r, r") - (ltu:SI (match_operand:SI 1 "nonmemory_operand" "0,r,0,r,0, 0, r") + (ltu:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0, 0, r") (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I, n, n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "setlo%? %0, %1, %2" @@ -5440,7 +5444,7 @@ (define_insn "arcsetgeu" [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r, r, r") - (geu:SI (match_operand:SI 1 "nonmemory_operand" "0,r,0,r,0, 0, r") + (geu:SI (match_operand:SI 1 "register_operand" "0,r,0,r,0, 0, r") (match_operand:SI 2 "nonmemory_operand" "r,r,L,L,I, n, n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "seths%? %0, %1, %2" @@ -5454,7 +5458,7 @@ ;; Special cases of SETCC (define_insn_and_split "arcsethi" [(set (match_operand:SI 0 "register_operand" "=r,r, r,r") - (gtu:SI (match_operand:SI 1 "nonmemory_operand" "r,r, r,r") + (gtu:SI (match_operand:SI 1 "register_operand" "r,r, r,r") (match_operand:SI 2 "nonmemory_operand" "0,r,C62,n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "setlo%? %0, %2, %1" @@ -5477,7 +5481,7 @@ (define_insn_and_split "arcsetls" [(set (match_operand:SI 0 "register_operand" "=r,r, r,r") - (leu:SI (match_operand:SI 1 "nonmemory_operand" "r,r, r,r") + (leu:SI (match_operand:SI 1 "register_operand" "r,r, r,r") (match_operand:SI 2 "nonmemory_operand" "0,r,C62,n")))] "TARGET_V2 && TARGET_CODE_DENSITY" "seths%? %0, %2, %1" -- 1.9.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] [ARC] Reject constant-constant comparison. 2016-01-25 13:34 [PATCH 0/2] [ARC] Small fixes Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 1/2] [ARC] Fix arcset* pattern's predicate Claudiu Zissulescu @ 2016-01-25 13:34 ` Claudiu Zissulescu 2016-01-25 14:49 ` [PATCH 0/2] [ARC] Small fixes Joern Wolfgang Rennecke 2 siblings, 0 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2016-01-25 13:34 UTC (permalink / raw) To: gcc-patches; +Cc: Claudiu.Zissulescu, gnu, Francois.Bedard, jeremy.bennett gcc/ 2016-01-25 Claudiu Zissulescu <claziss@synopsys.com> * config/arc/predicates.md (proper_comparison_operator): Reject constant-constant comparison. --- gcc/config/arc/predicates.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/arc/predicates.md b/gcc/config/arc/predicates.md index 52ac2ac..d384d70 100644 --- a/gcc/config/arc/predicates.md +++ b/gcc/config/arc/predicates.md @@ -510,6 +510,8 @@ /* From combiner. */ case QImode: case HImode: case DImode: case SFmode: case DFmode: return 0; + case VOIDmode: + return 0; default: gcc_unreachable (); } -- 1.9.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] [ARC] Small fixes 2016-01-25 13:34 [PATCH 0/2] [ARC] Small fixes Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 1/2] [ARC] Fix arcset* pattern's predicate Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 2/2] [ARC] Reject constant-constant comparison Claudiu Zissulescu @ 2016-01-25 14:49 ` Joern Wolfgang Rennecke 2016-01-25 14:56 ` Claudiu Zissulescu 2 siblings, 1 reply; 5+ messages in thread From: Joern Wolfgang Rennecke @ 2016-01-25 14:49 UTC (permalink / raw) To: Claudiu Zissulescu, gcc-patches; +Cc: Francois.Bedard, jeremy.bennett On 25/01/16 13:33, Claudiu Zissulescu wrote: > Please find attached two small patches which are fixing two issues within the ARC backend: > > 1. The first one fixes predicates used by arcset* patterns. > 2. The second one rejects constant-constant comparisons. This situation may happen durring CSE step. These are OK. FWIW, there's probably a missed optimization here - these constant - constant comparisons could be folded down further. ^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 0/2] [ARC] Small fixes 2016-01-25 14:49 ` [PATCH 0/2] [ARC] Small fixes Joern Wolfgang Rennecke @ 2016-01-25 14:56 ` Claudiu Zissulescu 0 siblings, 0 replies; 5+ messages in thread From: Claudiu Zissulescu @ 2016-01-25 14:56 UTC (permalink / raw) To: Joern Wolfgang Rennecke, gcc-patches; +Cc: Francois.Bedard, jeremy.bennett > FWIW, there's probably a missed optimization here - these constant - > constant comparisons could be folded down further. They are. The issue is when the CSE runs, wants to validate a new instruction with the propagated constant, which will lead to errors as it checks the proper_comaprison_operator, as it hits the assert at the end. Returning zero, it invalidates the instruction change, and the constant comparison will be handled later on by other steps. //Claudiu ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-25 14:56 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-01-25 13:34 [PATCH 0/2] [ARC] Small fixes Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 1/2] [ARC] Fix arcset* pattern's predicate Claudiu Zissulescu 2016-01-25 13:34 ` [PATCH 2/2] [ARC] Reject constant-constant comparison Claudiu Zissulescu 2016-01-25 14:49 ` [PATCH 0/2] [ARC] Small fixes Joern Wolfgang Rennecke 2016-01-25 14:56 ` Claudiu Zissulescu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).