Patchwork [MIPS,committed] Fix target conditions for MIPS3D instructions

login
register
mail settings
Submitter Richard Sandiford
Date Jan. 24, 2012, 7:35 p.m.
Message ID <87ty3k6ghg.fsf@firetop.home>
Download mbox | patch
Permalink /patch/137619/
State New
Headers show

Comments

Richard Sandiford - Jan. 24, 2012, 7:35 p.m.
All the MIPS3D patterns were testing the wrong condition:
TARGET_PAIRED_SINGLE_FLOAT rather than TARGET_MIPS3D.  I think this
has been latent since the MIPS3D support was added, but it was shielded
by the definitions of the built-in functions, which require TARGET_MIPS3D.

We now use these patterns for the autovectoriser too, and various
vect.exp tests were failing on mipsisa64-elf because we were trying
to use addr.ps on a non-MIPS3D target.

Tested on mipsisa64-elf and mips64-linux-gnu.  Applied.

At some point we might want to run the vectoriser tests with -mips3d,
but this bug shows why running with plain -mpaired-single is useful too.

Richard


gcc/
	* config/mips/mips-ps-3d.md (mips_addr_ps, reduc_splus_v2sf)
	(mips_cvt_pw_ps, mips_cvt_ps_pw, mips_mulr_ps, mips_cabs_cond_<fmt>)
	(mips_cabs_cond_4s, mips_cabs_cond_ps, bc1any4t, bc1any4f, bc1any2t)
	(bc1any2f, mips_rsqrt1_<fmt>, mips_rsqrt2_<fmt>, mips_recip1_<fmt>)
	(mips_recip2_<fmt>): Require TARGET_MIPS3D rather than
	TARGET_PAIRED_SINGLE_FLOAT.

Patch

Index: gcc/config/mips/mips-ps-3d.md
===================================================================
--- gcc/config/mips/mips-ps-3d.md	2012-01-24 19:20:28.000000000 +0000
+++ gcc/config/mips/mips-ps-3d.md	2012-01-24 19:26:46.000000000 +0000
@@ -366,7 +366,7 @@  (define_insn "mips_addr_ps"
 	(unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
 		      (match_operand:V2SF 2 "register_operand" "f")]
 		     UNSPEC_ADDR_PS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "addr.ps\t%0,%1,%2"
   [(set_attr "type" "fadd")
    (set_attr "mode" "SF")])
@@ -376,7 +376,7 @@  (define_insn "reduc_splus_v2sf"
 	(unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
 		      (match_dup 1)]
 		     UNSPEC_ADDR_PS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "")
 
 ; cvt.pw.ps - Floating Point Convert Paired Single to Paired Word
@@ -384,7 +384,7 @@  (define_insn "mips_cvt_pw_ps"
   [(set (match_operand:V2SF 0 "register_operand" "=f")
 	(unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")]
 		     UNSPEC_CVT_PW_PS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "cvt.pw.ps\t%0,%1"
   [(set_attr "type" "fcvt")
    (set_attr "mode" "SF")])
@@ -394,7 +394,7 @@  (define_insn "mips_cvt_ps_pw"
   [(set (match_operand:V2SF 0 "register_operand" "=f")
 	(unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")]
 		     UNSPEC_CVT_PS_PW))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "cvt.ps.pw\t%0,%1"
   [(set_attr "type" "fcvt")
    (set_attr "mode" "SF")])
@@ -405,7 +405,7 @@  (define_insn "mips_mulr_ps"
 	(unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
 		      (match_operand:V2SF 2 "register_operand" "f")]
 		     UNSPEC_MULR_PS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "mulr.ps\t%0,%1,%2"
   [(set_attr "type" "fmul")
    (set_attr "mode" "SF")])
@@ -445,7 +445,7 @@  (define_insn "mips_cabs_cond_<fmt>"
 		    (match_operand:SCALARF 2 "register_operand" "f")
 		    (match_operand 3 "const_int_operand" "")]
 		   UNSPEC_CABS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "cabs.%Y3.<fmt>\t%0,%1,%2"
   [(set_attr "type" "fcmp")
    (set_attr "mode" "FPSW")])
@@ -492,7 +492,7 @@  (define_insn_and_split "mips_cabs_cond_4
 		      (match_operand:V2SF 4 "register_operand" "f")
 		      (match_operand 5 "const_int_operand" "")]
 		     UNSPEC_CABS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "#"
   "&& reload_completed"
   [(set (match_dup 6)
@@ -535,7 +535,7 @@  (define_insn "mips_cabs_cond_ps"
 		      (match_operand:V2SF 2 "register_operand" "f")
 		      (match_operand 3 "const_int_operand" "")]
 		     UNSPEC_CABS))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "cabs.%Y3.ps\t%0,%1,%2"
   [(set_attr "type" "fcmp")
    (set_attr "mode" "FPSW")])
@@ -578,7 +578,7 @@  (define_insn "bc1any4t"
 			  (const_int 0))
 		      (label_ref (match_operand 0 "" ""))
 		      (pc)))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "%*bc1any4t\t%1,%0%/"
   [(set_attr "type" "branch")])
 
@@ -589,7 +589,7 @@  (define_insn "bc1any4f"
 			  (const_int -1))
 		      (label_ref (match_operand 0 "" ""))
 		      (pc)))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "%*bc1any4f\t%1,%0%/"
   [(set_attr "type" "branch")])
 
@@ -600,7 +600,7 @@  (define_insn "bc1any2t"
 			  (const_int 0))
 		      (label_ref (match_operand 0 "" ""))
 		      (pc)))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "%*bc1any2t\t%1,%0%/"
   [(set_attr "type" "branch")])
 
@@ -611,7 +611,7 @@  (define_insn "bc1any2f"
 			  (const_int -1))
 		      (label_ref (match_operand 0 "" ""))
 		      (pc)))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "%*bc1any2f\t%1,%0%/"
   [(set_attr "type" "branch")])
 
@@ -674,7 +674,7 @@  (define_insn "mips_rsqrt1_<fmt>"
   [(set (match_operand:ANYF 0 "register_operand" "=f")
 	(unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")]
 		     UNSPEC_RSQRT1))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "rsqrt1.<fmt>\t%0,%1"
   [(set_attr "type" "frsqrt1")
    (set_attr "mode" "<UNITMODE>")])
@@ -684,7 +684,7 @@  (define_insn "mips_rsqrt2_<fmt>"
 	(unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")
 		      (match_operand:ANYF 2 "register_operand" "f")]
 		     UNSPEC_RSQRT2))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "rsqrt2.<fmt>\t%0,%1,%2"
   [(set_attr "type" "frsqrt2")
    (set_attr "mode" "<UNITMODE>")])
@@ -693,7 +693,7 @@  (define_insn "mips_recip1_<fmt>"
   [(set (match_operand:ANYF 0 "register_operand" "=f")
 	(unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")]
 		     UNSPEC_RECIP1))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "recip1.<fmt>\t%0,%1"
   [(set_attr "type" "frdiv1")
    (set_attr "mode" "<UNITMODE>")])
@@ -703,7 +703,7 @@  (define_insn "mips_recip2_<fmt>"
 	(unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")
 		      (match_operand:ANYF 2 "register_operand" "f")]
 		     UNSPEC_RECIP2))]
-  "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
+  "TARGET_HARD_FLOAT && TARGET_MIPS3D"
   "recip2.<fmt>\t%0,%1,%2"
   [(set_attr "type" "frdiv2")
    (set_attr "mode" "<UNITMODE>")])