qhasm for the SPUs of the Cell Broadband Engine

For various projects we extended the qhasm programming language to support the Synergistic Processor Units (SPUs) of the Cell Broadband Engine. To use this support first install qhasm and then put the following three files into the qhasm installation directory: CELL-SPU, qhasm-aisplit, and qhasm-cell-spu.

qhasm documentation

The qhasm programming language, although still in protoype status, is a powerful tool to help writing high-speed software. It is so far mostly documented by examples, so I wrote a Python script that generates an html-"documentation" for qhasm automatically from the qhasm machines description files. The documentation lists all currently supported instructions (qhasm version 20070207).

qhasm examples

For a very easy example of a qhasm program for the x86 architecture download add_x86.q and test_x86.c. The add function performs addition of two integer vectors, the code should be self-explanatory.
To build the program use

qhasm-x86 < add_x86.q > add_x86.s
gcc -o test add_x86.s test_x86.c

maq - a preprocessor for qhasm

Please find information about my qhasm preprocessor on a separate page on maq.

Magma syntax highlighting for vim

In order to make syntax highlighting for magma work in vim download magma.vim, copy the file to ~/.vim/syntax/ and activate it in vim by entering

:set syntax=magma

If you want to automatically load the magma syntax highlighting for .mag files create the ~/.vim/filetype.vim with the following content:
" my filetype file
if exists("did_load_filetypes")

augroup filetypedetect
au! BufRead,BufNewFile *.mag  setfiletype magma
augroup END