Open matu3ba opened 1 year ago
Further necessary input is:
Why do you need any input? The task is to match LLVM compiler_rt and libgcc ABI.
Why do you need any input? The task is to match LLVM compiler_rt and libgcc ABI.
There is no such ABI by gcc and the llvm folks and myself do not think they want to introduce one, see this comment by a gcc folk and the subsequent action by llvm.
To quote:
Why? Why would that be useful at all?
libgcc is an implementation detail. It is not meant to be used by
anything but GCC itself, and then only to implement things that aren't
implemented some other way (by target code typically). The names of the
functions it implements are based on the GCC-internal RTL names, often
identical even. Defining the libgcc names first is not only futile, but
also the wrong order.
LLVM itself seems to be busy trying to manage all configurations for compiler-rt and unless they have finalized that I dont think they will add incompatible symbols, see this rfc. I'll ask on discord what the current status is.
This is a first draft to collect ideas. For posteriority, the decision (discussion) https://github.com/ziglang/zig/pull/15285#discussion_r1167228419. Further necessary input is:
(a<b) -> 0, (a==b) -> 1, (a>b) -> 2
(a<b) -> 0, (a==b) -> 1, (a>b) -> 2
res=a<<b
res=a>>b
arithmetic (sign fill)res=a>>b
loigcal (zero fill)-a
a * b
a / b
a / b
a % b
a % b
res1=a/b, res2=a%b
Alg D by Knuthres1=a/b, res2=a%b
Alg D by Knuthabs(a)
-a
a + b
a - b
a * b
a + b
a - b
a * b
Notes:
ei
forextended integer
and use sum of number of arguments and return argument, if not void.