All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction
@ 2017-03-07  0:39 Cyril Bur
  2017-03-07 10:12 ` Balbir Singh
  2017-03-14 11:45 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Cyril Bur @ 2017-03-07  0:39 UTC (permalink / raw)
  To: linuxppc-dev

On POWER8 (ISA 2.07) lxvx and stxvx are defined to be extended mnemonics
of lxvd2x and stxvd2x. For POWER9 (ISA 3.0) the HW architects in their
infinite wisdom made lxvx and stxvx instructions in their own right.

POWER9 aware GCC will use the POWER9 instruction for lxvx and stxvx
causing these selftests to fail on POWER8. Further compounding the
issue, because of the way -mvsx works it will cause the power9
instructions to be used regardless of -mcpu=power8 to GCC or -mpower8 to
AS.

The safest way to address the problem for now is to not use the extended
mnemonic. These tests only perform register comparisons the big endian
only byte ordering for stxvd2x and lxvd2x does not impact the test.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
 tools/testing/selftests/powerpc/include/vsx_asm.h | 48 +++++++++++------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/tools/testing/selftests/powerpc/include/vsx_asm.h b/tools/testing/selftests/powerpc/include/vsx_asm.h
index d828bfb6ef2d..54064ced9e95 100644
--- a/tools/testing/selftests/powerpc/include/vsx_asm.h
+++ b/tools/testing/selftests/powerpc/include/vsx_asm.h
@@ -16,56 +16,56 @@
  */
 FUNC_START(load_vsx)
 	li	r5,0
-	lxvx	vs20,r5,r3
+	lxvd2x	vs20,r5,r3
 	addi	r5,r5,16
-	lxvx	vs21,r5,r3
+	lxvd2x	vs21,r5,r3
 	addi	r5,r5,16
-	lxvx	vs22,r5,r3
+	lxvd2x	vs22,r5,r3
 	addi	r5,r5,16
-	lxvx	vs23,r5,r3
+	lxvd2x	vs23,r5,r3
 	addi	r5,r5,16
-	lxvx	vs24,r5,r3
+	lxvd2x	vs24,r5,r3
 	addi	r5,r5,16
-	lxvx	vs25,r5,r3
+	lxvd2x	vs25,r5,r3
 	addi	r5,r5,16
-	lxvx	vs26,r5,r3
+	lxvd2x	vs26,r5,r3
 	addi	r5,r5,16
-	lxvx	vs27,r5,r3
+	lxvd2x	vs27,r5,r3
 	addi	r5,r5,16
-	lxvx	vs28,r5,r3
+	lxvd2x	vs28,r5,r3
 	addi	r5,r5,16
-	lxvx	vs29,r5,r3
+	lxvd2x	vs29,r5,r3
 	addi	r5,r5,16
-	lxvx	vs30,r5,r3
+	lxvd2x	vs30,r5,r3
 	addi	r5,r5,16
-	lxvx	vs31,r5,r3
+	lxvd2x	vs31,r5,r3
 	blr
 FUNC_END(load_vsx)
 
 FUNC_START(store_vsx)
 	li	r5,0
-	stxvx	vs20,r5,r3
+	stxvd2x	vs20,r5,r3
 	addi	r5,r5,16
-	stxvx	vs21,r5,r3
+	stxvd2x	vs21,r5,r3
 	addi	r5,r5,16
-	stxvx	vs22,r5,r3
+	stxvd2x	vs22,r5,r3
 	addi	r5,r5,16
-	stxvx	vs23,r5,r3
+	stxvd2x	vs23,r5,r3
 	addi	r5,r5,16
-	stxvx	vs24,r5,r3
+	stxvd2x	vs24,r5,r3
 	addi	r5,r5,16
-	stxvx	vs25,r5,r3
+	stxvd2x	vs25,r5,r3
 	addi	r5,r5,16
-	stxvx	vs26,r5,r3
+	stxvd2x	vs26,r5,r3
 	addi	r5,r5,16
-	stxvx	vs27,r5,r3
+	stxvd2x	vs27,r5,r3
 	addi	r5,r5,16
-	stxvx	vs28,r5,r3
+	stxvd2x	vs28,r5,r3
 	addi	r5,r5,16
-	stxvx	vs29,r5,r3
+	stxvd2x	vs29,r5,r3
 	addi	r5,r5,16
-	stxvx	vs30,r5,r3
+	stxvd2x	vs30,r5,r3
 	addi	r5,r5,16
-	stxvx	vs31,r5,r3
+	stxvd2x	vs31,r5,r3
 	blr
 FUNC_END(store_vsx)
-- 
2.12.0

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

* Re: [PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction
  2017-03-07  0:39 [PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction Cyril Bur
@ 2017-03-07 10:12 ` Balbir Singh
  2017-03-14 11:45 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Balbir Singh @ 2017-03-07 10:12 UTC (permalink / raw)
  To: Cyril Bur; +Cc: open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)

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

On 07-Mar-2017 11:43 AM, "Cyril Bur" <cyrilbur@gmail.com> wrote:

On POWER8 (ISA 2.07) lxvx and stxvx are defined to be extended mnemonics
of lxvd2x and stxvd2x. For POWER9 (ISA 3.0) the HW architects in their
infinite wisdom made lxvx and stxvx instructions in their own right.

POWER9 aware GCC will use the POWER9 instruction for lxvx and stxvx
causing these selftests to fail on POWER8. Further compounding the
issue, because of the way -mvsx works it will cause the power9
instructions to be used regardless of -mcpu=power8 to GCC or -mpower8 to
AS.

The safest way to address the problem for now is to not use the extended
mnemonic. These tests only perform register comparisons the big endian
only byte ordering for stxvd2x and lxvd2x does not impact the test.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---



Acked-by: Balbir Singh<bsingharora@gmail.com>

[-- Attachment #2: Type: text/html, Size: 1380 bytes --]

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

* Re: selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction
  2017-03-07  0:39 [PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction Cyril Bur
  2017-03-07 10:12 ` Balbir Singh
@ 2017-03-14 11:45 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-03-14 11:45 UTC (permalink / raw)
  To: Cyril Bur, linuxppc-dev

On Tue, 2017-03-07 at 00:39:31 UTC, Cyril Bur wrote:
> On POWER8 (ISA 2.07) lxvx and stxvx are defined to be extended mnemonics
> of lxvd2x and stxvd2x. For POWER9 (ISA 3.0) the HW architects in their
> infinite wisdom made lxvx and stxvx instructions in their own right.
> 
> POWER9 aware GCC will use the POWER9 instruction for lxvx and stxvx
> causing these selftests to fail on POWER8. Further compounding the
> issue, because of the way -mvsx works it will cause the power9
> instructions to be used regardless of -mcpu=power8 to GCC or -mpower8 to
> AS.
> 
> The safest way to address the problem for now is to not use the extended
> mnemonic. These tests only perform register comparisons the big endian
> only byte ordering for stxvd2x and lxvd2x does not impact the test.
> 
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> Acked-by: Balbir Singh<bsingharora@gmail.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/605df8d674ac65e044a0bf4998b28c

cheers

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

end of thread, other threads:[~2017-03-14 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07  0:39 [PATCH] selftests/powerpc: Replace stxvx and lxvx with their equivalent instruction Cyril Bur
2017-03-07 10:12 ` Balbir Singh
2017-03-14 11:45 ` Michael Ellerman

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.