Using Altivec for TCP checksum calculations
Using Altivec for TCP checksum calculations
- Subject: Using Altivec for TCP checksum calculations
- From: Brian Tabone <email@hidden>
- Date: Fri, 26 Mar 2004 12:09:32 -0600
I was reading up on the PowerPC 7455, and happened upon an interesting document (
http://e-www.motorola.com/files/if/cnb/ALTIVECTCPIPWP.pdf) on Motorola's website. This document covered the advantages of doing TCP checksum calculations in the Altivec SIMD unit versus doing it in the scalar integer units.
Digging around in the xnu source, I found the checksum assembly code for Darwin (in bsd/dev/ppc/xsumas.s) and found that it was doing the checksum calculations in the integer units. My question is , beyond having to support the G3, is there any reason why the Darwin kernel does the checksum calculations in scalar code versus doing it in vector code? Is there reason to avoid Altivec instructions in the kernel?
I'm assuming that there should be some way to test for altivec and use the scalar code when the altivec is not available so that the kernel remains compatible with the G3.
If Motorola's numbers are to be believed, it would seem that this tweak would open up a potential bottleneck in the TCP stack, leaving more CPU time to do stuff like serve web pages and query databases. This would be a fine tweak for a web server or some other network busy server type.
-Brian
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.