Skip to contentSkip to conversation

tests/tcg: Replace -mpower8-vector with -mvsx

PATCH Superseded Ilya Leoshkevich 2 participants 4 messages Oct 21, 2024 – Oct 23, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/tcg: Replace -mpower8-vector with -mvsx

[1] deprecated -mpower8-vector, resulting in:

    powerpc64-linux-gnu-gcc: warning: switch '-mpower8-vector' is no longer supported
    qemu/tests/tcg/ppc64/vsx_f2i_nan.c:4:15: error: expected ';' before 'float'
        4 | typedef vector float vsx_float32_vec_t;
          |               ^~~~~~

Similar to how this was done for the GCC testcases, replace -mpower8-vector with -mvsx.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109987

---
 tests/tcg/ppc64/Makefile.target | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
tests/tcg/ppc64/Makefile.target +5 -5
index 1940886c737..d1b00d2bf09 100644
@@ -6,7 +6,7 @@ VPATH += $(SRC_PATH)/tests/tcg/ppc64
 
 config-cc.mak: Makefile
 	$(quiet-@)( \
-	    $(call cc-option,-mpower8-vector,   CROSS_CC_HAS_POWER8_VECTOR); \
+	    $(call cc-option,-mvsx,             CROSS_CC_HAS_VSX); \
 	    $(call cc-option,-mpower10,         CROSS_CC_HAS_POWER10)) 3> config-cc.mak
 
 -include config-cc.mak
@@ -23,15 +23,15 @@ run-threadcount: threadcount
 run-plugin-threadcount-with-%:
 	$(call skip-test, $<, "BROKEN (flaky with clang) ")
 
-ifneq ($(CROSS_CC_HAS_POWER8_VECTOR),)
+ifneq ($(CROSS_CC_HAS_VSX),)
 PPC64_TESTS=bcdsub non_signalling_xscv
 endif
-$(PPC64_TESTS): CFLAGS += -mpower8-vector
+$(PPC64_TESTS): CFLAGS += -mvsx
 
-ifneq ($(CROSS_CC_HAS_POWER8_VECTOR),)
+ifneq ($(CROSS_CC_HAS_VSX),)
 PPC64_TESTS += vsx_f2i_nan
 endif
-vsx_f2i_nan: CFLAGS += -mpower8-vector -I$(SRC_PATH)/include
+vsx_f2i_nan: CFLAGS += -mvsx -I$(SRC_PATH)/include
 
 PPC64_TESTS += mtfsf
 PPC64_TESTS += mffsce
Signature · 1 line
2.47.0
#1 lore raw
Quoted 22 lines · Ilya Leoshkevich

[1] deprecated -mpower8-vector, resulting in:

     powerpc64-linux-gnu-gcc: warning: switch '-mpower8-vector' is no longer supported
     qemu/tests/tcg/ppc64/vsx_f2i_nan.c:4:15: error: expected ';' before 'float'
         4 | typedef vector float vsx_float32_vec_t;
           |               ^~~~~~

Similar to how this was done for the GCC testcases, replace -mpower8-vector with -mvsx.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109987

---
  tests/tcg/ppc64/Makefile.target | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
tests/tcg/ppc64/Makefile.target +0 -0
index 1940886c737..d1b00d2bf09 100644

tests/tcg/ppc64/Makefile.target VPATH += $(SRC_PATH)/tests/tcg/ppc64 · line 10

Quoted 6 lines
tests/tcg/ppc64/Makefile.target +1 -1
@@ -6,7 +6,7 @@ VPATH += $(SRC_PATH)/tests/tcg/ppc64
 
  config-cc.mak: Makefile
  	$(quiet-@)( \
-	    $(call cc-option,-mpower8-vector,   CROSS_CC_HAS_POWER8_VECTOR); \
+	    $(call cc-option,-mvsx,             CROSS_CC_HAS_VSX); \
  	    $(call cc-option,-mpower10,         CROSS_CC_HAS_POWER10)) 3> config-cc.mak

I don't think this is quite right.
I think you need -mpower8 to get OPTION_MASK_P8_VECTOR set.

tests/tcg/ppc64/Makefile.target run-threadcount: threadcount · line 27

Quoted 2 lines
tests/tcg/ppc64/Makefile.target +1 -0
+ifneq ($(CROSS_CC_HAS_VSX),)
  PPC64_TESTS=bcdsub non_signalling_xscv

bcdsub is not in the base VSX instruction set, for instance.

r~

#2 lore raw
Quoted 30 lines · Richard Henderson
Quoted 29 lines · Ilya Leoshkevich

[1] deprecated -mpower8-vector, resulting in:

     powerpc64-linux-gnu-gcc: warning: switch '-mpower8-vector' is no longer supported qemu/tests/tcg/ppc64/vsx_f2i_nan.c:4:15: error: expected ';' before 'float'
         4 | typedef vector float vsx_float32_vec_t;
           |               ^~~~~~

Similar to how this was done for the GCC testcases, replace -mpower8-vector with -mvsx.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109987

---
  tests/tcg/ppc64/Makefile.target | 10 +++++-----

  1 file changed, 5 insertions(+), 5 deletions(-)
tests/tcg/ppc64/Makefile.target +0 -0
index 1940886c737..d1b00d2bf09 100644
@@ -6,7 +6,7 @@ VPATH += $(SRC_PATH)/tests/tcg/ppc64


  config-cc.mak: Makefile
   $(quiet-@)( \

tests/tcg/ppc64/Makefile.target +0 -1
-	    $(call cc-option,-mpower8-vector,  
Quoted 8 lines
Quoted 5 lines

CROSS_CC_HAS_POWER8_VECTOR); \

tests/tcg/ppc64/Makefile.target +1 -0
+	    $(call cc-option,-mvsx,             CROSS_CC_HAS_VSX);

\
       $(call cc-option,-mpower10,
CROSS_CC_HAS_POWER10)) 3> config-cc.mak

I don't think this is quite right.
I think you need -mpower8 to get OPTION_MASK_P8_VECTOR set.

Do you mean -mcpu=power8? -mpower8 is a GAS option.

Quoted 8 lines
Quoted 3 lines

+ifneq ($(CROSS_CC_HAS_VSX),)
  PPC64_TESTS=bcdsub non_signalling_xscv

bcdsub is not in the base VSX instruction set, for instance.

r~

I was confused why -mvsx works in practice, so I spent some time and managed to create a "hostile" gcc build, in which this is now a problem, using:

    ./configure --target=powerpc64-linux-gnu --enable-checking \
                --disable-bootstrap \
                --with-as="$(which powerpc64-linux-gnu-as)"

The issue is masked by two things:

- GCC passes "-many" to GAS. GCC commit e154242724b0 ("[RS6000] Don't pass -many to the assembler") stops --enable-checking builds from doing this.

- binutils has the following line:

  /* The minimum supported cpu for 64-bit little-endian is power8.  */
  ppc_cpu |= ppc_parse_cpu (ppc_cpu, &sticky, "power8");

so one needs to use the big-endian toolchain to see the problem.

I'll send a v2.

#3 lore raw
Quoted 40 lines · Ilya Leoshkevich
Quoted 27 lines · Richard Henderson
Quoted 26 lines · Ilya Leoshkevich

[1] deprecated -mpower8-vector, resulting in:

     powerpc64-linux-gnu-gcc: warning: switch '-mpower8-vector' is
no longer supported
     qemu/tests/tcg/ppc64/vsx_f2i_nan.c:4:15: error: expected ';'
before 'float'
         4 | typedef vector float vsx_float32_vec_t;
           |               ^~~~~~

Similar to how this was done for the GCC testcases, replace -mpower8-vector with -mvsx.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109987

---
   tests/tcg/ppc64/Makefile.target | 10 +++++-----
   1 file changed, 5 insertions(+), 5 deletions(-)
tests/tcg/ppc64/Makefile.target +0 -0
index 1940886c737..d1b00d2bf09 100644
@@ -6,7 +6,7 @@ VPATH += $(SRC_PATH)/tests/tcg/ppc64
 
Quoted 11 lines
Quoted 8 lines
tests/tcg/ppc64/Makefile.target +1 -1
   config-cc.mak: Makefile
   	$(quiet-@)( \
-	    $(call cc-option,-mpower8-vector,
 CROSS_CC_HAS_POWER8_VECTOR); \
+	    $(call cc-option,-mvsx,             CROSS_CC_HAS_VSX);
 \
   	    $(call cc-option,-mpower10,

CROSS_CC_HAS_POWER10)) 3> config-cc.mak

I don't think this is quite right.
I think you need -mpower8 to get OPTION_MASK_P8_VECTOR set.

Quoted 1 line

Do you mean -mcpu=power8? -mpower8 is a GAS option.

It looks like I do, yes.
Also in that vein, -mpower10 has been marked WarnRemoved in gcc trunk.

Quoted 14 lines

I was confused why -mvsx works in practice, so I spent some time and managed to create a "hostile" gcc build, in which this is now a problem, using:

     ./configure --target=powerpc64-linux-gnu --enable-checking \
                 --disable-bootstrap \
                 --with-as="$(which powerpc64-linux-gnu-as)"

The issue is masked by two things:

- GCC passes "-many" to GAS. GCC commit e154242724b0 ("[RS6000] Don't pass -many to the assembler") stops --enable-checking builds from doing this.

Quoted 6 lines

- binutils has the following line:

   /* The minimum supported cpu for 64-bit little-endian is power8.  */
   ppc_cpu |= ppc_parse_cpu (ppc_cpu, &sticky, "power8");

so one needs to use the big-endian toolchain to see the problem.

Ah hah! Good sleuthing.

r~