<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 13, 2015 at 12:33 PM, Chih-hung Hsieh <span dir="ltr"><<a href="mailto:chh@google.com" target="_blank">chh@google.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>I found that long double complex (with two f128 values) also have calling convention compatibility problem with gcc and can be fixed similarly.</div><div>My current patch does change quite a few places in type legalizing pass and some other optimizations related to f128 or i128 values. A few changes in the softening of floating point types to keep some f128 typed IR and convert some f128 opcode to library function calls.</div><div><br></div><div>Has anyone tried this approach or have other solution?</div></div></blockquote><div><br></div><div>It sounds like you're on the right track for the low-level part of this.</div><div><br></div><div>The responsibility of matching platform ABI calling conventions is sort of split across clang and LLVM. I think the way to get the calling convention right is to change Clang to use x86_fp80 as the LLVM type for parameter and return types, with some extra coercions inserted before calls and in function prologues.</div><div><br></div><div>The mangling will need a separate change as it doesn't look at LLVM IR.</div></div></div></div>