inlining failed in call to always_inline ‘_mm_mullo_epi32’: target specific option mismatch

A general method to find the instruction switch for gcc File intrin.sh: #!/bin/bash get_instruction () { [ -z “$1″ ] && exit func_name=”$1 ” header_file=`grep –include=\*intrin.h -Rl “$func_name” /usr/lib/gcc | head -n1` [ -z “$header_file” ] && exit >&2 echo “find in: $header_file” target_directive=`grep “#pragma GCC target(\|$func_name” $header_file | grep -B 1 “$func_name” | head … Read more

What is register %eiz?

See Why Does GCC LEA EIZ?: Apparently %eiz is a pseudo-register that just evaluates to zero at all times (like r0 on MIPS). … I eventually found a mailing list post by binutils guru Ian Lance Taylor that reveals the answer. Sometimes GCC inserts NOP instructions into the code stream to ensure proper alignment and … Read more

Assembly bubble sort swap

I think I’d use pointers into the current position into the list, instead of an index that needs to be scaled every time you use it: mov esi, offset list top: mov edi, esi inner: mov eax, [edi] mov edx, [edi+4] cmp eax, edx jle no_swap mov [edi+4], eax mov [edi], edx no_swap: add edi, … Read more

Combine 32- and 64bit DLLs in one program

On 64-bit Windows 64-bit processes can not use 32-bit DLLs and 32-bit processes can’t use 64-bit DLLs. Microsoft has documented this: On 64-bit Windows, a 64-bit process cannot load a 32-bit dynamic-link library (DLL). Additionally, a 32-bit process cannot load a 64-bit DLL. You would need a 32-bit process that communicates with the 32-bit DLL … Read more