From: Vincent ABRIOU <vincent.abriou@st.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
David Airlie <airlied@linux.ie>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm: sti: remove redundant sign extensions
Date: Thu, 29 Oct 2015 17:10:33 +0100 [thread overview]
Message-ID: <563244F9.1050103@st.com> (raw)
In-Reply-To: <1445001296-23029-1-git-send-email-linux@rasmusvillemoes.dk>
Hi Rasmus,
Thanks for the patch.
I will integrated it in the next pull request for the sti driver.
BR
Vincent
On 10/16/2015 03:14 PM, Rasmus Villemoes wrote:
> arg is long int, so arg = (arg << 22) >> 22 makes the upper 22 bits of
> arg equal to bit 9 (or bit 41). But we then mask away all but bits 0-9, so
> this is entirely redundant.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> gcc seems to be smart enough to realize this - the generated code is
> the same. This is thus just a tiny cleanup.
>
> drivers/gpu/drm/sti/sti_awg_utils.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_awg_utils.c b/drivers/gpu/drm/sti/sti_awg_utils.c
> index 6029a2e3db1d..00d0698be9d3 100644
> --- a/drivers/gpu/drm/sti/sti_awg_utils.c
> +++ b/drivers/gpu/drm/sti/sti_awg_utils.c
> @@ -65,7 +65,6 @@ static int awg_generate_instr(enum opcode opcode,
>
> mux = 0;
> data_enable = 0;
> - arg = (arg << 22) >> 22;
> arg &= (0x3ff);
> break;
> case REPEAT:
> @@ -77,14 +76,12 @@ static int awg_generate_instr(enum opcode opcode,
>
> mux = 0;
> data_enable = 0;
> - arg = (arg << 22) >> 22;
> arg &= (0x3ff);
> break;
> case JUMP:
> mux = 0;
> data_enable = 0;
> arg |= 0x40; /* for jump instruction 7th bit is 1 */
> - arg = (arg << 22) >> 22;
> arg &= 0x3ff;
> break;
> case STOP:
> @@ -94,7 +91,6 @@ static int awg_generate_instr(enum opcode opcode,
> case RPTSET:
> case RPLSET:
> case HOLD:
> - arg = (arg << 24) >> 24;
> arg &= (0x0ff);
> break;
> default:
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Vincent ABRIOU <vincent.abriou@st.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Benjamin Gaignard <benjamin.gaignard@linaro.org>,
David Airlie <airlied@linux.ie>
Cc: "dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm: sti: remove redundant sign extensions
Date: Thu, 29 Oct 2015 17:10:33 +0100 [thread overview]
Message-ID: <563244F9.1050103@st.com> (raw)
In-Reply-To: <1445001296-23029-1-git-send-email-linux@rasmusvillemoes.dk>
Hi Rasmus,
Thanks for the patch.
I will integrated it in the next pull request for the sti driver.
BR
Vincent
On 10/16/2015 03:14 PM, Rasmus Villemoes wrote:
> arg is long int, so arg = (arg << 22) >> 22 makes the upper 22 bits of
> arg equal to bit 9 (or bit 41). But we then mask away all but bits 0-9, so
> this is entirely redundant.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> gcc seems to be smart enough to realize this - the generated code is
> the same. This is thus just a tiny cleanup.
>
> drivers/gpu/drm/sti/sti_awg_utils.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/sti/sti_awg_utils.c b/drivers/gpu/drm/sti/sti_awg_utils.c
> index 6029a2e3db1d..00d0698be9d3 100644
> --- a/drivers/gpu/drm/sti/sti_awg_utils.c
> +++ b/drivers/gpu/drm/sti/sti_awg_utils.c
> @@ -65,7 +65,6 @@ static int awg_generate_instr(enum opcode opcode,
>
> mux = 0;
> data_enable = 0;
> - arg = (arg << 22) >> 22;
> arg &= (0x3ff);
> break;
> case REPEAT:
> @@ -77,14 +76,12 @@ static int awg_generate_instr(enum opcode opcode,
>
> mux = 0;
> data_enable = 0;
> - arg = (arg << 22) >> 22;
> arg &= (0x3ff);
> break;
> case JUMP:
> mux = 0;
> data_enable = 0;
> arg |= 0x40; /* for jump instruction 7th bit is 1 */
> - arg = (arg << 22) >> 22;
> arg &= 0x3ff;
> break;
> case STOP:
> @@ -94,7 +91,6 @@ static int awg_generate_instr(enum opcode opcode,
> case RPTSET:
> case RPLSET:
> case HOLD:
> - arg = (arg << 24) >> 24;
> arg &= (0x0ff);
> break;
> default:
>
next prev parent reply other threads:[~2015-10-29 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 13:14 [PATCH] drm: sti: remove redundant sign extensions Rasmus Villemoes
2015-10-29 16:10 ` Vincent ABRIOU [this message]
2015-10-29 16:10 ` Vincent ABRIOU
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=563244F9.1050103@st.com \
--to=vincent.abriou@st.com \
--cc=airlied@linux.ie \
--cc=benjamin.gaignard@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.