Skip to content

Commit

Permalink
Inline asm bug? GCC bug? The world may never know
Browse files Browse the repository at this point in the history
  • Loading branch information
randombit committed Apr 10, 2024
1 parent fcba650 commit b95c51f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/math/mp/mp_asmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ template <WordType W>
inline constexpr auto word8_add3(W z[8], const W x[8], const W y[8], W carry) -> W {
#if defined(BOTAN_MP_USE_X86_64_ASM)
if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
asm(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "adcq"))
asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "adcq"))
: [carry] "=r"(carry)
: [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
: "cc", "memory");
Expand Down Expand Up @@ -317,7 +317,7 @@ template <WordType W>
inline constexpr auto word8_sub3(W z[8], const W x[8], const W y[8], W carry) -> W {
#if defined(BOTAN_MP_USE_X86_64_ASM)
if(std::same_as<W, uint64_t> && !std::is_constant_evaluated()) {
asm(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "sbbq"))
asm volatile(ADD_OR_SUBTRACT(DO_8_TIMES(ADDSUB3_OP, "sbbq"))
: [carry] "=r"(carry)
: [x] "r"(x), [y] "r"(y), [z] "r"(z), "0"(carry)
: "cc", "memory");
Expand Down

0 comments on commit b95c51f

Please sign in to comment.