[Mesa-stable] [Mesa-dev] [PATCH] configure.ac: fix test for SSE4.1 assembler support
Oded Gabbay
oded.gabbay at gmail.com
Thu Dec 10 00:42:45 PST 2015
On Wed, Dec 9, 2015 at 8:30 PM, Matt Turner <mattst88 at gmail.com> wrote:
> On Tue, Dec 8, 2015 at 9:37 PM, Jonathan Gray <jsg at jsg.id.au> wrote:
>> Change the __m128i variables to be volatile so gcc 4.9 won't optimise
>> all of them out with -O1 or greater. The _mm_set1_epi32/pinsrd calls
>> still get optimised out but now there is at least one SSE4.1 instruction
>> generated via _mm_max_epu32/pmaxud. When all of the sse4.1 instructions
>> got optimised out the configure test would incorrectly pass when the
>> compiler supported the intrinsics and the assembler didn't support the
>> instructions.
>>
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91806
>> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
>> Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
>> ---
>> configure.ac | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 260934d..1d82e47 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -384,7 +384,7 @@ CFLAGS="$SSE41_CFLAGS $CFLAGS"
>> AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
>> #include <smmintrin.h>
>> int main () {
>> - __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
>> + volatile __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
>> c = _mm_max_epu32(a, b);
>> return 0;
>
> I would have extracted an int from the result of _mm_max_epu32 and
> returned that instead of 0.
Instead of the volatile I assume ?
> _______________________________________________
> mesa-stable mailing list
> mesa-stable at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-stable
More information about the mesa-stable
mailing list