This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, rs6000, generic builtins] Fix unary TDmode patterns and add DFP ABS builtins


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]