Fwd: [ODE] Patch fo use of uninitialised value of size 8 in checkMass(dMass*)

Francisco Jesús Martínez Serrano franjesus at medtelecom.net
Wed Jun 11 10:17:02 2003


Inicio mensaje reenviado:

De: Chris Jefferson
Fecha: Miér 11 jun, 2003  16:49:48 Europe/Madrid
Para: Francisco Jesús Martínez Serrano
Asunto: Re: [ODE] Patch fo use of uninitialised value of size 8 in  
checkMass(dMass*)

Francisco Jesús Martínez Serrano wrote:
> El Martes, 10 jun, 2003, a las 23:41 Europe/Madrid, Martin C. Martin 
> escribió:
> Greetings,
> I'm not an expert in this kind of subjects, but actually I believe 
> there is plenty of things like this in the ODE code, since it uses 
> dReal[4] as dVector3 and dReal[12] as dMatrix3. If you do that kind of 
> things, the possibility of SIMD optimization will be lost.
> Btw, some thing like
> #define dADDVector3(A,B,C) \
>   (A)[0] = (B)[0] +(C)[0] ; \
>   (A)[1] = (B)[1] +(C)[1] ; \
>   (A)[2] = (B)[2] +(C)[2] ;
> #define dADDMatrix3(A,B,C) \
>   dADDVector3((A),(B),(C)) ; \
>   dADDVector3((A+4),(B+4),(C+4)) ; \
>   dADDVector3((A+8),(B+8),(C+8)) ;
> and the corresponding C++ definitions would be nice in order to have 
> the possibility of changing all that operations in a single edit. I 
> know: nasty use of C preprocessor, just an idea.

Perhaps a better patch would be to 0 out the last element of the vector 
whenever we create a new one (once again probably as a #define for when 
we don't want it)?

Chris