Stream: project-inline-asm

Topic: Type mismatch in tied operands


Amanieu (Feb 27 2020 at 16:17, on Zulip):

It seems that LLVM's register allocator can't handle tied operands where the input and output types differ.

Amanieu (Feb 27 2020 at 16:18, on Zulip):

Clang hides this a bit by adding zero-extensions when both types are integers or pointers.

Amanieu (Feb 27 2020 at 16:18, on Zulip):

But for all other type combinations, it produces an error.

Amanieu (Feb 27 2020 at 16:20, on Zulip):

This is purely an LLVM limitation, GCC handles different types just fine.

Amanieu (Feb 27 2020 at 16:20, on Zulip):

And so would our theoretical external assembler fallback.

Amanieu (Feb 27 2020 at 16:21, on Zulip):

The question is: do we want to provide the same implicit conversion for integers that Clang does?

Amanieu (Feb 27 2020 at 16:23, on Zulip):

I'm tending towards no, since unlike Clang we don't have to emulate GCC's behavior. We can just force users to provide the casts where needed.

Josh Triplett (Feb 28 2020 at 00:35, on Zulip):

Yeah, that seems acceptable. It would be confusing even if it worked.

Last update: Jul 02 2020 at 19:55UTC