This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000, generic builtins] Fix unary TDmode patterns and add DFP ABS builtins
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, David Edelsohn <dje dot gcc at gmail dot com>
- Date: Fri, 16 Aug 2013 19:11:33 +0200
- Subject: Re: [PATCH, rs6000, generic builtins] Fix unary TDmode patterns and add DFP ABS builtins
- References: <1376672816 dot 5807 dot 8 dot camel at otta>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Aug 16, 2013 at 12:06:56PM -0500, Peter Bergner wrote:
> --- gcc/config/rs6000/dfp.md (revision 201779)
> +++ gcc/config/rs6000/dfp.md (working copy)
> @@ -135,8 +135,15 @@ (define_insn "*negtd2_fpr"
> [(set (match_operand:TD 0 "gpc_reg_operand" "=d")
> (neg:TD (match_operand:TD 1 "gpc_reg_operand" "d")))]
> "TARGET_HARD_FLOAT && TARGET_FPRS"
> - "fneg %0,%1"
> - [(set_attr "type" "fp")])
> + "*
> +{
> + if (REGNO (operands[0]) == REGNO (operands[1]))
> + return \"fneg %0,%1\";
> + else
> + return \"fneg %0,%1\;fmr %L0,%L1\";
> +}"
> + [(set_attr "type" "fp")
> + (set_attr "length" "8")])
Is the length right for the firt case though?
I mean, shouldn't the insn have two alternatives:
=d,d 0,d and length 4,8 ?
> @@ -148,15 +155,29 @@ (define_insn "*abstd2_fpr"
> [(set (match_operand:TD 0 "gpc_reg_operand" "=d")
> (abs:TD (match_operand:TD 1 "gpc_reg_operand" "d")))]
> "TARGET_HARD_FLOAT && TARGET_FPRS"
> - "fabs %0,%1"
> - [(set_attr "type" "fp")])
> + "*
> +{
> + if (REGNO (operands[0]) == REGNO (operands[1]))
> + return \"fabs %0,%1\";
> + else
> + return \"fabs %0,%1\;fmr %L0,%L1\";
> +}"
> + [(set_attr "type" "fp")
> + (set_attr "length" "8")])
Ditto here.
Jakub