Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 788184 | Differences between
and this patch

Collapse All | Expand All

(-)a/numpy/distutils/checks/cpu_popcnt.c (-13 / +9 lines)
Lines 4-23 Link Here
4
    #include <popcntintrin.h>
4
    #include <popcntintrin.h>
5
#endif
5
#endif
6
6
7
int main(void)
7
int main(int argc, char **argv)
8
{
8
{
9
    long long a = 0;
9
    // To make sure popcnt instructions are generated
10
    int b;
10
    // and been tested against the assembler
11
#ifdef _MSC_VER
11
    unsigned long long a = *((unsigned long long*)argv[argc-1]);
12
    #ifdef _M_X64
12
    unsigned int b = *((unsigned int*)argv[argc-2]);
13
    a = _mm_popcnt_u64(1);
13
14
    #endif
14
#if defined(_M_X64) || defined(__x86_64__)    
15
    b = _mm_popcnt_u32(1);
15
    a = _mm_popcnt_u64(a);
16
#else
17
    #ifdef __x86_64__
18
    a = __builtin_popcountll(1);
19
    #endif
20
    b = __builtin_popcount(1);
21
#endif
16
#endif
17
    b = _mm_popcnt_u32(b);
22
    return (int)a + b;
18
    return (int)a + b;
23
}
19
}

Return to bug 788184