来自林政宗的邮件

Hi, there.

I am writing an new backend. I defined an intrinsic which has two output. How could I design the built-in function prototype? How could the built-in function pass two output out?

Thanks!

Best regards,
Jerry

I take it you mean in Clang? I think the usual solution is to return
one value normally and take a pointer argument to store the other in,
then emit the right code in CGBuiltin.cpp. The unnecessary store
usually gets optimized away pretty easily.

For example overflow intrinsics here:
Integer Overflow Builtins (Using the GNU Compiler Collection (GCC)).

Cheers.

Tim.