diff options
author | Niels Möller <nisse@lysator.liu.se> | 2012-07-05 08:24:08 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2012-07-05 08:24:08 +0200 |
commit | f58d1c288f602d93f9e67b535d84c606047db3b9 (patch) | |
tree | 9530c6af56639cc6eaa2bc4aec6debd920fc6fe1 | |
parent | 074151841da242fad9c2d3f43877f50cabbc192b (diff) | |
download | nettle-f58d1c288f602d93f9e67b535d84c606047db3b9.tar.gz |
movd/movq workaround for osx assembler.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | x86_64/salsa20-crypt.asm | 10 |
2 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2012-07-05 Niels Möller <nisse@lysator.liu.se> + + * x86_64/salsa20-crypt.asm (salsa20_crypt): Write the 64-bit movq + instructions as "movd", since that makes the osx assembler + happier. Assembles to the same machine code on gnu/linux. + 2012-07-03 Niels Möller <nisse@lysator.liu.se> * aclocal.m4 (LSH_FUNC_ALLOCA): In the config.h boilerplate, diff --git a/x86_64/salsa20-crypt.asm b/x86_64/salsa20-crypt.asm index 799d5744..b6212247 100644 --- a/x86_64/salsa20-crypt.asm +++ b/x86_64/salsa20-crypt.asm @@ -237,13 +237,19 @@ PROLOGUE(nettle_salsa20_crypt) and $-16, POS test $8, LENGTH jz .Llt8 - movq T0, T64 + C This "movd" instruction should assemble to + C 66 49 0f 7e e0 movq %xmm4,%r8 + C Apparently, assemblers treat movd and movq (with the + C arguments we use) in the same way, except for osx, which + C barfs at movq. + movd T0, T64 xor (SRC, POS), T64 mov T64, (DST, POS) lea 8(POS), POS pshufd $0xee, T0, T0 C 10 11 10 11 .Llt8: - movq T0, T64 + C And this is also really a movq. + movd T0, T64 test $4, LENGTH jz .Llt4 mov XREG(T64), XREG(COUNT) |