Stefan Dösinger writes:
>Unfortunately I need support for the swap suffix in as, so using the system
>binaries is not an option. Is the only thing I can do to find the source of
>the as version, backport the swap suffix and hope for the best?
Another option might be a hack like this:
(define_insn "vswapmov"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "register_operand" "r"))
(unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)]
""
{
#ifdef HAVE_AS_IX86_SWAP
return "movl.s\t{%1, %0|%0, %1}";
#else
if (true_regnum(operand[0]) == DI_REG
&& true_regnum(operand[1]) == DI_REG)
return ASM_BYTE "0x8B, 0xFF";
if (true_regnum(operand[0]) == BP_REG
&& true_regnum(operand[1]) == SP_REG)
return ASM_BYTE "0x8B, 0xEC";
gcc_unreachable();
#endif
}
[(set_attr "length" "2")
(set_attr "length_immediate" "0")
(set_attr "modrm" "0")])
It's not pretty but you won't be dependent on binutils.
Ross Ridge