aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-10-23 22:34:07 +0000
committerDavid S. Miller <davem@gcc.gnu.org>2011-10-23 15:34:07 -0700
commitb1fc9f8b8d5f9355695ba790d0884a951fcaf5db (patch)
treeceddd6702b8688b2520fe6997456bb36bb09351c /gcc/config/sparc/sparc.c
parent9c85d38bf4983b01eccfb364e5ef68c54a7d0486 (diff)
downloadgcc-b1fc9f8b8d5f9355695ba790d0884a951fcaf5db.zip
gcc-b1fc9f8b8d5f9355695ba790d0884a951fcaf5db.tar.gz
gcc-b1fc9f8b8d5f9355695ba790d0884a951fcaf5db.tar.bz2
Factor out common tests in 8-byte reg/reg move splitters on 32-bit sparc.
* config/sparc/sparc.c (sparc_split_regreg_legitimate): New function. * config/sparc/sparc-protos.h (sparc_split_regreg_legitimate): Declare it. * config/sparc/sparc.md (DImode reg/reg split): Use it. (DFmode reg/reg split): Likewise. From-SVN: r180354
Diffstat (limited to 'gcc/config/sparc/sparc.c')
-rw-r--r--gcc/config/sparc/sparc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index df0d825..29d2847 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -7762,6 +7762,31 @@ sparc_splitdi_legitimate (rtx reg, rtx mem)
return 1;
}
+/* Like sparc_splitdi_legitimate but for REG <--> REG moves. */
+
+int
+sparc_split_regreg_legitimate (rtx reg1, rtx reg2)
+{
+ int regno1, regno2;
+
+ if (GET_CODE (reg1) == SUBREG)
+ reg1 = SUBREG_REG (reg1);
+ if (GET_CODE (reg1) != REG)
+ return 0;
+ regno1 = REGNO (reg1);
+
+ if (GET_CODE (reg2) == SUBREG)
+ reg2 = SUBREG_REG (reg2);
+ if (GET_CODE (reg2) != REG)
+ return 0;
+ regno2 = REGNO (reg2);
+
+ if (SPARC_INT_REG_P (regno1) && SPARC_INT_REG_P (regno2))
+ return 1;
+
+ return 0;
+}
+
/* Return 1 if x and y are some kind of REG and they refer to
different hard registers. This test is guaranteed to be
run after reload. */