qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 7/9] cutils: Rewrite x86 buffer zero checking


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 7/9] cutils: Rewrite x86 buffer zero checking
Date: Tue, 13 Sep 2016 17:47:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 13/09/2016 16:49, Paolo Bonzini wrote:
> 
> 
> On 13/09/2016 16:17, Paolo Bonzini wrote:
>>
>>
>> On 13/09/2016 15:26, Paolo Bonzini wrote:
>>> I need this on top to fix compilation with older compilers:
>>>
>>> diff --git a/util/bufferiszero.c b/util/bufferiszero.c
>>> index 3b39f82..1ce6b7a 100644
>>> --- a/util/bufferiszero.c
>>> +++ b/util/bufferiszero.c
>>> @@ -71,13 +71,13 @@ buffer_zero_int(const void *buf, size_t len)
>>>
>>>  #if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
>>>  #include <cpuid.h>
>>> -#include <x86intrin.h>
>>>
>>>  /* Note that we're going to check for LEN >= 64 for all of these.  */
>>>
>>>  #ifdef CONFIG_AVX2_OPT
>>>  #pragma GCC push_options
>>>  #pragma GCC target("avx2")
>>> +#include <immintrin.h>
>>>
>>>  static bool
>>>  buffer_zero_avx2(const void *buf, size_t len)
>>> @@ -181,6 +181,8 @@ buffer_zero_sse4(const void *buf, size_t len)
>>>  #pragma GCC target("sse2")
>>>  #endif /* CONFIG_AVX2_OPT */
>>>
>>> +#include <emmintrin.h>
>>> +
>>>  static bool
>>>  buffer_zero_sse2(const void *buf, size_t len)
>>>  {
>>>
>>
>> Nope, not enough on GCC 4.8:
>>
>> $ nm util/bufferiszero.o
>> 0000000000000000 b buffer_accel
>> 0000000000000430 T buffer_is_zero
>> 0000000000000240 t buffer_zero_avx
>> 0000000000000330 t buffer_zero_avx2
>> 0000000000000000 t buffer_zero_int
>> 00000000000000b0 t buffer_zero_sse2
>> 0000000000000190 t buffer_zero_sse4
>> 0000000000000008 b cpuid_cache
>>                  U _GLOBAL_OFFSET_TABLE_
>> 0000000000000000 t init_cpuid_cache
>>                  U _mm_cmpeq_epi8
>>                  U _mm_loadu_si128
>>                  U _mm_movemask_epi8
>>                  U _mm_setzero_si128
>>                  U _mm_testz_si128
>> 00000000000003d0 T test_buffer_is_zero_next_accel
>>
>> Since I have no idea what's going on, I'm dropping these the last three
>> patches.
> 
> I still have no idea what's going on, but dropping this patch is enough.

Ok, it's the AVX version, the failure somehow is related to vptest not
being in AVX1.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]