Max 5 API Reference
00001 /* 00002 jit.altivec.c 00003 00004 Copyright 2001-2005 - Cycling '74 00005 Joshua Kit Clayton jkc@cycling74.com 00006 00007 */ 00008 00009 #define __JIT_ALTIVEC_H__ //don't use externs... 00010 #include "jit.common.h" 00011 00012 /* 00013 enum { 00014 gestaltPowerPCProcessorFeatures = 'ppcf', 00015 gestaltPowerPCHasGraphicsInstructions = 0, 00016 gestaltPowerPCHasSTFIWXInstruction = 1, 00017 gestaltPowerPCHasSquareRootInstructions = 2, 00018 gestaltPowerPCHasDCBAInstruction = 3, 00019 gestaltPowerPCHasVectorInstructions = 4, 00020 gestaltPowerPCHasDataStreams = 5 00021 }; 00022 */ 00023 00024 long _jit_altivec=0; 00025 00026 long jit_altivec_capable(void) 00027 { 00028 #if JIT_CAN_ALTIVEC 00029 long processorAttributes; 00030 Boolean result = false; 00031 OSErr err = Gestalt( 'ppcf' /* gestaltPowerPCProcessorFeatures */ , &processorAttributes); 00032 if( err == noErr ) 00033 result = (1 << 4 /* gestaltPowerPCHasVectorInstructions */) &processorAttributes; 00034 return result; 00035 #else 00036 return 0; 00037 #endif //WIN_VERSION 00038 } 00039 00040 void jit_altivec_init(void) 00041 { 00042 _jit_altivec = jit_altivec_capable(); 00043 } 00044
Copyright © 2008, Cycling '74