Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Temporary memcpy unaligned data - is it recommended?



Hello all.
Then performing opportunistic optimization, its not always possible to rework data structures for proper alignment.
So most of the time I have to deal with unaligned data.
My question is - does anyone have the experience with the following technique:
Allocate memory block (or create in on stack if maximum data size is small enough and known at compile time). Make it 15 bytes larger then maximum data size.
Create an "aligned" pointer to the data (like adding 15 to the address and then clearing less significunt 4 bits).
Copy data into this aligned buffer.
Perform altivec operations.
Copy data back into the structure.


Does anyone tryed it? If yes - what are the conditions then the time wasted for memcpy would be returned with aligned data access?
Thank you in advance.


--
Sincerely,
	Rustam Muginov

_______________________________________________
Do not post admin requests to the list. They will be ignored.
PerfOptimization-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/perfoptimization-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.