Roland Scheidegger wrote: > Rune Petersen wrote: >> This patch: - Fixes COS. - Does range reductions for SIN & COS. - >> Adds SCS. - removes the optimized version of SIN & COS. - tweaked >> weight (should help on precision). - fixed a copy paste typo in >> emit_arith(). >> >> Roland would you mind testing if the tweaked weight helped? > Well I didn't test it first time (just quoting the numbers from the link > you provided), but I guess that's fine too. I was actually wondering > myself if it's better to optimize for absolute or relative error, so > choosing a weight in-between should work too (the difference is not that > big after all). > > A couple comments though: > Since ((x + PI/2)/(2*PI))+0.5 is (x/(2*PI) + (1/4 + 0.5) > you could optimize away the first mad for the COS case.
I knew you were going to catch that. I ran out of scalers in the 2 consts I use. Decided to trade one instruction for one const. If you think its better to sacrifice a const, I wont mind changing it. > > Also, the comments for SCS seem a bit off. That's a pity, because > without comments I can't really see what the code does at first sight > :-). Looks like quite a few extra instructions though, are you sure not > more could be shared for calculating both sin and cos? sorry about the comment. I see SCS as a work in progress. I felt I was fighting how emit_arith() syncs the vector & scalar instructions. I intend to improve amit_arith() before taking a shot at improving SCS any further. I was thinking of storing when each scalar in a temp was written to and use it to pack th instruction tighter. > Otherwise, looks good to me. Keep up the good work! Thank you for you comments. Rune Petersen ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel