Reputation: 21
I got an error in runtime "EXC_BAD_INSTRUCTION(code=EXC_i386_INVOP)" after executed next line of code:
var1 = _mm_shuffle_epi32(x1,0xFF);
On my MacBook Pro mid 2015 code works fine. On Mac mini late 2012 an error occurs.
Both machines have:
osx 10.13.1
xcode 9.1
gcc --version:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/c++/4.2.1 Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin17.2.0 Thread model: posix
What I'm doing wrong?
You can try to build it
Upvotes: 0
Views: 225
Reputation: 3236
I see that var1 = _mm_shuffle_epi32(x1,0xFF)
runs right after __m128i xout1 = _mm_aeskeygenassist_si128(*xout2, rcon)
--this is an AES-NI instruction.
If your Mac doesn't support AES-NI, it would trigger the exact crash you're getting (EXC_BAD_INSTRUCTION). The late 2012 Mac mini should have an i5-3210M (Ivy Bridge) which supports AES-NI. Are you sure your Mac mini is late 2012?
Upvotes: 0