From b1fc9f8b8d5f9355695ba790d0884a951fcaf5db Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Sun, 23 Oct 2011 22:34:07 +0000 Subject: 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 --- gcc/config/sparc/sparc.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gcc/config/sparc/sparc.c') 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. */ -- cgit v1.1