Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nme-toolkit angle crashes on popcnt (MacPro 1,1 / 2,1 / 3,1) #674

Open
madrazo opened this issue Sep 21, 2020 · 0 comments
Open

nme-toolkit angle crashes on popcnt (MacPro 1,1 / 2,1 / 3,1) #674

madrazo opened this issue Sep 21, 2020 · 0 comments

Comments

@madrazo
Copy link
Contributor

madrazo commented Sep 21, 2020

This issue only occurs if you are using an old Xeon processor X5100, X5300, X5400... which are used on the original MacPro s, servers and PCs that mod them to fit into lga 775. They lack of the POPCNT (SSE 4.2) instruction.

The call is in nme-tools angle call to __popcnt in src/common/mathutil.h

My workaround on current code is just to check if popcnt is available

inline int BitCount(uint32_t bits)
{
    uint32_t cpuInfo[4];
    __cpuid((int*)cpuInfo, 0x00000001);
    return (bool)((cpuInfo[2] >> 23) & 1) ? static_cast<int>(__popcnt(bits)) : BitCountPolyfill(bits);
}

The issue has been fixed in angle https://bugs.chromium.org/p/angleproject/issues/detail?id=4462
However compiling newer angle gives me memory errors on VS2007. Workarounds that I had found is to use the 64 bit compiler instead of the 32_64 cross compiler or updgrade to VS2019. I will have to try this again.

@madrazo madrazo changed the title nme-toolkit angle crashes on __popcnt SSE 2.0 (MacPro 1,1 / 2,1 / 3,1) nme-toolkit angle crashes on popcnt (MacPro 1,1 / 2,1 / 3,1) Sep 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant