On 30 October 2014 08:54, Gopalasubramanian, Ganesh
<ganesh.gopalasubraman...@amd.com> wrote:

> 2014-10-30  Ganesh Gopalasubramanian <ganesh.gopalasubraman...@amd.com>

Check the whitespace in your ChangeLog line.

>         * config/arm/types.md (define_attr "type"): Add prefetch.

The existing schedulers use 'load1'.  We can of course split that into
two introducing "prefetch" and update all of the existing schedulers
to reflect the change.  However I suggest we do that as a separate
activity when someone actually needs the distinction, note this change
will require updating the schedulers for both ARM and AArch64 backends
not just those relevant to AArch64.  For this prefetch patch I suggest
we go with the existing "load1".

The inline patch has been munged by your mailer, I tried applying the
patch to my tree but it is full of  escape sequences.  Can you either
fix your mailer or submit patches as attachments?

> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> index 74b554e..12a3f170 100644
> --- a/gcc/config/aarch64/aarch64.md
> +++ b/gcc/config/aarch64/aarch64.md
> @@ -320,6 +320,38 @@
>    [(set_attr "type" "no_insn")]
> )
>
> +
> +(define_insn "prefetch"
> +  [(prefetch (match_operand:DI 0 "address_operand" "r")
> +            (match_operand:QI 1 "const_int_operand" "")
> +            (match_operand:QI 2 "const_int_operand" ""))]
> +  ""

> +  "*
> +{

Use {} instead of "*{, then all of the extra quoting in the C below goes away.

> +  const char * pftype[2][10]
> +    = { {\"PLDL1STRM\", \"PLDL3KEEP\", \"PLDL2KEEP\", \"PLDL1KEEP\"},
> +       {\"PSTL1STRM\", \"PSTL3KEEP\", \"PSTL2KEEP\", \"PSTL1KEEP\"},
> +      };
> +
> +  int locality = INTVAL (operands[2]);
> +  char pattern[100];
> +
> +  gcc_assert (IN_RANGE (locality, 0, 3));
> +
> +  strcpy (pattern, \"prfm\\t\");
> +  strcat (pattern, (const char*)pftype[INTVAL(operands[1])][locality]);
> +  strcat (pattern, \", %a0\");

Use sprintf() rather that multiple calls to cpy and cat.  I suspect
the cast in front of pftype is superflous?

> +
> +  output_asm_insn (pattern,
> +                   operands);

Unnecessary line break.

Cheers
/Marcus

Reply via email to