qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang
@ 2019-08-09  4:19 Rebecca Cran
  2019-08-09  4:52 ` no-reply
  2019-08-09  5:22 ` Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Rebecca Cran @ 2019-08-09  4:19 UTC (permalink / raw)
  To: qemu-devel, Michael Tokarev, Laurent Vivier, qemu-trivial; +Cc: Rebecca Cran

clang doesn't support the GCC pragma to enable AVX2, but instead
requires the command line option -mavx2. Since GCC also supports that,
remove the pragma lines and add the -mavx2 option when building the
test.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 configure | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/configure b/configure
index 714e7fb6a1..30d6c02ab4 100755
--- a/configure
+++ b/configure
@@ -5392,8 +5392,6 @@ fi
 
 if test "$cpuid_h" = "yes" && test "$avx2_opt" != "no"; then
   cat > $TMPC << EOF
-#pragma GCC push_options
-#pragma GCC target("avx2")
 #include <cpuid.h>
 #include <immintrin.h>
 static int bar(void *a) {
@@ -5402,7 +5400,7 @@ static int bar(void *a) {
 }
 int main(int argc, char *argv[]) { return bar(argv[0]); }
 EOF
-  if compile_object "" ; then
+  if compile_object "-mavx2" ; then
     avx2_opt="yes"
   else
     avx2_opt="no"
-- 
2.22.0



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

* Re: [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang
  2019-08-09  4:19 [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang Rebecca Cran
@ 2019-08-09  4:52 ` no-reply
  2019-08-09  5:22 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: no-reply @ 2019-08-09  4:52 UTC (permalink / raw)
  To: rebecca; +Cc: qemu-trivial, rebecca, mjt, qemu-devel, laurent

Patchew URL: https://patchew.org/QEMU/20190809041952.57302-1-rebecca@bsdio.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      util/qemu-sockets.o
  CC      util/uri.o
  CC      util/notify.o
/tmp/qemu-test/src/util/bufferiszero.c:71:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC push_options
            ^
/tmp/qemu-test/src/util/bufferiszero.c:72:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC target("sse2")
            ^
/tmp/qemu-test/src/util/bufferiszero.c:108:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC pop_options
            ^
/tmp/qemu-test/src/util/bufferiszero.c:116:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC push_options
            ^
/tmp/qemu-test/src/util/bufferiszero.c:117:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC target("sse4")
            ^
/tmp/qemu-test/src/util/bufferiszero.c:148:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC pop_options
            ^
/tmp/qemu-test/src/util/bufferiszero.c:149:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC push_options
            ^
/tmp/qemu-test/src/util/bufferiszero.c:150:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC target("avx2")
            ^
/tmp/qemu-test/src/util/bufferiszero.c:187:13: error: unknown pragma ignored [-Werror,-Wunknown-pragmas]
#pragma GCC pop_options
            ^
9 errors generated.


The full log is available at
http://patchew.org/logs/20190809041952.57302-1-rebecca@bsdio.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang
  2019-08-09  4:19 [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang Rebecca Cran
  2019-08-09  4:52 ` no-reply
@ 2019-08-09  5:22 ` Richard Henderson
  2019-08-09 15:17   ` Rebecca Cran
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2019-08-09  5:22 UTC (permalink / raw)
  To: Rebecca Cran, qemu-devel, Michael Tokarev, Laurent Vivier, qemu-trivial

On 8/8/19 9:19 PM, Rebecca Cran wrote:
> clang doesn't support the GCC pragma to enable AVX2, but instead
> requires the command line option -mavx2. Since GCC also supports that,
> remove the pragma lines and add the -mavx2 option when building the
> test.

No, this means we're not testing what we need:

We need to compile exactly one function using avx2.

The other functions should be compiled with sse4 and sse2, respectively, and we
choose between them by testing cpuid bits at startup.  If you supply -mavx2 to
the entire compilation, then the routine that is supposed to use only sse2 will
in fact use avx2, and then the runtime selection is moot.


r~


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

* Re: [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang
  2019-08-09  5:22 ` Richard Henderson
@ 2019-08-09 15:17   ` Rebecca Cran
  0 siblings, 0 replies; 4+ messages in thread
From: Rebecca Cran @ 2019-08-09 15:17 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel, Michael Tokarev, Laurent Vivier,
	qemu-trivial

On 2019-08-08 23:22, Richard Henderson wrote:
>
> No, this means we're not testing what we need:
>
> We need to compile exactly one function using avx2.
>
> The other functions should be compiled with sse4 and sse2, respectively, and we
> choose between them by testing cpuid bits at startup.  If you supply -mavx2 to
> the entire compilation, then the routine that is supposed to use only sse2 will
> in fact use avx2, and then the runtime selection is moot.


Oh, sorry, I hadn't fully realized there's runtime selection. Fixing
this would require significant rework in that case, so I'll just build
with GCC instead for now!


-- 
Rebecca Cran



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

end of thread, other threads:[~2019-08-09 15:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09  4:19 [Qemu-devel] [PATCH] Update the avx2 configure test to be compatible with clang Rebecca Cran
2019-08-09  4:52 ` no-reply
2019-08-09  5:22 ` Richard Henderson
2019-08-09 15:17   ` Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).