Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ppc64 clang: error: use of 'double' with '__vector' requires VSX support to be enabled (available on POWER7 or later) #185

Open
mr-c opened this issue Apr 14, 2020 · 6 comments
Assignees

Comments

@mr-c
Copy link
Collaborator

mr-c commented Apr 14, 2020

/usr/bin/clang++  -DSIMDE_BUILD_CPP_TESTS -I/<<PKGBUILDDIR>>/test/..  -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2   -o CMakeFiles/simde-test-native.dir/x86/sse2.cpp.o -c /<<PKGBUILDDIR>>/clang_test/x86/sse2.cpp
In file included from /<<PKGBUILDDIR>>/test/x86/sse2.c:25:
In file included from /<<PKGBUILDDIR>>/test/../test/x86/test-sse2.h:1:
In file included from /<<PKGBUILDDIR>>/test/x86/../../simde/x86/sse2.h:35:
/<<PKGBUILDDIR>>/test/x86/../../simde/x86/sse.h:140:26: error: use of 'double' with '__vector' requires VSX support to be enabled (available on POWER7 or later)
  SIMDE_ALIGN(16) vector double             altivec_f64;

gcc compiled just fine, so I'll disable clang on ppc64 for now. This isn't an official Debian architectures, unlike s390x, so please don't consider it a priority.

https://buildd.debian.org/status/fetch.php?pkg=simde&arch=ppc64&ver=0.0.0.git.20200414-1&stamp=1586860934&raw=0

@nemequ nemequ self-assigned this Apr 21, 2020
nemequ added a commit that referenced this issue May 6, 2020
@nemequ nemequ closed this as completed in 489ef68 May 6, 2020
@nemequ
Copy link
Member

nemequ commented May 6, 2020

I think this should work now, but I don't really have a good way to test. If it's still not working please re-open and I'll try to get a VM running.

@mr-c
Copy link
Collaborator Author

mr-c commented May 9, 2020

[  1%] Building C object CMakeFiles/simde-test-native.dir/x86/mmx.c.o
/usr/lib/ccache/gcc -DSIMDE_BUILD_CPP_TESTS -I/build/simde-0.0.0.git.20200508/test/..  -g -O2 -fdebug-prefix-map=/build/simde-0.0.0.git.20200508=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DSIMDE_ENABLE_OPENMP -fopenmp-simd   -std=gnu99 -Wno-psabi -Wno-psabi -o CMakeFiles/simde-test-native.dir/x86/mmx.c.o   -c /build/simde-0.0.0.git.20200508/test/x86/mmx.c
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/../simde-features.h:292,
                 from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/../simde-common.h:38,
                 from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/mmx.h:30,
                 from /build/simde-0.0.0.git.20200508/test/../test/x86/test-mmx.h:1,
                 from /build/simde-0.0.0.git.20200508/test/x86/mmx.c:25:
/usr/lib/gcc/powerpc64-linux-gnu/9/include/altivec.h:34:2: error: #error Use the "-maltivec" flag to enable PowerPC AltiVec support
   34 | #error Use the "-maltivec" flag to enable PowerPC AltiVec support
      |  ^~~~~
/build/simde-0.0.0.git.20200508/test/../test/x86/../munit/munit.h:112:24: error: expected specifier-qualifier-list before ‘__bool’
  112 | #    define munit_bool bool
      |                        ^~~~
/build/simde-0.0.0.git.20200508/test/../test/x86/../munit/munit.h:472:3: note: in expansion of macro ‘munit_bool’
  472 |   munit_bool (* parse_argument)(const MunitSuite* suite, void* user_data, int* arg, int argc, char* const argv[MUNIT_ARRAY_PARAM(argc + 1)]);
      |   ^~~~~~~~~~

@mr-c mr-c reopened this May 9, 2020
@mr-c
Copy link
Collaborator Author

mr-c commented May 9, 2020

As per https://wiki.debian.org/ArchitectureSpecificsMemo#Architecture_baselines ppc64 is supposed to support altivec, so I'll add -maltivec to our build (though the Debian gcc should not really require it, given what that wiki page says!)

@mr-c
Copy link
Collaborator Author

mr-c commented May 9, 2020

Here's the failure from the clang side (without -maltivec)

[  2%] Building C object CMakeFiles/simde-test-native.dir/x86/sse.c.o
/usr/lib/ccache/clang -DSIMDE_BUILD_CPP_TESTS -I/build/simde-0.0.0.git.20200508/test/..  -g -O2 -fdebug-prefix-map=/build/simde-0.0.0.git.20200508=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -DSIMDE_ENABLE_OPENMP -fopenmp-simd   -std=gnu99 -o CMakeFiles/simde-test-native.dir/x86/sse.c.o   -c /build/simde-0.0.0.git.20200508/test/x86/sse.c
In file included from /build/simde-0.0.0.git.20200508/test/x86/sse.c:25:
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/test-sse2.h:1:
In file included from /build/simde-0.0.0.git.20200508/test/x86/../../simde/x86/sse2.h:35:
/build/simde-0.0.0.git.20200508/test/x86/../../simde/x86/sse.h:113:28: error: use of 'double' with '__vector' requires VSX support to be enabled (available on POWER7 or later)
    SIMDE_ALIGN(16) vector double             altivec_f64;
                           ^
1 error generated.
make[2]: *** [CMakeFiles/simde-test-native.dir/build.make:79: CMakeFiles/simde-test-native.dir/x86/sse.c.o] Error 1
make[2]: Leaving directory '/build/simde-0.0.0.git.20200508/clang_test'
make[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/simde-test-native.dir/all] Error 2
make[1]: Leaving directory '/build/simde-0.0.0.git.20200508/clang_test'
make: *** [Makefile:98: all] Error 2

@mr-c
Copy link
Collaborator Author

mr-c commented May 9, 2020

Now, with -maltivec added:

[  2%] Building C object CMakeFiles/simde-test-native.dir/x86/sse.c.o
/usr/lib/ccache/gcc -DSIMDE_BUILD_CPP_TESTS -I/build/simde-0.0.0.git.20200508/test/..  -g -O2 -fdebug-prefix-map=/build/simde-0.0.0.git.20200508=. -fstack-protector-strong -Wformat -Werror=format-security -maltivec -Wdate-time -D_FORTIFY_SOURCE=2 -DSIMDE_ENABLE_OPENMP -fopenmp-simd   -std=gnu99 -Wno-psabi -Wno-psabi -o CMakeFiles/simde-test-native.dir/x86/sse.c.o   -c /build/simde-0.0.0.git.20200508/test/x86/sse.c
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/sse2.h:35,
                 from /build/simde-0.0.0.git.20200508/test/../test/x86/test-sse2.h:1,
                 from /build/simde-0.0.0.git.20200508/test/x86/sse.c:25:
/build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/sse.h:106:3: error: use of ‘long long’ in AltiVec types is invalid without ‘-mvsx’
  106 |   SIMDE_ALIGN(16) vector unsigned long long altivec_u64;
      |   ^~~~~~~~~~~
/build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/sse.h:110:3: error: use of ‘long long’ in AltiVec types is invalid without ‘-mvsx’
  110 |   SIMDE_ALIGN(16) vector signed long long   altivec_i64;
      |   ^~~~~~~~~~~
/build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/sse.h:113:28: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ before ‘double’
  113 |     SIMDE_ALIGN(16) vector double             altivec_f64;
      |                            ^~~~~~
make[4]: *** [CMakeFiles/simde-test-native.dir/build.make:79: CMakeFiles/simde-test-native.dir/x86/sse.c.o] Error 1

We can not unconditionally enable -mvsx for Debian on ppc64 as that was introduced with Power ISA v2.06 according to https://en.wikipedia.org/wiki/AltiVec#VSX_(Vector_Scalar_Extension) and according to https://wiki.debian.org/PPC64 supported CPUs include the PowerPC 970/POWER5/POWER6 which is Power ISA v.2.03

For fun, I also enabled -mvsx just to see what would happen. The GCC build worked, but the clang build had the following errors:

[ 23%] Building CXX object CMakeFiles/simde-test-native.dir/x86/mmx.cpp.o
/usr/lib/ccache/clang++  -DSIMDE_BUILD_CPP_TESTS -I/build/simde-0.0.0.git.20200508/test/..  -g -O2 -fdebug-prefix-map=/build/simde-0.0.0.git.20200508=. -fstack-protector-strong -Wformat -Werror=format-security -maltivec -mvsx -Wdate-time -D_FORTIFY_SOURCE=2   -o CMakeFiles/simde-test-native.dir/x86/mmx.cpp.o -c /build/simde-0.0.0.git.20200508/clang_test/x86/mmx.cpp
In file included from /build/simde-0.0.0.git.20200508/clang_test/x86/mmx.cpp:25:
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/test-mmx.h:1:
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/mmx.h:30:
In file included from /build/simde-0.0.0.git.20200508/test/../test/x86/../../simde/x86/../simde-common.h:795:
In file included from /usr/bin/../lib/gcc/powerpc64-linux-gnu/9/../../../../include/c++/9/math.h:36:
In file included from /usr/bin/../lib/gcc/powerpc64-linux-gnu/9/../../../../include/c++/9/cmath:47:
/usr/bin/../lib/gcc/powerpc64-linux-gnu/9/../../../../include/c++/9/bits/std_abs.h:52:11: error: using declaration requires a qualified name
  using ::abs;
          ^

@mr-c
Copy link
Collaborator Author

mr-c commented May 9, 2020

FYI: with -mvsx -maltivec the gcc compiled tests do pass in a ppc64 qemu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants