On Fri, Jul 12, 2002 at 02:01:53PM -0600, Keith Whitwell wrote: > Felix Kühling wrote: > >I got also a bit worried about using string instructions without > >clearing the direction flag. Is there any convention that prevents an > >application from setting the direction flag. If not, it might happen > >that esi and edi are decremented. > > > >On Fri, 12 Jul 2002 11:51:13 +0100 > >José Fonseca <[EMAIL PROTECTED]> wrote: [...] > >> > >>I though that the %ecx decrement was already handled by the 'movsl' > >>instruction and that the 'rep' prefix just added the conditional jump... > > I missed the start of this... > > Is this something that should be fixed in the other drivers as well? >
The bug that Felix found first is specific of Mach64, on a x86 specific macro equivalent to the COPY_DWORDS existing in the other drivers, in the _tris.c file. But his later statement about clearing the direction flag regards every card that uses the 'rep; movsl' assembly instructions, such as in the COPY_DWORDS macro. This seems to be a tricky issue though which has been discussed in the linux kernel sometimes already: http://marc.theaimsgroup.com/?l=linux-kernel&m=94388449615903&w=2 http://marc.theaimsgroup.com/?l=linux-kernel&m=94371268003189&w=2 http://marc.theaimsgroup.com/?l=linux-kernel&m=88995996331639&w=2 http://marc.theaimsgroup.com/?l=linux-kernel&m=88981148900284&w=2 My understanding of above is that althought issuing 'cld' is somewhat costy, we _can't_ assume that the direction flag is clear, so we need to issue it at least once in each subroutine where the COPY_DWORDS macro is used, and after calling any foreign code on that subroutines. José Fonseca ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Gadgets, caffeine, t-shirts, fun stuff. http://thinkgeek.com/sf _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel