Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined reference to `__multi3' #2391

Open
9il opened this issue Oct 27, 2017 · 1 comment
Open

undefined reference to `__multi3' #2391

9il opened this issue Oct 27, 2017 · 1 comment

Comments

@9il
Copy link

9il commented Oct 27, 2017

LDC and LDC beta (travis),
x86

                    auto r = inlineIR!(`
                    %a = zext i64 %0 to i128
                    %b = zext i64 %1 to i128
                    %m = mul i128 %a, %b
                    %n = lshr i128 %m, 64
                    %h = trunc i128 %n to i64
                    %l = trunc i128 %m to i64
                    %agg1 = insertvalue [2 x i64] undef, i64 %l, 0
                    %agg2 = insertvalue [2 x i64] %agg1, i64 %h, 1
                    ret [2 x i64] %agg2`, ulong[2])(a, b);
@kinke
Copy link
Member

kinke commented Oct 27, 2017

Similar thing as for your issue #2262 - LLVM lowers the 128-bit multiplication to a __multi3() C function call. Google found an implementation in LLVM's compiler-rt libary: https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/multi3.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants