Commit Graph
9 Commits
Author SHA1 Message Date
Steve Checkoway de4a22d9e0 Reuse variables. (I'm hope gcc was smart enough to reuse the registers on its own, but I didn't actually check. This way we should be using fewer than 32.) 2006-06-18 18:41:22 +00:00
Steve Checkoway 66dfad63b0 Be careful not to read past the end of the data. With aligned loads (which are every load in altivec), it is always okay to load a vector if you can access any element of that vector. It is not always okay to load the next vector. 2006-06-18 18:30:28 +00:00
Steve Checkoway acf04db9f9 Implement with SSE but don't enable since I can't test it. It should be portable since I used Intel's intrinsics. 2006-06-18 18:10:14 +00:00
Steve Checkoway af5f6f4edb Cleanup. 2006-06-13 12:41:40 +00:00
Steve Checkoway b7c1412a70 Re-enable vector code. FastSoundWrite can now handle a dest that is not 16 byte aligned although it will be fastest if dest is 16 byte aligned and size is a multiple of 8. 2006-06-13 12:30:51 +00:00
Steve Checkoway 2754fd0f18 Perform the same loop unrolling for Read. This eliminate all stalls in the loop for all processors with altivec (well, at least both G4s (IBM 7400 and 7450) and the G5 (IBM 970) processors. I didn't bother for the other read function since it isn't actually used and is included more for completeness than anything else (plus, these were a lot of fun to write). 2006-05-17 09:59:34 +00:00
Steve Checkoway 177e65a34c Do gcc's job for it and do sane loop unrolling. The (now second) while loop was stalling the pipeline almost as often as it was doing useful work. When gcc tried to do loop unrolling (i.e. when I changed the condition to size >= 8), it produced 4 _identical_ copies of the loop, each of which had the same number of stalls (this is all with the G5, the G4 had one stall in the loop). By unrolling and doing the most basic of instruction scheduling, this produces the same amount of code as gcc does but with 1 stall in the big loop (0 for the G4) but the same number in the second loop which is executed at most 3 times.
To keep gcc from unrolling the second loop, I'm using the bit masking condition which confuses the optimizer.

Note that this behavior won't change unless we stop targeting any OS below 10.3.9 and move to a more recent version of gcc (whose behavior I haven't bothered to test).
2006-05-17 09:27:54 +00:00
Steve Checkoway b912d61546 Following Wolfman's example, some comments so that maybe next time I look at this I won't see vec_ctf and think "capture the flag?" 2006-05-14 08:13:16 +00:00
Steve Checkoway f39e79efed The last of the changes, I hope. 2006-05-14 07:04:28 +00:00