ExternalLibraryFunction.st
changeset 20295 87dc882749b0
parent 20290 952d5b62a161
child 20297 85746bbcaf03
equal deleted inserted replaced
20294:dc408807328e 20295:87dc882749b0
  1832 
  1832 
  1833     {
  1833     {
  1834 	VOIDPTRFUNC fi = (VOIDPTRFUNC)codeAddress;
  1834 	VOIDPTRFUNC fi = (VOIDPTRFUNC)codeAddress;
  1835 	DOUBLEFUNC fd = (DOUBLEFUNC)codeAddress;
  1835 	DOUBLEFUNC fd = (DOUBLEFUNC)codeAddress;
  1836 	int rI[MAX_ARGS], dI[MAX_ARGS];
  1836 	int rI[MAX_ARGS], dI[MAX_ARGS];
       
  1837 	int i;
  1837 
  1838 
  1838 	// sort the float/double args into a separate arglist and pass them AFTER the regular args.
  1839 	// sort the float/double args into a separate arglist and pass them AFTER the regular args.
  1839 	// This is possible, because all doubles are passed in floating-pnt registers,
  1840 	// This is possible, because all doubles are passed in floating-pnt registers,
  1840 	// no matter where they are in the arglist.
  1841 	// no matter where they are in the arglist.
  1841 	int argI = 0, nonDoubleI = 0, doubleI = 0;
  1842 	int argI = 0, nonDoubleI = 0, doubleI = 0;
  1849 #  endif // __x86_64__
  1850 #  endif // __x86_64__
  1850 	    {
  1851 	    {
  1851 		rI[nonDoubleI++] = argI;
  1852 		rI[nonDoubleI++] = argI;
  1852 	    }
  1853 	    }
  1853 	}
  1854 	}
  1854 	for (int i=doubleI; i<__numArgsIncludingThis; i++) dI[doubleI++] = 0;
  1855 	for (i=doubleI; i<__numArgsIncludingThis; i++) dI[doubleI++] = 0;
  1855 	for (int i=nonDoubleI; i<__numArgsIncludingThis; i++) rI[nonDoubleI++] = 0;
  1856 	for (i=nonDoubleI; i<__numArgsIncludingThis; i++) rI[nonDoubleI++] = 0;
  1856 
  1857 
  1857 	DEBUGCODE_IF( @global(Verbose), {
  1858 	DEBUGCODE_IF( @global(Verbose), {
  1858 	    printf("call %p with %d args (%d regular, %d double)\n", codeAddress, __numArgsIncludingThis,
  1859 	    printf("call %p with %d args (%d regular, %d double)\n", codeAddress, __numArgsIncludingThis,
  1859 								     nonDoubleI, doubleI);
  1860 								     nonDoubleI, doubleI);
  1860 	})
  1861 	})