This page shows a quick example of using AltiVec. The example shown simply checks that AltiVec is available, shows how to load a register, and how saturated addition works.

This is the example that comes with Fantasm 5.30beta1 and is basically just a screen grab from Anvil. Build it and run it. Assuming the AltiVec emulator is installed correctly, the program will stop in MacsBug with the message "Stopped after checking AltiVec is present."

If you do not get this message, then AltiVec is not installed.

You can then step through the program examining the simple vector operations performed. Use "TV" in MacsBug to display the vector registers.

Back