From: Hans-Peter Nilsson Date: Thu, 30 Jan 2020 16:14:12 +0000 (+0100) Subject: cris: Enable movhi and movqi to set condition codes. Anonymize. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c7016b08f7a1f62e13a0805d1b5eb1685d3c475;p=gcc.git cris: Enable movhi and movqi to set condition codes. Anonymize. Like with movsi_internal. Looks like the "cc" attribute didn't need tweaking for "movhi", but did for "movqi". N.B.: disabled alternatives make cause a later alternative to match. Also, non-anonymous insns get declarations and gen_* functions. We don't want that; even if it doesn't affect generated code it's sloppy. (This may or may not be preferable to the name decorations obfuscating standard pattern names.) Also anonymize left-over non-anonymous branches; they haven't been needing names since the cbranch pattern was made the generic method. gcc: * config/cris/cris.md ("anz", "anzvc", "acc"): New define_subst_attrs. ("movhi"): Rename from "movhi". Rename "cc" attribute to "cc". ("movqi"): Similar from "movqi". Correct contents of, and rename "cc" attribute to "cc". ("*b"): Rename from "b". ("*b"): Rename from "b". ("*b"): Rename from "*b". --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3fa24c7dd8b..22178ad52ce 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -111,6 +111,15 @@ ("*movsi_internal"): Rename from "*movsi_internal". Correct contents of, and rename attribute "cc" to "cc". + ("anz", "anzvc", "acc"): New define_subst_attrs. + ("movhi"): Rename from + "movhi". Rename "cc" attribute to "cc". + ("movqi"): Similar from + "movqi". Correct contents of, and rename "cc" attribute to + "cc". + ("*b"): Rename from "b". + ("*b"): Rename from "b". + ("*b"): Rename from "*b". 2020-05-08 Vladimir Makarov diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index bee9e9735d0..5f77bc9e0fd 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -239,6 +239,7 @@ (define_subst_attr "setnz" "setnz_subst" "" "_setnz") (define_subst_attr "ccnz" "setnz_subst" "" "_enabled") +(define_subst_attr "anz" "setnz_subst" "" "*") (define_subst "setnz_subst" [(set (match_operand 0) @@ -251,6 +252,7 @@ (define_subst_attr "setnzvc" "setnzvc_subst" "" "_setnzvc") (define_subst_attr "ccnzvc" "setnzvc_subst" "" "_enabled") +(define_subst_attr "anzvc" "setnzvc_subst" "" "*") (define_subst "setnzvc_subst" [(set (match_operand 0) @@ -263,6 +265,7 @@ (define_subst_attr "setcc" "setcc_subst" "" "_setcc") (define_subst_attr "cccc" "setcc_subst" "" "_enabled") +(define_subst_attr "acc" "setcc_subst" "" "*") (define_subst "setcc_subst" [(set (match_operand 0) @@ -609,7 +612,7 @@ ;; FIXME: See movsi. -(define_insn "movhi" +(define_insn "movhi" [(set (match_operand:HI 0 "nonimmediate_operand" "=r,r, r,Q>,r,Q>,r,r,r,g,g,r,r,x") (match_operand:HI 1 "general_operand" "r,Q>,M,M, I,r, L,O,n,M,r,g,x,r")) @@ -649,7 +652,7 @@ } } [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,yes,no,no,no,no,yes,yes") - (set_attr "cc" "*,*,none,none,*,none,*,clobber,*,none,none,*,none,none")]) + (set_attr "cc" "*,*,none,none,*,none,*,clobber,*,none,none,*,none,none")]) (define_insn "movstricthi" [(set @@ -685,7 +688,7 @@ "" "") -(define_insn "movqi" +(define_insn "movqi" [(set (match_operand:QI 0 "nonimmediate_operand" "=r,Q>,r, r,Q>,r,g,g,r,r,r,x") (match_operand:QI 1 "general_operand" "r,r, Q>,M,M, I,M,r,O,g,x,r")) (clobber (reg:CC CRIS_CC0_REGNUM))] @@ -704,7 +707,8 @@ move %1,%0 move %1,%0" [(set_attr "slottable" "yes,yes,yes,yes,yes,yes,no,no,yes,no,yes,yes") - (set_attr "cc" "*,*,*,*,*,*,*,*,clobber,*,none,none")]) + (set_attr "cc" + "*,none,*,none,none,*,none,none,clobber,*,none,none")]) (define_insn "movstrictqi" [(set (strict_low_part @@ -2117,7 +2121,7 @@ ;; e.g. m68k, so we have to check if overflow bit is set on all "signed" ;; conditions. -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (zcond (reg:NZUSE CRIS_CC0_REGNUM) (const_int 0)) @@ -2127,7 +2131,7 @@ "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (nzvccond (reg:NZVCUSE CRIS_CC0_REGNUM) (const_int 0)) @@ -2137,7 +2141,7 @@ "b %l0%#" [(set_attr "slottable" "has_slot")]) -(define_insn "b" +(define_insn "*b" [(set (pc) (if_then_else (rnzcond (reg:NZUSE CRIS_CC0_REGNUM) (const_int 0))