The University of Queensland Homepage
School of ITEE ITEE Main Website

 Running and Making VPO/VPCC
Note: these notes may well be out of date by now. Reader beware.

VPO is the University of Virginia Very Portable Optimiser; VPCC is a simple c compiler to go with it. (Actually, the standard system preprocessor, assembler and linkers are used). VPO is part of the Zephyr project.

To use the sparc targeted VPO,

cd ~/4g2/tools/vpo
. prepare
cd testbed
You can copy files to this area (you must be op binstaff to write there) And use vpcc pretty much as cc, except things like -O are ignored. You can type vpcc by itself to display a long list of options and file formats.
Some simple examples:
vpcc -o hello hello.c
vpcc -r hello.c
The latter produces a human readable RTL (Register Transfer List) file.

Using VPO directly

You can also use VPO directly, if you can generate a .cex file. The UVa Code Generation Interfaces are designed for this purpose. In the testbed, you can use a few batch files that I have set up. Examples:
vpo hello
takes a file hello.cex, optimises it, and spits out assembler source to stdout. vportl does the same thing, but outputs the result as optimised RTLs to stdout (so it will look similar to a .dec file).
vpoas hello
will optimise hello.cex, write to hello.s, then assemble and link the result with standard C libraries. (If you need extra libraries, you could make a copy of vpoas and add the appropriate switches to the call to the linker (ld)).

Making VPO

Making VPO has changed with the April 1999 version. As of this writing, you need to edit and run the three shell scripts Clean.sh, Build.sh, and Install.sh. As before, I found it necessary to make some links to various files (vpcchelp, cde.sparc, and vpo.sparc) to the $CHOME directory.

Here is the info for the older version:
This is simply a matter of copying the right makefile (Makefile.sparc or Makefile.i386) to Makefile, then

cd ~/4g/tools/vpo
. prepare
make
since I have already edited the Makefiles. Do not use make -f Makefile.sparc, as the make file assumes Makefile to make the tools. Although not documented (that I could find), I had to make links in $CHOME for several files. I also had to change driver/mach.h to change the hard wired "SUNWspro/SC3.0" directories to "SC3.0.1".

Note that there are now two Makefiles: Makefile.sparc and Makefile.i386. The latter is to make the i386 targeted but sparc hosted version of vpo. Copy the appropriate file to Makefile before running make.

Unfortunatly, the "i386 hosted on sparc" version of vpo just seems to die. I think it will be a whole lot easier to host it on Solaris/386. However, the front end seems to work, so you can create .dec and .cex files, but not .rtl, .s, or executable files.

To try the 386 targeted version:

cd ~/4g/tools/vpo
. prep386
cd test386
Everything should be much the same as for the sparc targeted version.

VPO version

The April 1999 version of VPO seems to work fine with the Code Generation Interface of June 1998.

Information for previous version:

The present VPO (as of September 1998) does not seem to have a version number that you can readily access. However, its source files are dated no later than April 1998. This version requires calls to have the size of the stack frame and number of parameters as part of the call RTL, e.g.

+ST=printf,72,1  ICFC
whereas the Code Generation Interface (of June 1998) uses a different format, which our present VPO does not understand:
a72
+ST=printf   ICFC
Pr[8]
This can be worked around till we get the new version by editing the .cex file (use an editor that preserves all 8 bits, e.g. vi, pico).