keeleysam / tenfourfox

Automatically exported from code.google.com/p/tenfourfox
0 stars 0 forks source link

Vectorized libc equivalents? #208

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It appears that obvious candidates for vectorization in Apple libc, at least in 
10.4, don't have a vectorized version.

http://www.opensource.apple.com/source/Libc/Libc-391.2.10/string/FreeBSD/memset.
c
http://www.opensource.apple.com/source/Libc/Libc-391.2.10/ppc/string/

These are pretty damn fast routines, but it seems like maybe they could be 
quicker in some cases, especially if we're copying or zeroing out a lot of data.

Original issue reported on code.google.com by classi...@floodgap.com on 21 Feb 2013 at 6:27

GoogleCodeExporter commented 9 years ago
What we might do is a VEC_memcpy, etc., and use the VEC_ version if we know we 
have a lot of data to move around or modify. memcpy() is pretty common in 
Mozilla.

Original comment by classi...@floodgap.com on 21 Feb 2013 at 6:30

GoogleCodeExporter commented 9 years ago
On G3, VEC_ versions just stub to regular versions (inline). 
gfx/layers/basic/BasicImageLayer.cpp has a lot of activity that looks like it 
might be amenable to this. So does gfx/2d/SourceSurfaceCG.cpp, 
content/svg/content/src/nsSVGFilters.cpp, 
content/events/src/nsDOMNotifyAudioAvailableEvent.cpp, maybe also 
content/media/FileBlockCache.h, content/media/AudioSampleFormat.h .

Original comment by classi...@floodgap.com on 21 Feb 2013 at 6:35

GoogleCodeExporter commented 9 years ago
I'm quite sure that memcpy() is implemented by the target CPU optimized bcopy() 
found on the commpage.
http://fxr.watson.org/fxr/source/osfmk/ppc/commpage/?v=xnu-792

Original comment by Tobias.N...@gmail.com on 21 Feb 2013 at 9:07

GoogleCodeExporter commented 9 years ago
The hint to the commpage can be found here:
http://www.opensource.apple.com/source/Libc/Libc-391.2.10/ppc/string/bcopy.s

Original comment by Tobias.N...@gmail.com on 21 Feb 2013 at 9:09

GoogleCodeExporter commented 9 years ago
See also bcopy in an old version of Libc:
http://opensource.apple.com/source/Libc/Libc-262.2.12/ppc/gen/bcopy.s

Original comment by Tobias.N...@gmail.com on 21 Feb 2013 at 9:17

GoogleCodeExporter commented 9 years ago
I guess that probably was too easy.

Original comment by classi...@floodgap.com on 21 Feb 2013 at 2:12