Remove not-needed mov in x86_64 asm
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h
index ab32dee..86f7510 100644
--- a/library/constant_time_impl.h
+++ b/library/constant_time_impl.h
@@ -345,8 +345,7 @@
"not %[mask] \n\t"
"and %[mask], %[x] \n\t"
"or %[y], %[x] \n\t"
- "mov %[x], %[mask] \n\t"
- "sar $63, %[mask] \n\t"
+ "sar $63, %[x] \n\t"
:
[mask] "=&a" (mask),
[x] "+&S" (x),
@@ -354,7 +353,7 @@
:
:
);
- return (mbedtls_ct_condition_t) mask;
+ return (mbedtls_ct_condition_t) x;
#elif defined(MBEDTLS_CT_X86_ASM) && defined(MBEDTLS_CT_SIZE_32)
uint32_t s;
asm volatile ("mov %[x], %[s] \n\t"