GMP 6.2.1 core2 x86_64 assembler error "operands invalid for `movq'"

Niels Möller nisse at lysator.liu.se
Wed Nov 2 08:58:05 CET 2022


Torbjörn Granlund <tg at gmplib.org> writes:

> This is not the same bug as we worked around for register-to-register
> copying on x86-32 some years ago.  It is not cleer what syntax this
> assembler might accept, and which also gives the right instruction (here
> and on non-prolematic hosts).

For reference, in nettle x86_64 code, there are a few places where I
write "movd" instead of "movq" for 64-bit moves between general 64-bit
registers and xmm registers, to work around build problems on macos.
E.g.,

umac-nh.s:      movd    %xmm4, %rax
sha3-permute.s: movd    %xmm15, %r9

Seems to work fine everywhere I've tested it, but I've not really
understood why "movd" could ever be used as mnemonic for that operation
(I also use it in other places for 32-bit moves). I guess there are some
historic reasons.

So would be useful to try if replacement movq --> movd

(i) solves the problem on (older) macos, and

(ii) produces identical object code on systems with more up-to-date
assemblers.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-bugs mailing list