How do I tell GCC asm that an input register is clobbered?
问题 I'm trying to do a 64=32x32 multiply via the x86 mul instruction, but I only need the high dword of the result (the edx register). So naturally, I tried listing edx as an output register and eax as a clobbered register. This seems natural to me, but eax is also an input register. When I try to tell GCC that eax is clobbered, it gives an error message. __asm__("mull\t%2" : "=d"(div10) : "%a"(UINT32_C(0x1999999A)), "r"(number) : "cc", "rax"); If I try that, it throws this error message: