All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Anton Blanchard <anton@ozlabs.org>
Cc: ego@linux.vnet.ibm.com, sandipandas1990@gmail.com,
	mark.cave-ayland@ilande.co.uk, richard.henderson@linaro.org,
	qemu-devel@nongnu.org, f4bug@amsat.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 7/9] target/ppc: Fix vrlwmi and vrlwnm
Date: Tue, 7 May 2019 15:30:31 +1000	[thread overview]
Message-ID: <20190507053031.GL7073@umbus.fritz.box> (raw)
In-Reply-To: <20190507004811.29968-7-anton@ozlabs.org>

[-- Attachment #1: Type: text/plain, Size: 2961 bytes --]

On Tue, May 07, 2019 at 10:48:09AM +1000, Anton Blanchard wrote:
> We should only look at 5 bits of each byte, not 6.
> 
> Fixes: 3e00884f4e9f ("target-ppc: add vrldnmi and vrlwmi instructions")
> Signed-off-by: Anton Blanchard <anton@ozlabs.org>

Hrm.  So, what lives in those extra bits in the 'w' instructions?  Is
ignoring it correct?  Should we throw an exception?  Does it mean
something else?

> ---
>  target/ppc/int_helper.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c
> index fd715b4076..111586c981 100644
> --- a/target/ppc/int_helper.c
> +++ b/target/ppc/int_helper.c
> @@ -1652,7 +1652,7 @@ void helper_vrsqrtefp(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *b)
>      }
>  }
>  
> -#define VRLMI(name, size, element, insert)                            \
> +#define VRLMI(name, size, element, insert, modifier_bits)             \
>  void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)          \
>  {                                                                     \
>      int i;                                                            \
> @@ -1662,9 +1662,9 @@ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)          \
>          uint##size##_t src3 = r->element[i];                          \
>          uint##size##_t begin, end, shift, mask, rot_val;              \
>                                                                        \
> -        shift = extract##size(src2, 0, 6);                            \
> -        end   = extract##size(src2, 8, 6);                            \
> -        begin = extract##size(src2, 16, 6);                           \
> +        shift = extract##size(src2, 0, modifier_bits);                \
> +        end   = extract##size(src2, 8, modifier_bits);                \
> +        begin = extract##size(src2, 16, modifier_bits);               \
>          rot_val = rol##size(src1, shift);                             \
>          mask = mask_u##size(begin, end);                              \
>          if (insert) {                                                 \
> @@ -1675,10 +1675,10 @@ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b)          \
>      }                                                                 \
>  }
>  
> -VRLMI(vrldmi, 64, u64, 1);
> -VRLMI(vrlwmi, 32, u32, 1);
> -VRLMI(vrldnm, 64, u64, 0);
> -VRLMI(vrlwnm, 32, u32, 0);
> +VRLMI(vrldmi, 64, u64, 1, 6);
> +VRLMI(vrlwmi, 32, u32, 1, 5);
> +VRLMI(vrldnm, 64, u64, 0, 6);
> +VRLMI(vrlwnm, 32, u32, 0, 5);
>  
>  void helper_vsel(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b,
>                   ppc_avr_t *c)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-05-07  6:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07  0:48 [Qemu-devel] [PATCH 1/9] target/ppc: Fix xvxsigdp Anton Blanchard
2019-05-07  0:48 ` [Qemu-devel] [PATCH 2/9] target/ppc: Fix xxspltib Anton Blanchard
2019-05-07  5:20   ` David Gibson
2019-05-08 20:17     ` [Qemu-devel] [PATCH v2] " Anton Blanchard
2019-05-09  5:33       ` David Gibson
2019-05-07  0:48 ` [Qemu-devel] [PATCH 3/9] target/ppc: Fix xxbrq, xxbrw Anton Blanchard
2019-05-07  5:21   ` David Gibson
2019-05-07  0:48 ` [Qemu-devel] [PATCH 4/9] target/ppc: Fix lxvw4x, lxvh8x and lxvb16x Anton Blanchard
2019-05-07  5:28   ` David Gibson
2019-05-07 18:04     ` Mark Cave-Ayland
2019-05-09  0:33       ` Anton Blanchard
2019-05-09  5:35         ` David Gibson
2019-05-09  0:35       ` [Qemu-devel] [PATCH] target/ppc: Optimise VSX_LOAD_SCALAR_DS and VSX_VECTOR_LOAD_STORE Anton Blanchard
2019-05-10 15:07         ` Mark Cave-Ayland
2019-05-10 15:11   ` [Qemu-devel] [PATCH 4/9] target/ppc: Fix lxvw4x, lxvh8x and lxvb16x Mark Cave-Ayland
2019-05-21 20:11     ` Anton Blanchard
2019-05-22  0:49       ` David Gibson
2019-05-22  4:37         ` Mark Cave-Ayland
2019-05-22  6:10           ` David Gibson
2019-05-24  6:54             ` Mark Cave-Ayland
2019-05-22  7:39       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2019-05-07  0:48 ` [Qemu-devel] [PATCH 5/9] target/ppc: Fix xvabs[sd]p, xvnabs[sd]p, xvneg[sd]p, xvcpsgn[sd]p Anton Blanchard
2019-05-07  5:22   ` David Gibson
2019-05-09  0:49     ` [Qemu-devel] [PATCH v2] " Anton Blanchard
2019-05-10 15:02       ` Mark Cave-Ayland
2019-05-13  5:53         ` David Gibson
2019-05-07 18:05   ` [Qemu-devel] [PATCH 5/9] " Mark Cave-Ayland
2019-05-07  0:48 ` [Qemu-devel] [PATCH 6/9] target/ppc: Fix vslv and vsrv Anton Blanchard
2019-05-07  5:23   ` David Gibson
2019-05-07  0:48 ` [Qemu-devel] [PATCH 7/9] target/ppc: Fix vrlwmi and vrlwnm Anton Blanchard
2019-05-07  5:30   ` David Gibson [this message]
2019-05-07  0:48 ` [Qemu-devel] [PATCH 8/9] target/ppc: Fix dtstsfi and dtstsfiq Anton Blanchard
2019-05-07  0:48 ` [Qemu-devel] [PATCH 9/9] target/ppc: Fix vsum2sws Anton Blanchard
2019-05-07  5:25   ` David Gibson
2019-05-07 18:08   ` Mark Cave-Ayland
2019-05-07  1:21 ` [Qemu-devel] [PATCH 1/9] target/ppc: Fix xvxsigdp Alexey Kardashevskiy
2019-05-07  3:48   ` Anton Blanchard
2019-05-07 18:12     ` Mark Cave-Ayland
2019-05-07  5:18 ` David Gibson
2019-05-07  8:01 ` Philippe Mathieu-Daudé
2019-05-07 18:46 ` Eric Blake

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=20190507053031.GL7073@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=anton@ozlabs.org \
    --cc=ego@linux.vnet.ibm.com \
    --cc=f4bug@amsat.org \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sandipandas1990@gmail.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 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.