[LLVMdev] multiple function return values in LLVM

Yabin Hu yabin.hwu at gmail.com
Mon May 30 22:50:07 PDT 2011


Hi Hamid,

Thanks for the reply. Thanks for the sample codes.
Yes, I just want to know whether there exists some internal value_list
semantical representation just like octave_value_list.

However, I don't think this way is performance efficient in llvm JIT mode.
Another way I think is transforming from 2nd output parameter into C-Style
input parameter of reference type.
The question is which is better?

Yabin

2011/5/31 Hamid 2C <hamid2c at gmail.com>

> Hi Yabin,
>
> Octave uses an octave_value_list object to return multiple values so I
> don't think it has anything to do with the compiler.
>
> A sample function that can be dynamically linked with Octave and
> called from octave interpreter:
>
> #include <octave/oct.h>
> DEFUN_DLD (divmult, args, nargout, "") {
>  octave_value_list retval;
>  // do some computation to compute r0 and r1
>  retval(0) = r0;
>  retval(1) = r1;
>  return retval;
> }
>
> Hamid
> > Hi all,
> >
> > How can I implement a multiple function return values scheme in a
> > performance efficient way, just like what be done in Matlab or Octave?
> >
> >
> > Thanks in advance,
> >
> >
> > Yabin
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110531/e2d92f33/attachment.html>


More information about the llvm-dev mailing list