Whitespace - tidy up asm and make it more consistent

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
This commit is contained in:
Dave Rodgman 2023-05-12 16:29:48 +01:00
parent 81673bba77
commit 0cf9dd1056

View file

@ -156,7 +156,7 @@ static inline mbedtls_ct_condition_t mbedtls_ct_bool(mbedtls_ct_uint_t x)
mbedtls_ct_uint_t s; mbedtls_ct_uint_t s;
asm volatile ("neg %x[s], %x[x] \n\t" asm volatile ("neg %x[s], %x[x] \n\t"
"orr %x[x], %x[s], %x[x] \n\t" "orr %x[x], %x[s], %x[x] \n\t"
"asr %x[x], %x[x], 63" "asr %x[x], %x[x], 63 \n\t"
: :
[s] "=&r" (s), [s] "=&r" (s),
[x] "+&r" (x) [x] "+&r" (x)
@ -303,8 +303,11 @@ static inline mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbe
"and %x[s1], %x[s1], %x[y] \n\t" "and %x[s1], %x[s1], %x[y] \n\t"
"orr %x[s1], %x[x], %x[s1] \n\t" "orr %x[s1], %x[x], %x[s1] \n\t"
"asr %x[x], %x[s1], 63" "asr %x[x], %x[s1], 63"
: [s1] "=&r" (s1), [x] "+&r" (x) :
: [y] "r" (y) [s1] "=&r" (s1),
[x] "+&r" (x)
:
[y] "r" (y)
: :
); );
return (mbedtls_ct_condition_t) x; return (mbedtls_ct_condition_t) x;
@ -324,7 +327,10 @@ static inline mbedtls_ct_condition_t mbedtls_ct_uint_lt(mbedtls_ct_uint_t x, mbe
"orrs %[x], %[x], %[y] \n\t" "orrs %[x], %[x], %[y] \n\t"
"asrs %[x], %[x], #31 \n\t" "asrs %[x], %[x], #31 \n\t"
RESTORE_ASM_SYNTAX RESTORE_ASM_SYNTAX
: [s1] "=&l" (s1), [x] "+&l" (x), [y] "+&l" (y) :
[s1] "=&l" (s1),
[x] "+&l" (x),
[y] "+&l" (y)
: :
: :
"cc" "cc"