On Wed, 29 Jan 2003 07:59:30 -0700 Brian Paul <[EMAIL PROTECTED]> wrote:
> >>> Since these functions are globally exported, it might be worth it to > >>> write a quick test that calls the various > >>> _transform_normalize_normals functions to make sure that they all > >>> produces the same (or close enough) results. > >> > >> > >> And: > >> _transform_normalize_normals_no_rot > >> _transform_rescale_normals_no_rot > >> _transform_rescale_normals > >> _transform_normals_no_rot > >> _transform_normals > >> _normalize_normals > >> _rescale_normals > >> > >> These should be tested too, while we're at it. > > > > > > Agreed. > > > > Brian: If such tests do get written, where should they live in the tree? > > There's a number of test routines in the src/math/m_debug_*.c files. I think > that would be the place to add more if needed. It's all there. Even benchmarking is included. It just needs to be recompiled with DEBUG and RUN_DEBUG_BENCHMARK defined. I downloaded Mesa CVS and configured it with --enable-debug and --enable-profile. When I started a GL app with the correct library path I got this: cpu vendor: AuthenticAMD cpu name: AMD Duron(tm) processor MMX cpu detected. 3DNow! cpu detected. ----------------------------- (i = 0, j = 0) 1.177931 -0.033552 [ratio = -2.848425e-02 - 29 bit missed] 0.841573 0.728316 [ratio = 8.654217e-01 - 21 bit missed] 0.735570 -0.684420 [ratio = -9.304624e-01 - 25 bit missed] Mesa implementation error: _mesa_normal_tab[0][NORM_NORMALIZE] failed test (3DNow!) Please report to the Mesa bug database at www.mesa3d.org Mesa: Mesa DEBUG build Jan 29 2003 21:43:51 A patch to fix this is attached. Basically the same kind of problem as before. Now it reports no more problems :) in any of the math functions tested on my Duron. This should be about everything except SSE. Felix __\|/__ ___ ___ ___ __Tschüß_______\_6 6_/___/__ \___/__ \___/___\___You can do anything,___ _____Felix_______\Ä/\ \_____\ \_____\ \______U___just not everything____ [EMAIL PROTECTED] >o<__/ \___/ \___/ at the same time!
Index: 3dnow_normal.S =================================================================== RCS file: /cvsroot/dri/xc/xc/extras/Mesa/src/X86/3dnow_normal.S,v retrieving revision 1.6 diff -u -r1.6 3dnow_normal.S --- 3dnow_normal.S 28 Jan 2003 22:44:07 -0000 1.6 +++ 3dnow_normal.S 29 Jan 2003 21:26:08 -0000 @@ -731,13 +731,13 @@ PREFETCHW ( REGIND(EAX) ) - MOVQ ( MM0, MM3 ) /* x1 | x0 */ - ADD_L ( STRIDE, ECX ) /* next normal */ - PREFETCH ( REGIND(ECX) ) MOVQ ( REGIND(ECX), MM0 ) /* x1 | x0 */ MOVD ( REGOFF(8, ECX), MM1 ) /* | x2 */ + + MOVQ ( MM0, MM3 ) /* x1 | x0 */ + ADD_L ( STRIDE, ECX ) /* next normal */ PFMUL ( MM0, MM3 ) /* x1*x1 | x0*x0 */ MOVQ ( MM1, MM4 ) /* | x2 */