multiple function return values in LLVM

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

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 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@gmail.com>