문제

I'm getting a compile error of Error: operand type mismatch for 'movaps', and googling hasn't revealed a solution. movups and addps also give the same error.

Here's a relevant excerpt:

# load address into %eax
movaps %eax, %mm0

For completeness, I'm compiling the .s file with -m32.

도움이 되었습니까?

해결책

You are missing a level of indirection on the first argument, and the second argument needs to be an XMM register (i.e. 128 bit SSE), not an MM register (old 64 bit MMX):

movaps (%eax), %xmm0

If you can use intrinsics in C or C++ rather than writing raw asm then you can do this kind of thing a lot more easily, e.g.

__m128 v = _mm_load_ps(ptr);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top