[LLVMdev] multiple function return values in LLVM

Hamid 2C hamid2c at gmail.com
Mon May 30 21:13:36 PDT 2011


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
>
>




More information about the llvm-dev mailing list