pack.py revision cb691a81003e81d9d84899e8d94d2e25991a12c1
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
print """
/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY pack.py SCRIPT */
#include <stdio.h>
#include "cr_string.h"
#include "cr_spu.h"
#include "packspu.h"
#include "cr_packfunctions.h"
#include "packspu_proto.h"
"""
print """
static void __fillin( int offset, char *name, SPUGenericFunction func )
{
_cr_pack_table[offset].name = crStrdup( name );
_cr_pack_table[offset].fn = func;
}"""
pack_specials = []
print '\nvoid packspuCreateFunctions( void )'
print '{'
continue
if func_name in pack_specials:
else:
print '\t__fillin( %3d, "%s", (SPUGenericFunction) (pack_spu.swap ? crPack%sSWAP : crPack%s) );' % (index, func_name, func_name, func_name )
print '\t__fillin( %3d, NULL, NULL );' % num_funcs
print '}'