Skip to content

Commit ee99f12

Browse files
committed
Merge bitcoin#599: Switch x86_64 asm to use "i" instead of "n" for immediate values.
d58bc93 Switch x86_64 asm to use "i" instead of "n" for immediate values. (Gregory Maxwell) Pull request description: The constraint "n" is a more obscure setting which is needed for special cases that don't apply to our use. Use of "n" exposed some bugs in pre-release versions of clang. This fixes bitcoin#594 Tree-SHA512: 1ffba02aa6bfcd0b6f731196e5d007f4ddb0f03f53b30a2633f0e376578cf7f828570579502f2de721dcda8034fd8e7bea822542bf36032d98ef802b4cf27725
2 parents 05362ee + d58bc93 commit ee99f12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scalar_4x64_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l)
376376
/* extract m6 */
377377
"movq %%r8, %q6\n"
378378
: "=g"(m0), "=g"(m1), "=g"(m2), "=g"(m3), "=g"(m4), "=g"(m5), "=g"(m6)
379-
: "S"(l), "n"(SECP256K1_N_C_0), "n"(SECP256K1_N_C_1)
379+
: "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
380380
: "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "cc");
381381

382382
/* Reduce 385 bits into 258. */
@@ -455,7 +455,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l)
455455
/* extract p4 */
456456
"movq %%r9, %q4\n"
457457
: "=&g"(p0), "=&g"(p1), "=&g"(p2), "=g"(p3), "=g"(p4)
458-
: "g"(m0), "g"(m1), "g"(m2), "g"(m3), "g"(m4), "g"(m5), "g"(m6), "n"(SECP256K1_N_C_0), "n"(SECP256K1_N_C_1)
458+
: "g"(m0), "g"(m1), "g"(m2), "g"(m3), "g"(m4), "g"(m5), "g"(m6), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
459459
: "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "cc");
460460

461461
/* Reduce 258 bits into 256. */
@@ -501,7 +501,7 @@ static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l)
501501
/* Extract c */
502502
"movq %%r9, %q0\n"
503503
: "=g"(c)
504-
: "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "n"(SECP256K1_N_C_0), "n"(SECP256K1_N_C_1)
504+
: "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
505505
: "rax", "rdx", "r8", "r9", "r10", "cc", "memory");
506506
#else
507507
uint128_t c;

0 commit comments

Comments
 (0)