In case anyone else wants to do something similar, this is how to grok 90% of them.
1. Create a wrapper around the __builtin_*(...)
Code: Select all
v4hi pmulhrw(v4hi a, v4hi b){return __builtin_ia32_pmulhrw(a,b);}
Code: Select all
pmulhrw:
movdq2q %xmm1, %mm0
movdq2q %xmm0, %mm1
pmulhrw %mm0, %mm1
movq2dq %mm1, %xmm0
ret
For this case it is really just:
Code: Select all
pmulhrw %mm0, %mm1
Code: Select all
v4hi __not_builtin_pmulhrw(v4hi a, v4hi b){__asm("pmulhrw %1, %0":"+y"(a):"y"(b));return a;}