s-barannikov wrote:

> > > > ```
> > > > declare fp128 @fmul(fp128 %a, fp128 %b)
> > > > 
> > > > define fp128 @square(fp128 %num) {
> > > >     %ret = call fp128 @fmul(fp128 %num, fp128 %num)
> > > >     ret fp128 %ret
> > > > }
> > > > ```
> > > 
> > > 
> > > I think the main issue here is that the fp128s need to be passed around 
> > > as if it's a sret struct but I dunno how to declare it in 
> > > (Ret)CC_Sparc32...
> > 
> > 
> > You need to return false for it in `CanLowerReturn`.
> 
> Ah, this one's already sorted out but I end up in an odd situation as I 
> described in [this 
> comment](https://github.com/llvm/llvm-project/pull/162226#issuecomment-3420461662).
>  clang lowers `long double _Complex` as `{f128, f128}`, so if 
> `CanLowerReturn` is true for f128, LLVM will return it in registers 
> (correct!) but then autogenerated LLVM calls to C functions will be wrong 
> (see the `sinl` example above), meanwhile if I set it to false then 
> autogenerated C calls will be correct, but then `long double _Complex` will 
> be returned as sret (which is wrong).

Maybe @arsenm can give some clues

https://github.com/llvm/llvm-project/pull/162226
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to