Hi, The opcodes in int_opcodes.h apply only to the interpreted version of Poly/ML and the interpreter is only used on platforms where there is no native code-generator.
There's not much, if any, documentation for the internals of the compiler or run-time system. Probably the most useful data structures to look at are in mlsource/MLCompiler/CODETREESIG.ML . The top-level of the compiler builds this intermediate level data structure and the optimiser transforms it. It is then code-generated by the bottom level using either a native code-generator; for the X86 (32 or 64-bit), PPC or Sparc or byte code for the interpreter on any other platform. Many operations, though, are performed by RTS (run-time system) functions and these include such basic operations as integer addition. These are listed in libpoly/sys.h and basis/RunTimeCalls.ML. In the general case these actually require a call into the C++ run-time system but simple operations are implemented in the assembly code section or are recognised by the code-generator and turned into the appropriate machine instructions.
Regards, David
Yue Li wrote:
Hi,
I'm currently studying the run time system of Poly/ML, looking at its source code. I found there are 130 instructions listed in int_opcodes.h, and the semantics is defined in interpreter function. I'm wondering whether there's any documentation available for describing the semantics of each instruction, this will definitely help me understand each instruction better.
Thanks for your help,
Yue _______________________________________________ polyml mailing list polyml@inf.ed.ac.uk http://lists.inf.ed.ac.uk/mailman/listinfo/polyml