From 4a97e736613eefaac3103642b68a44f5860398f9 Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Fri, 8 Sep 2023 17:26:18 +0100 Subject: [PATCH] Eliminate a redundant not from x86 asm Signed-off-by: Dave Rodgman --- library/constant_time_impl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/constant_time_impl.h b/library/constant_time_impl.h index 4a75c60cd..70e8b9a57 100644 --- a/library/constant_time_impl.h +++ b/library/constant_time_impl.h @@ -359,11 +359,10 @@ static inline mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbe asm volatile ("mov %[x], %[s] \n\t" "xor %[y], %[s] \n\t" "sub %[y], %[x] \n\t" + "and %[s], %[y] \n\t" "not %[s] \n\t" "and %[s], %[x] \n\t" - "not %[s] \n\t" - "and %[y], %[s] \n\t" - "or %[s], %[x] \n\t" + "or %[y], %[x] \n\t" "sar $31, %[x] \n\t" : [s] "=&b" (s),