[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 0/5] migration pull
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 0/5] migration pull |
Date: |
Tue, 23 Feb 2016 10:43:14 +0000 |
On 23 February 2016 at 09:48, Paolo Bonzini <address@hidden> wrote:
> On 23/02/2016 10:09, Peter Maydell wrote:
>> Hi. I'm afraid this doesn't compile for x86-64 Linux:
>
> What compiler is this, and does the following compile with no particular
> extra options?
>
> #pragma GCC target("avx2")
> #include <immintrin.h>
> __m256i foo;
This is stock gcc from Ubuntu trusty:
$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
That code fragment you suggest compiles fine normally, but not if I
add -save-temps:
$ cat /tmp/zz9.c
#pragma GCC target("avx2")
#include <immintrin.h>
__m256i foo;
$ gcc -g -Wall -o /tmp/zz9.o -c /tmp/zz9.c
$ echo $?
0
$ gcc -g -Wall -o /tmp/zz9.o -c /tmp/zz9.c -save-temps
/tmp/zz9.c:4:1: error: unknown type name ‘__m256i’
__m256i foo;
^
/tmp/zz9.c: In function ‘bar’:
/tmp/zz9.c:7:19: error: ‘__m256i’ undeclared (first use in this function)
return sizeof(__m256i);
^
/tmp/zz9.c:7:19: note: each undeclared identifier is reported only
once for each function it appears in
/tmp/zz9.c:8:1: warning: control reaches end of non-void function
[-Wreturn-type]
}
^
This seems to be because -save-temps causes the #pragma not to
actually #define __AVX__.
This feels all pretty fragile to me and I think we should
probably avoid messing with the target pragma if we can.
thanks
-- PMM
- [Qemu-devel] [PULL 0/5] migration pull, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 1/5] migration: move bdrv_invalidate_cache_all of of coroutine context, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 2/5] migration: move bdrv_invalidate_cache_all of of coroutine context, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 3/5] migration: reorder code to make it symmetric, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 4/5] configure: detect ifunc and avx2 attribute, Amit Shah, 2016/02/23
- [Qemu-devel] [PULL 5/5] cutils: add avx2 instruction optimization, Amit Shah, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Peter Maydell, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Amit Shah, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Paolo Bonzini, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull,
Peter Maydell <=
- Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Peter Maydell, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Paolo Bonzini, 2016/02/23
- Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/24
Re: [Qemu-devel] [PULL 0/5] migration pull, Li, Liang Z, 2016/02/23