All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
@ 2020-11-09  9:17 LemonBoy
  2020-11-09  9:17 ` [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives LemonBoy
  2020-11-09 17:39 ` [PATCH 1/2] ppc/translate: Implement lxvwsx opcode Richard Henderson
  0 siblings, 2 replies; 9+ messages in thread
From: LemonBoy @ 2020-11-09  9:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Giuseppe Musacchio, qemu-ppc, david

Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
in Power ISA v3.0.

Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
---
 target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
 target/ppc/translate/vsx-ops.c.inc  |  1 +
 2 files changed, 31 insertions(+)

diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
index b518de46db..075f063e98 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -139,6 +139,36 @@ static void gen_lxvw4x(DisasContext *ctx)
     tcg_temp_free_i64(xtl);
 }
 
+static void gen_lxvwsx(DisasContext *ctx)
+{
+    TCGv EA;
+    TCGv_i32 data;
+
+    if (xT(ctx->opcode) < 32) {
+        if (unlikely(!ctx->vsx_enabled)) {
+            gen_exception(ctx, POWERPC_EXCP_VSXU);
+            return;
+        }
+    } else {
+        if (unlikely(!ctx->altivec_enabled)) {
+            gen_exception(ctx, POWERPC_EXCP_VPU);
+            return;
+        }
+    }
+
+    gen_set_access_type(ctx, ACCESS_INT);
+    EA = tcg_temp_new();
+
+    gen_addr_reg_index(ctx, EA);
+
+    data = tcg_temp_new_i32();
+    tcg_gen_qemu_ld_i32(data, EA, ctx->mem_idx, MO_TEUL);
+    tcg_gen_gvec_dup_i32(MO_UL, vsr_full_offset(xT(ctx->opcode)), 16, 16, data);
+
+    tcg_temp_free(EA);
+    tcg_temp_free_i32(data);
+}
+
 static void gen_bswap16x8(TCGv_i64 outh, TCGv_i64 outl,
                           TCGv_i64 inh, TCGv_i64 inl)
 {
diff --git a/target/ppc/translate/vsx-ops.c.inc b/target/ppc/translate/vsx-ops.c.inc
index 7fd3942b84..1d41beef26 100644
--- a/target/ppc/translate/vsx-ops.c.inc
+++ b/target/ppc/translate/vsx-ops.c.inc
@@ -5,6 +5,7 @@ GEN_HANDLER_E(lxsibzx, 0x1F, 0x0D, 0x18, 0, PPC_NONE, PPC2_ISA300),
 GEN_HANDLER_E(lxsihzx, 0x1F, 0x0D, 0x19, 0, PPC_NONE, PPC2_ISA300),
 GEN_HANDLER_E(lxsspx, 0x1F, 0x0C, 0x10, 0, PPC_NONE, PPC2_VSX207),
 GEN_HANDLER_E(lxvd2x, 0x1F, 0x0C, 0x1A, 0, PPC_NONE, PPC2_VSX),
+GEN_HANDLER_E(lxvwsx, 0x1F, 0x0C, 0x0B, 0, PPC_NONE, PPC2_ISA300),
 GEN_HANDLER_E(lxvdsx, 0x1F, 0x0C, 0x0A, 0, PPC_NONE, PPC2_VSX),
 GEN_HANDLER_E(lxvw4x, 0x1F, 0x0C, 0x18, 0, PPC_NONE, PPC2_VSX),
 GEN_HANDLER_E(lxvh8x, 0x1F, 0x0C, 0x19, 0, PPC_NONE,  PPC2_ISA300),
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives
  2020-11-09  9:17 [PATCH 1/2] ppc/translate: Implement lxvwsx opcode LemonBoy
@ 2020-11-09  9:17 ` LemonBoy
  2020-11-09 17:40   ` Richard Henderson
  2020-11-09 17:39 ` [PATCH 1/2] ppc/translate: Implement lxvwsx opcode Richard Henderson
  1 sibling, 1 reply; 9+ messages in thread
From: LemonBoy @ 2020-11-09  9:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Giuseppe Musacchio, qemu-ppc, david

Make the implementation match the lxvwsx one.
The code is now shorter smaller and potentially faster as the
translation will use the host SIMD capabilities if available.

No functional change.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
---
 target/ppc/translate/vsx-impl.c.inc | 46 ++++++++++++++---------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc
index 075f063e98..b817d31260 100644
--- a/target/ppc/translate/vsx-impl.c.inc
+++ b/target/ppc/translate/vsx-impl.c.inc
@@ -75,29 +75,6 @@ static void gen_lxvd2x(DisasContext *ctx)
     tcg_temp_free_i64(t0);
 }
 
-static void gen_lxvdsx(DisasContext *ctx)
-{
-    TCGv EA;
-    TCGv_i64 t0;
-    TCGv_i64 t1;
-    if (unlikely(!ctx->vsx_enabled)) {
-        gen_exception(ctx, POWERPC_EXCP_VSXU);
-        return;
-    }
-    t0 = tcg_temp_new_i64();
-    t1 = tcg_temp_new_i64();
-    gen_set_access_type(ctx, ACCESS_INT);
-    EA = tcg_temp_new();
-    gen_addr_reg_index(ctx, EA);
-    gen_qemu_ld64_i64(ctx, t0, EA);
-    set_cpu_vsrh(xT(ctx->opcode), t0);
-    tcg_gen_mov_i64(t1, t0);
-    set_cpu_vsrl(xT(ctx->opcode), t1);
-    tcg_temp_free(EA);
-    tcg_temp_free_i64(t0);
-    tcg_temp_free_i64(t1);
-}
-
 static void gen_lxvw4x(DisasContext *ctx)
 {
     TCGv EA;
@@ -169,6 +146,29 @@ static void gen_lxvwsx(DisasContext *ctx)
     tcg_temp_free_i32(data);
 }
 
+static void gen_lxvdsx(DisasContext *ctx)
+{
+    TCGv EA;
+    TCGv_i64 data;
+
+    if (unlikely(!ctx->vsx_enabled)) {
+        gen_exception(ctx, POWERPC_EXCP_VSXU);
+        return;
+    }
+
+    gen_set_access_type(ctx, ACCESS_INT);
+    EA = tcg_temp_new();
+
+    gen_addr_reg_index(ctx, EA);
+
+    data = tcg_temp_new_i64();
+    tcg_gen_qemu_ld_i64(data, EA, ctx->mem_idx, MO_TEQ);
+    tcg_gen_gvec_dup_i64(MO_Q, vsr_full_offset(xT(ctx->opcode)), 16, 16, data);
+
+    tcg_temp_free(EA);
+    tcg_temp_free_i64(data);
+}
+
 static void gen_bswap16x8(TCGv_i64 outh, TCGv_i64 outl,
                           TCGv_i64 inh, TCGv_i64 inl)
 {
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-09  9:17 [PATCH 1/2] ppc/translate: Implement lxvwsx opcode LemonBoy
  2020-11-09  9:17 ` [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives LemonBoy
@ 2020-11-09 17:39 ` Richard Henderson
  2020-11-10  9:14   ` LemonBoy
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2020-11-09 17:39 UTC (permalink / raw)
  To: LemonBoy, qemu-devel; +Cc: qemu-ppc, david

On 11/9/20 1:17 AM, LemonBoy wrote:
> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
> in Power ISA v3.0.
> 
> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
> ---
>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
>  target/ppc/translate/vsx-ops.c.inc  |  1 +
>  2 files changed, 31 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives
  2020-11-09  9:17 ` [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives LemonBoy
@ 2020-11-09 17:40   ` Richard Henderson
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Henderson @ 2020-11-09 17:40 UTC (permalink / raw)
  To: LemonBoy, qemu-devel; +Cc: qemu-ppc, david

On 11/9/20 1:17 AM, LemonBoy wrote:
> Make the implementation match the lxvwsx one.
> The code is now shorter smaller and potentially faster as the
> translation will use the host SIMD capabilities if available.
> 
> No functional change.
> 
> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
> ---
>  target/ppc/translate/vsx-impl.c.inc | 46 ++++++++++++++---------------
>  1 file changed, 23 insertions(+), 23 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-09 17:39 ` [PATCH 1/2] ppc/translate: Implement lxvwsx opcode Richard Henderson
@ 2020-11-10  9:14   ` LemonBoy
  2020-11-11  6:22     ` David Gibson
  2020-11-12  6:57     ` Greg Kurz
  0 siblings, 2 replies; 9+ messages in thread
From: LemonBoy @ 2020-11-10  9:14 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: qemu-ppc, david

Is there any chance for this patch series to be merged for 5.2?

On 09/11/20 18:39, Richard Henderson wrote:
> On 11/9/20 1:17 AM, LemonBoy wrote:
>> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
>> in Power ISA v3.0.
>>
>> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
>> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
>> ---
>>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
>>  target/ppc/translate/vsx-ops.c.inc  |  1 +
>>  2 files changed, 31 insertions(+)
> 
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> 
> r~
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-10  9:14   ` LemonBoy
@ 2020-11-11  6:22     ` David Gibson
  2020-11-14 17:13       ` Richard Henderson
  2020-11-12  6:57     ` Greg Kurz
  1 sibling, 1 reply; 9+ messages in thread
From: David Gibson @ 2020-11-11  6:22 UTC (permalink / raw)
  To: LemonBoy; +Cc: qemu-ppc, Richard Henderson, qemu-devel

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

On Tue, Nov 10, 2020 at 10:14:23AM +0100, LemonBoy wrote:
> Is there any chance for this patch series to be merged for 5.2?

No.  We are now in hard freeze, and this is not a bugfix.

> 
> On 09/11/20 18:39, Richard Henderson wrote:
> > On 11/9/20 1:17 AM, LemonBoy wrote:
> >> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
> >> in Power ISA v3.0.
> >>
> >> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
> >> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
> >> ---
> >>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
> >>  target/ppc/translate/vsx-ops.c.inc  |  1 +
> >>  2 files changed, 31 insertions(+)
> > 
> > Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> > 
> > r~
> > 
> 

-- 
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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-10  9:14   ` LemonBoy
  2020-11-11  6:22     ` David Gibson
@ 2020-11-12  6:57     ` Greg Kurz
  1 sibling, 0 replies; 9+ messages in thread
From: Greg Kurz @ 2020-11-12  6:57 UTC (permalink / raw)
  To: LemonBoy; +Cc: qemu-ppc, Richard Henderson, qemu-devel, david

On Tue, 10 Nov 2020 10:14:23 +0100
LemonBoy <thatlemon@gmail.com> wrote:

> Is there any chance for this patch series to be merged for 5.2?
> 

Not a chance. We're in hard freeze now.

> On 09/11/20 18:39, Richard Henderson wrote:
> > On 11/9/20 1:17 AM, LemonBoy wrote:
> >> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
> >> in Power ISA v3.0.
> >>
> >> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
> >> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
> >> ---
> >>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
> >>  target/ppc/translate/vsx-ops.c.inc  |  1 +
> >>  2 files changed, 31 insertions(+)
> > 
> > Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> > 
> > r~
> > 
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-11  6:22     ` David Gibson
@ 2020-11-14 17:13       ` Richard Henderson
  2020-11-23  6:13         ` David Gibson
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Henderson @ 2020-11-14 17:13 UTC (permalink / raw)
  To: David Gibson, LemonBoy; +Cc: qemu-ppc, qemu-devel

On 11/10/20 10:22 PM, David Gibson wrote:
> On Tue, Nov 10, 2020 at 10:14:23AM +0100, LemonBoy wrote:
>> Is there any chance for this patch series to be merged for 5.2?
> 
> No.  We are now in hard freeze, and this is not a bugfix.

Actually, patch 1/2 is a bugfix -- a missing instruction from an ISA that we
claim to implement.


r~

> 
>>
>> On 09/11/20 18:39, Richard Henderson wrote:
>>> On 11/9/20 1:17 AM, LemonBoy wrote:
>>>> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
>>>> in Power ISA v3.0.
>>>>
>>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
>>>> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
>>>> ---
>>>>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
>>>>  target/ppc/translate/vsx-ops.c.inc  |  1 +
>>>>  2 files changed, 31 insertions(+)
>>>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>>
>>> r~
>>>
>>
> 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] ppc/translate: Implement lxvwsx opcode
  2020-11-14 17:13       ` Richard Henderson
@ 2020-11-23  6:13         ` David Gibson
  0 siblings, 0 replies; 9+ messages in thread
From: David Gibson @ 2020-11-23  6:13 UTC (permalink / raw)
  To: Richard Henderson; +Cc: LemonBoy, qemu-ppc, qemu-devel

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

On Sat, Nov 14, 2020 at 09:13:33AM -0800, Richard Henderson wrote:
> On 11/10/20 10:22 PM, David Gibson wrote:
> > On Tue, Nov 10, 2020 at 10:14:23AM +0100, LemonBoy wrote:
> >> Is there any chance for this patch series to be merged for 5.2?
> > 
> > No.  We are now in hard freeze, and this is not a bugfix.
> 
> Actually, patch 1/2 is a bugfix -- a missing instruction from an ISA that we
> claim to implement.

Fair point.  I'm applying 1/2 to ppc-for-5.2 and 2/2 to ppc-for-6.0.

> 
> 
> r~
> 
> > 
> >>
> >> On 09/11/20 18:39, Richard Henderson wrote:
> >>> On 11/9/20 1:17 AM, LemonBoy wrote:
> >>>> Implement the "Load VSX Vector Word & Splat Indexed" opcode, introduced
> >>>> in Power ISA v3.0.
> >>>>
> >>>> Buglink: https://bugs.launchpad.net/qemu/+bug/1793608
> >>>> Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
> >>>> ---
> >>>>  target/ppc/translate/vsx-impl.c.inc | 30 +++++++++++++++++++++++++++++
> >>>>  target/ppc/translate/vsx-ops.c.inc  |  1 +
> >>>>  2 files changed, 31 insertions(+)
> >>>
> >>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> >>>
> >>> r~
> >>>
> >>
> > 
> 

-- 
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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-23  6:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09  9:17 [PATCH 1/2] ppc/translate: Implement lxvwsx opcode LemonBoy
2020-11-09  9:17 ` [PATCH 2/2] ppc/translate: Rewrite gen_lxvdsx to use gvec primitives LemonBoy
2020-11-09 17:40   ` Richard Henderson
2020-11-09 17:39 ` [PATCH 1/2] ppc/translate: Implement lxvwsx opcode Richard Henderson
2020-11-10  9:14   ` LemonBoy
2020-11-11  6:22     ` David Gibson
2020-11-14 17:13       ` Richard Henderson
2020-11-23  6:13         ` David Gibson
2020-11-12  6:57     ` Greg Kurz

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.