This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH RFC] Consolidate some sparc insns patterns using "enabled".
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Oct 2011 19:06:53 +0200
- Subject: Re: [PATCH RFC] Consolidate some sparc insns patterns using "enabled".
- References: <20111024.040339.601104754267980651.davem@davemloft.net>
> Eric, if you could give this some eyeballs I'd really appreciate it.
Looks good to me, modulo...
> diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
> index 0f716d6..3462e6f 100644
> --- a/gcc/config/sparc/sparc.md
> +++ b/gcc/config/sparc/sparc.md
> @@ -240,6 +240,17 @@
> (symbol_ref "TARGET_SPARCLET") (const_string "sparclet")]
> (const_string "v7"))))
>
> +(define_attr "cpu_feature" "none,fpu,notv9fpu,v9,vis,vis3" (const_string
> "none")) +
> +(define_attr "enabled" ""
> + (cond [(eq_attr "cpu_feature" "none") (const_int 1)
> + (eq_attr "cpu_feature" "fpu") (symbol_ref "TARGET_FPU")
> + (eq_attr "cpu_feature" "notv9fpu") (symbol_ref "TARGET_FPU && !
> TARGET_V9") + (eq_attr "cpu_feature" "v9") (symbol_ref "TARGET_V9")
> + (eq_attr "cpu_feature" "vis") (symbol_ref "TARGET_VIS")
> + (eq_attr "cpu_feature" "vis3") (symbol_ref "TARGET_VIS3")]
> + (const_int 1)))
...notv9fpu is somewhat ambiguous, fpunotv9 sounds better. I'd also change the
final (const_int 1) to (const_int 0) if you explicitly test "none" above.
--
Eric Botcazou