简体   繁体   中英

“Inconsistent Operand Constraints” with Inline ASM using GCC

Getting this error when trying to compile this source file using GCC: https://github.com/wolf9466/cpuminer-multi/blob/master/cryptonight_aesni.c

"cryptonight_aesni.c:162:4: error: inconsistent operand constraints"

Specifically:

      uint64_t hi, lo;
 // hi,lo = 64bit x 64bit multiply of c[0] and b[0]

  __asm__("mulq %3\n\t"
      : "=d" (hi),
        "=a" (lo)
      : "%a" (c[0]),
        "rm" (b[0])
      : "cc" );

Very difficult to find out what this error even means, yet alone how to fix it

The instruction mulq in this code is an x86 64-bit instruction. All the parameters are 64-bit values and can't fit in 32-bit registers (when compiling for a 32-bit x86 platform) – Michael Petch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM