]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
adjust hardnested compiler fix to accurate version 301/head
authormarshmellow42 <marshmellowrf@gmail.com>
Fri, 2 Jun 2017 04:17:57 +0000 (00:17 -0400)
committermarshmellow42 <marshmellowrf@gmail.com>
Fri, 2 Jun 2017 04:17:57 +0000 (00:17 -0400)
avx512f is only available in gcc 5.3 and above.

client/cmdhfmfhard.c
client/hardnested/hardnested_bf_core.c
client/hardnested/hardnested_bitarray_core.c

index ee46b79c86e181d262a293b9f50b015bd591cc18..01dcc35d928fc2851add3f4a4bd6a8d966c0768d 100644 (file)
@@ -69,7 +69,7 @@ static float brute_force_per_second;
 
 
 static void get_SIMD_instruction_set(char* instruction_set) {
 
 
 static void get_SIMD_instruction_set(char* instruction_set) {
-       #if (__GNUC__ > 4
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2
        if (__builtin_cpu_supports("avx512f")) strcpy(instruction_set, "AVX512F");
        else if (__builtin_cpu_supports("avx2")) strcpy(instruction_set, "AVX2");
        #else 
        if (__builtin_cpu_supports("avx512f")) strcpy(instruction_set, "AVX512F");
        else if (__builtin_cpu_supports("avx2")) strcpy(instruction_set, "AVX2");
        #else 
index 9334a42319edcb3e929d9303638dbfe667121c6a..e56470bfd547f7a5ce2b42ffee2b773a56d6b567 100644 (file)
@@ -534,7 +534,7 @@ bitslice_test_nonces_t *bitslice_test_nonces_function_p = &bitslice_test_nonces_
 
 // determine the available instruction set at runtime and call the correct function
 const uint64_t crack_states_bitsliced_dispatch(uint32_t cuid, uint8_t *best_first_bytes, statelist_t *p, uint32_t *keys_found, uint64_t *num_keys_tested, uint32_t nonces_to_bruteforce, uint8_t *bf_test_nonce_2nd_byte, noncelist_t *nonces) {
 
 // determine the available instruction set at runtime and call the correct function
 const uint64_t crack_states_bitsliced_dispatch(uint32_t cuid, uint8_t *best_first_bytes, statelist_t *p, uint32_t *keys_found, uint64_t *num_keys_tested, uint32_t nonces_to_bruteforce, uint8_t *bf_test_nonce_2nd_byte, noncelist_t *nonces) {
-       #if (__GNUC__ > 4
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2
        if (__builtin_cpu_supports("avx512f")) crack_states_bitsliced_function_p = &crack_states_bitsliced_AVX512;
        else if (__builtin_cpu_supports("avx2")) crack_states_bitsliced_function_p = &crack_states_bitsliced_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) crack_states_bitsliced_function_p = &crack_states_bitsliced_AVX512;
        else if (__builtin_cpu_supports("avx2")) crack_states_bitsliced_function_p = &crack_states_bitsliced_AVX2;
        #else
@@ -552,7 +552,7 @@ const uint64_t crack_states_bitsliced_dispatch(uint32_t cuid, uint8_t *best_firs
 }
 
 void bitslice_test_nonces_dispatch(uint32_t nonces_to_bruteforce, uint32_t *bf_test_nonce, uint8_t *bf_test_nonce_par) {
 }
 
 void bitslice_test_nonces_dispatch(uint32_t nonces_to_bruteforce, uint32_t *bf_test_nonce, uint8_t *bf_test_nonce_par) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitslice_test_nonces_function_p = &bitslice_test_nonces_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitslice_test_nonces_function_p = &bitslice_test_nonces_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitslice_test_nonces_function_p = &bitslice_test_nonces_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitslice_test_nonces_function_p = &bitslice_test_nonces_AVX2;
        #else
index 23a439045a3835c6412ae233515b9caab8fbe589..c7e7f70fae429bddf3bcc6ea4a1f3ae2ae13ea44 100644 (file)
@@ -304,7 +304,7 @@ count_bitarray_AND4_t *count_bitarray_AND4_function_p = &count_bitarray_AND4_dis
 
 // determine the available instruction set at runtime and call the correct function
 uint32_t *malloc_bitarray_dispatch(uint32_t x) {
 
 // determine the available instruction set at runtime and call the correct function
 uint32_t *malloc_bitarray_dispatch(uint32_t x) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) malloc_bitarray_function_p = &malloc_bitarray_AVX512;
        else if (__builtin_cpu_supports("avx2")) malloc_bitarray_function_p = &malloc_bitarray_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) malloc_bitarray_function_p = &malloc_bitarray_AVX512;
        else if (__builtin_cpu_supports("avx2")) malloc_bitarray_function_p = &malloc_bitarray_AVX2;
        #else
@@ -322,7 +322,7 @@ uint32_t *malloc_bitarray_dispatch(uint32_t x) {
 }
 
 void free_bitarray_dispatch(uint32_t *x) {
 }
 
 void free_bitarray_dispatch(uint32_t *x) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) free_bitarray_function_p = &free_bitarray_AVX512;
        else if (__builtin_cpu_supports("avx2")) free_bitarray_function_p = &free_bitarray_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) free_bitarray_function_p = &free_bitarray_AVX512;
        else if (__builtin_cpu_supports("avx2")) free_bitarray_function_p = &free_bitarray_AVX2;
        #else
@@ -340,7 +340,7 @@ void free_bitarray_dispatch(uint32_t *x) {
 }
 
 uint32_t bitcount_dispatch(uint32_t a) {
 }
 
 uint32_t bitcount_dispatch(uint32_t a) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitcount_function_p = &bitcount_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitcount_function_p = &bitcount_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitcount_function_p = &bitcount_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitcount_function_p = &bitcount_AVX2;
        #else
@@ -358,7 +358,7 @@ uint32_t bitcount_dispatch(uint32_t a) {
 }
 
 uint32_t count_states_dispatch(uint32_t *bitarray) {
 }
 
 uint32_t count_states_dispatch(uint32_t *bitarray) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_states_function_p = &count_states_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_states_function_p = &count_states_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_states_function_p = &count_states_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_states_function_p = &count_states_AVX2;
        #else
@@ -376,7 +376,7 @@ uint32_t count_states_dispatch(uint32_t *bitarray) {
 }
 
 void bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 void bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitarray_AND_function_p = &bitarray_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_AND_function_p = &bitarray_AND_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitarray_AND_function_p = &bitarray_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_AND_function_p = &bitarray_AND_AVX2;
        #else
@@ -394,7 +394,7 @@ void bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 void bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 void bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitarray_low20_AND_function_p = &bitarray_low20_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_low20_AND_function_p = &bitarray_low20_AND_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitarray_low20_AND_function_p = &bitarray_low20_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_low20_AND_function_p = &bitarray_low20_AND_AVX2;
        #else
@@ -412,7 +412,7 @@ void bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND_function_p = &count_bitarray_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND_function_p = &count_bitarray_AND_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND_function_p = &count_bitarray_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND_function_p = &count_bitarray_AND_AVX2;
        #else
@@ -430,7 +430,7 @@ uint32_t count_bitarray_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_bitarray_low20_AND_function_p = &count_bitarray_low20_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_low20_AND_function_p = &count_bitarray_low20_AND_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_bitarray_low20_AND_function_p = &count_bitarray_low20_AND_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_low20_AND_function_p = &count_bitarray_low20_AND_AVX2;
        #else
@@ -448,7 +448,7 @@ uint32_t count_bitarray_low20_AND_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 void bitarray_AND4_dispatch(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D) {
 }
 
 void bitarray_AND4_dispatch(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitarray_AND4_function_p = &bitarray_AND4_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_AND4_function_p = &bitarray_AND4_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitarray_AND4_function_p = &bitarray_AND4_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_AND4_function_p = &bitarray_AND4_AVX2;
        #else
@@ -466,7 +466,7 @@ void bitarray_AND4_dispatch(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D)
 }
 
 void bitarray_OR_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 void bitarray_OR_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) bitarray_OR_function_p = &bitarray_OR_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_OR_function_p = &bitarray_OR_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) bitarray_OR_function_p = &bitarray_OR_AVX512;
        else if (__builtin_cpu_supports("avx2")) bitarray_OR_function_p = &bitarray_OR_AVX2;
        #else
@@ -484,7 +484,7 @@ void bitarray_OR_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_AND2_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_AND2_dispatch(uint32_t *A, uint32_t *B) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND2_function_p = &count_bitarray_AND2_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND2_function_p = &count_bitarray_AND2_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND2_function_p = &count_bitarray_AND2_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND2_function_p = &count_bitarray_AND2_AVX2;
        #else
@@ -502,7 +502,7 @@ uint32_t count_bitarray_AND2_dispatch(uint32_t *A, uint32_t *B) {
 }
 
 uint32_t count_bitarray_AND3_dispatch(uint32_t *A, uint32_t *B, uint32_t *C) {
 }
 
 uint32_t count_bitarray_AND3_dispatch(uint32_t *A, uint32_t *B, uint32_t *C) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND3_function_p = &count_bitarray_AND3_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND3_function_p = &count_bitarray_AND3_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND3_function_p = &count_bitarray_AND3_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND3_function_p = &count_bitarray_AND3_AVX2;
        #else
@@ -520,7 +520,7 @@ uint32_t count_bitarray_AND3_dispatch(uint32_t *A, uint32_t *B, uint32_t *C) {
 }
 
 uint32_t count_bitarray_AND4_dispatch(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D) {
 }
 
 uint32_t count_bitarray_AND4_dispatch(uint32_t *A, uint32_t *B, uint32_t *C, uint32_t *D) {
-       #if (__GNUC__ > 4)
+       #if (__GNUC__ >= 5) && (__GNUC__ > 5 || __GNUC_MINOR__ > 2)
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND4_function_p = &count_bitarray_AND4_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND4_function_p = &count_bitarray_AND4_AVX2;
        #else
        if (__builtin_cpu_supports("avx512f")) count_bitarray_AND4_function_p = &count_bitarray_AND4_AVX512;
        else if (__builtin_cpu_supports("avx2")) count_bitarray_AND4_function_p = &count_bitarray_AND4_AVX2;
        #else
Impressum, Datenschutz