public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cooper Qu <cooper.qu@linux.alibaba.com>
To: Geng Qi <gengqi@linux.alibaba.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] C-SKY: Add insn "ldbs".
Date: Wed, 26 May 2021 10:06:24 +0800	[thread overview]
Message-ID: <ded0dc19-e69f-07d5-bb7a-bc7506c4ac5b@linux.alibaba.com> (raw)
In-Reply-To: <20210525104525.1766-1-gengqi@linux.alibaba.com>

merged.

On 5/25/21 6:45 PM, Geng Qi wrote:
> gcc/
> 	* config/csky/csky.md (cskyv2_sextend_ldbs): New insn.
>
> gcc/testsuite/
> 	* gcc/testsuite/gcc.target/csky/ldbs.c: New.
> ---
>   gcc/config/csky/csky.md              | 10 ++++++++++
>   gcc/testsuite/gcc.target/csky/ldbs.c | 11 +++++++++++
>   2 files changed, 21 insertions(+)
>   create mode 100644 gcc/testsuite/gcc.target/csky/ldbs.c
>
> diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md
> index c27d627..b980d4c 100644
> --- a/gcc/config/csky/csky.md
> +++ b/gcc/config/csky/csky.md
> @@ -1533,6 +1533,7 @@
>     }"
>   )
>   
> +;; hi -> si
>   (define_insn "extendhisi2"
>     [(set (match_operand:SI		  0 "register_operand" "=r")
>   	(sign_extend:SI (match_operand:HI 1 "register_operand" "r")))]
> @@ -1557,6 +1558,15 @@
>     "sextb  %0, %1"
>   )
>   
> +(define_insn "*cskyv2_sextend_ldbs"
> +  [(set (match_operand:SI		  0 "register_operand" "=r")
> +        (sign_extend:SI (match_operand:QI 1 "csky_simple_mem_operand" "m")))]
> +  "CSKY_ISA_FEATURE (E2)"
> +  "ld.bs\t%0, %1"
> +  [(set_attr "length" "4")
> +   (set_attr "type" "load")]
> +)
> +
>   ;; qi -> hi
>   (define_insn "extendqihi2"
>     [(set (match_operand:HI		  0 "register_operand" "=r")
> diff --git a/gcc/testsuite/gcc.target/csky/ldbs.c b/gcc/testsuite/gcc.target/csky/ldbs.c
> new file mode 100644
> index 0000000..27a0254
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/csky/ldbs.c
> @@ -0,0 +1,11 @@
> +/* { dg-do compile } */
> +/* { dg-skip-if "" { *-*-* } { "-mcpu=ck801" "-march=ck801" } { "*" } } */
> +/* { dg-csky-options "-O1" } */
> +
> +int foo (signed char *pb)
> +{
> +  return *pb;
> +}
> +
> +/* { dg-final { scan-assembler "ld.bs" } } */
> +

  reply	other threads:[~2021-05-26  2:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 10:45 Geng Qi
2021-05-26  2:06 ` Cooper Qu [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-30 13:00 Geng Qi
2021-05-25  6:21 ` Cooper Qu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ded0dc19-e69f-07d5-bb7a-bc7506c4ac5b@linux.alibaba.com \
    --to=cooper.qu@linux.alibaba.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gengqi@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).