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,SH] Add SH2A new instructions 3/6


"Naveen H.S." <naveen.hs@kpitcummins.com> wrote:
> Please find attached the modified patch "sh2a3.patch". This patch
> implements new instruction PREFETCH for SH2A target.

Looks fine, except for a few problems about coding standard.
Re-post the revised patch when the trunk returns to stage1.
Don't forget to describe how the patch is tested then.

> --- gcc-4.3-20070921/gcc/config/sh/sh.md	2007-10-24 12:09:31.000000000 +0530
> +++ tars/gcc-4.3-20070921/gcc/config/sh/sh.md	2007-10-24 12:12:47.000000000 +0530
> @@ -13684,7 +13684,7 @@ mov.l\\t1f,r0\\n\\
>    [(prefetch (match_operand 0 "address_operand" "p")
>               (match_operand:SI 1 "const_int_operand" "n")
>               (match_operand:SI 2 "const_int_operand" "n"))]
> -  "(TARGET_HARD_SH4 || TARGET_SH5) && (TARGET_SHMEDIA || !TARGET_VXWORKS_RTP)"
> +  "TARGET_SH2A || ((TARGET_HARD_SH4 || TARGET_SH5) && (TARGET_SHMEDIA || !TARGET_VXWORKS_RTP))"

Long line.

  "TARGET_SH2A || ((TARGET_HARD_SH4 || TARGET_SH5)
		   && (TARGET_SHMEDIA || !TARGET_VXWORKS_RTP))"

> @@ -13695,6 +13695,14 @@ mov.l\\t1f,r0\\n\\
>      operands[0] = force_reg (Pmode, operands[0]);
>  }")
>  
> +(define_insn "prefetch_m2a"
> +  [(prefetch (match_operand:SI 0 "register_operand" "r")
> +             (match_operand:SI 1 "const_int_operand" "n")
> +             (match_operand:SI 2 "const_int_operand" "n"))]
    ^^^^^^^^
Use a tab.

> --- gcc-4.3-20070921/gcc/testsuite/gcc.target/sh/sh2a-prefetch.c	1970-01-01 05:30:00.000000000 +0530
> +++ tars/gcc-4.3-20070921/gcc/testsuite/gcc.target/sh/sh2a-prefetch.c	2007-10-24 12:12:17.000000000 +0530
> @@ -0,0 +1,37 @@
> +/* Testcase to check generation of a SH2A specific instruction PREF @Rm  */

Missing period.

> +/* { dg-skip-if "" { "sh*-*-*" } "*" "-m2a -m2a-nofpu -m2a-single
> +   -m2a-single-only" }  */

A single line would be safer.

> +  /* data prefetch , instructions hit the cache. */
        ^            ^                             ^^
  /* Data prefetch, instructions hit the cache.  */

> 2007-10-25	Mukesh Srivastava <mukesh.srivastava@kpitcummins.com>
>             
> 	* config/sh/sh.md (prefetch): Add condition for SH2A target.
> 	(prefetch_sh2a): New.

The style of the author line is wrong.  Should be

200z-xx-yy  Mukesh Srivastava  <mukesh.srivastava@kpitcummins.com>

New testcase requires an entry in gcc/testsuite/ChangeLog.

Regards,
	kaz


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