aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2019-12-16 17:06:17 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2019-12-16 17:06:17 +0100
commitbb03700c9b89f42b9e6bccccef8a74ce9b4fb91b (patch)
treeda44edff5051ad9f231a0dbc6ab4ea8a0057cb5d
parente8aa9f55f6486a9503d4f9e6b88b8f81d1daab15 (diff)
downloadgcc-bb03700c9b89f42b9e6bccccef8a74ce9b4fb91b.zip
gcc-bb03700c9b89f42b9e6bccccef8a74ce9b4fb91b.tar.gz
gcc-bb03700c9b89f42b9e6bccccef8a74ce9b4fb91b.tar.bz2
rs6000: Use symbolic names for the CR fields in more cases
It turns out we still used hardcoded register numbers for the CR fields in some cases, and they now use the wrong numbers since we renumbered most of the registers. So let's use the symbolic names, instead. * config/rs6000/rs6000.md (movsi_to_cr_one): Use CR0_REGNO instead of hardcoding the (old, expired) register number. (*mtcrfsi): Ditto. From-SVN: r279443
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/rs6000.md4
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 08d769a..8fa7cc4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-12-16 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * config/rs6000/rs6000.md (movsi_to_cr_one): Use CR0_REGNO instead of
+ hardcoding the (old, expired) register number.
+ (*mtcrfsi): Ditto.
+
2019-12-16 Jozef Lawrynowicz <jozef.l@mittosystems.com>
* config.gcc: s/msp430*-*-*/msp430-*-*.
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 4c44c1f..4a6416e 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -13132,7 +13132,7 @@
(unspec:CC [(match_operand:SI 1 "gpc_reg_operand")
(match_dup 2)] UNSPEC_MOVESI_TO_CR))]
""
- "operands[2] = GEN_INT (1 << (75 - REGNO (operands[0])));")
+ "operands[2] = GEN_INT (1 << (7 - (REGNO (operands[0]) - CR0_REGNO)));")
(define_insn "*movsi_to_cr"
[(match_parallel 0 "mtcrf_operation"
@@ -13159,7 +13159,7 @@
"REG_P (operands[0])
&& CR_REGNO_P (REGNO (operands[0]))
&& CONST_INT_P (operands[2])
- && INTVAL (operands[2]) == 1 << (75 - REGNO (operands[0]))"
+ && INTVAL (operands[2]) == 1 << (7 - (REGNO (operands[0]) - CR0_REGNO))"
"mtcrf %R0,%1"
[(set_attr "type" "mtcr")])