Open GoogleCodeExporter opened 9 years ago
Issue 4 has been merged into this issue.
Original comment by classi...@floodgap.com
on 7 Feb 2011 at 1:04
Investigate and try to implement for 9.3.1. Drop milestone if not useful.
Original comment by classi...@floodgap.com
on 6 Apr 2011 at 1:35
Original comment by classi...@floodgap.com
on 18 Jan 2012 at 12:36
We need a call in the library somewhere to get and cache whether AltiVec is
enabled. It should cache it because we don't need to keep calling Gestalt()
when we already know. The below code will do this at runtime.
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 }
Logically we should put this into nsprpub/pr/src/md/mac/maccpu.c with a getter
function to see if the result has been memoized, and if not, get and cache it.
We will also need a maccpu.h for those files that want it in the same folder.
Original comment by classi...@floodgap.com
on 18 Jan 2012 at 1:02
Dropping, we have 9.3.1 too delayed
Original comment by classi...@floodgap.com
on 25 Jun 2012 at 3:40
Original issue reported on code.google.com by
classi...@floodgap.com
on 26 Jan 2011 at 5:54