Commit 1a3f484 Ticket 49228 - Fix SSE4.2 detection.

3 files Authored by firstyear 3 days ago , Committed by mreynolds 3 days ago ,
Ticket 49228 - Fix SSE4.2 detection.

Bug Description:  We incorrectly detect sse4.2 on some platforms.

Fix Description:  Instead of detecting this, we allow GCC to define
the feature flag when possible. At this time, we only use sse4.2
for verification during tests. RPMS build with -mtune=generic, which
will disable sse4.2, so anyone who wants "fast" test execution
(ie a developer) should set -march=native in their cflags.

https://pagure.io/389-ds-base/issue/49228

Author: wibrown

Review by: mreynolds

Signed-off-by: Mark Reynolds <mreynolds@redhat.com>

    
 1 @@ -654,21 +654,9 @@
 2       ;;
 3   esac
 4   
 5 - AC_MSG_CHECKING([for SSE4.2 features ...])
 6 - save_CFLAGS="$CFLAGS"
 7 - CFLAGS="$CFLAGS -msse4.2"
 8 - AC_TRY_COMPILE(
 9 -     [],
10 -     [return 0;],
11 -     [
12 -         AC_DEFINE([HAVE_SSE4_2], [1], [Have sss4.2 on this platform arch])
13 -         AC_MSG_RESULT([SSE4.2 avaliable on this platform])
14 -     ],
15 -     [
16 -         AC_MSG_RESULT([SSE4.2 not avaliable on this platform])
17 -     ]
18 - )
19 - CFLAGS="$save_CFLAGS"
20 + ### TO CHECK FOR SSE4.2!!!
21 + # gcc -march=native -dM -E - < /dev/null | grep SSE
22 + # We can just use the define in GCC instead!
23   
24   AC_MSG_CHECKING([for GCC provided 64-bit atomic operations])
25   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 1 @@ -15,7 +15,7 @@
 2   #include <stdlib.h>
 3   #include <stdio.h>
 4   
 5 - #ifdef HAVE_SSE4_2
 6 + #ifdef __SSE4_2__
 7   
 8   #if CPU_x86_64
 9   #define REX_PRE "0x48, "
10 @@ -146,5 +146,5 @@
11       return crc;
12   }
13   
14 - #endif
15 + #endif /* __SSE4_2__ */
16   
 1 @@ -12,14 +12,12 @@
 2   int
 3   main ( int argc __attribute__((unused)), char **argv __attribute__((unused))) {
 4       int result = 0;
 5 -     /*
 6       result += run_bpt_tests();
 7       result += run_set_tests();
 8       result += run_cow_tests();
 9       result += run_queue_tests();
10       result += run_tqueue_tests();
11       result += run_lqueue_tests();
12 -     */
13       result += run_siphash_tests();
14       result += run_ht_tests();
15       return result;