[asm] MOVQ and XMM registers

892 views
Skip to first unread message

ziutek

unread,
Nov 1, 2011, 1:54:32 PM11/1/11
to golang-nuts
I obtain such error from 6l:

blas.Idamax: doasm: notfound from=35 to=37 (22) MOVQ X1,X3
blas.Idamax: doasm: notfound from=34 to=3a (120) MOVQ X0,X6
blas.Idamax: doasm: notfound from=35 to=37 (22) MOVQ X1,X3
blas.Idamax: doasm: notfound from=34 to=3a (120) MOVQ X0,X6

Is there other instruction mnemonic for move quadword (64-bit integer)
between SSE registers?

There is link to MOVQ doc: http://siyobik.info/main/reference/instruction/MOVQ

Evan Shaw

unread,
Nov 1, 2011, 3:44:42 PM11/1/11
to ziutek, golang-nuts

I'm confused. XMM registers hold double quadwords (128-bit values);
not quadwords.

If you want to move into an XMM register from a 64-bit register, use MOVQ.

If you want to move into an XMM register from memory or another XMM
register, use MOVO (unless memory is unaligned, in which case you use
MOVOU).

- Evan

ziutek

unread,
Nov 1, 2011, 4:36:17 PM11/1/11
to golang-nuts
On 1 Lis, 20:44, Evan Shaw <eds...@gmail.com> wrote:
> I'm confused. XMM registers hold double quadwords (128-bit values);
> not quadwords.
>
> If you want to move into an XMM register from a 64-bit register, use MOVQ.
>
> If you want to move into an XMM register from memory or another XMM
> register, use MOVO (unless memory is unaligned, in which case you use
> MOVOU).
>
> - Evan

According to documentation MOVQ works like MOVSD if you copy from one
XMM register to another. But MOVSD should be used only in floating
point context. See documentation:

MOVQ

Copies a quadword from the source operand (second operand) to the
destination operand (first operand). The source and destination
operands can be MMX technology registers, XMM registers, or 64-bit
memory locations. This instruction can be used to move a quadword
between two MMX technology registers or between an MMX technology
register and a 64-bit memory location, or to move data between two XMM
registers or between an XMM register and a 64-bit memory location. The
instruction cannot be used to transfer data between memory locations.

When the source operand is an XMM register, the low quadword is moved;
when the destination operand is an XMM register, the quadword is
stored to the low quadword of the register, and the high quadword is
cleared to all 0s.

Evan Shaw

unread,
Nov 1, 2011, 8:11:29 PM11/1/11
to ziutek, golang-nuts
On Wed, Nov 2, 2011 at 9:36 AM, ziutek <ziu...@lnet.pl> wrote:
> According to documentation MOVQ works like MOVSD if you copy from one
> XMM register to another.

I see. This may be a bug in the assembler.

- Evan

ziutek

unread,
Nov 2, 2011, 7:35:16 PM11/2/11
to golang-nuts
Reply all
Reply to author
Forward
0 new messages