[XviD-devel] SGI: ERROR 33: Unresolved text symbol "sqrt"

Venkata Tumati xvid-devel@xvid.org
Sat, 25 Jan 2003 10:01:43 -0500


>You have to compile with math-lib,   gcc -lm ... 
The makefile already has that set so when I compile.
LDFLAGS = -lc -lm
/usr/sbin/gcc -Wall -Os -I ../src -c xvid_stat.c
/usr/sbin/gcc -lc -lm -o xvid_stat xvid_stat.o

is there something else I am supposed to do?
-venkata


-----Original Message-----
From: xvid-devel-admin@xvid.org [mailto:xvid-devel-admin@xvid.org] On
Behalf Of xvid-devel-request@xvid.org
Sent: Saturday, January 25, 2003 6:00 AM
To: xvid-devel@xvid.org
Subject: XviD-devel digest, Vol 1 #283 - 8 msgs

Send XviD-devel mailing list submissions to
	xvid-devel@xvid.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://list.xvid.org/mailman/listinfo/xvid-devel
or, via email, send a message with subject or body 'help' to
	xvid-devel-request@xvid.org

You can reach the person managing the list at
	xvid-devel-admin@xvid.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of XviD-devel digest..."


Today's Topics:

   1. Re: Quality optimization (Felix von Leitner)
   2. Re: Quality optimization (suxen_drol)
   3. Makefile.ia64, Makefile.vc (suxen_drol)
   4. SGI: ERROR 33: Unresolved text symbol "sqrt" (Venkata Tumati)
   5. Re: "Generic" plugin mechanism (Christoph Lampert)
   6. Re: Makefile.ia64, Makefile.vc (Stephan Krause)
   7. Re: Re: Quality optimization (Christoph Lampert)
   8. Re: SGI: ERROR 33: Unresolved text symbol "sqrt" (Christoph
Lampert)

--__--__--

Message: 1
Date: Sat, 25 Jan 2003 03:40:47 +0100
From: Felix von Leitner <felix-xvid@fefe.de>
To: xvid-devel@xvid.org
Subject: [XviD-devel] Re: Quality optimization
Reply-To: xvid-devel@xvid.org

Thus spake Radek Czyz (radoslaw@syskin.cjb.net):
> if (x) { // 50% incorrect prediction
>   x = ABS(x) // ~40% incorrect prediction
> ...
> ... and the same for y.

Good to know!

Here is a small piece of code for your consideration:

  static inline int abs(int x) { return x<0?-x:x; }

  static inline int newabs(int x) {
    return (((x>>(sizeof(int)*8-1)) & (x^(-x))) ^ x);
  }

newabs calculates the absolute of a signed integer without branches.

Now, whether this is actually faster depends on the architecture and on
the actually distribution of the numbers.

Here are the timings on my machines (in CPU cycles):

		Athlon XP	Pentium 3	VIA C3
abs(-32769)	24		19		5(20)
newabs(-32769)	3		3		8
abs(32769)	0		1		3
newabs(32769)	3		3		8

The VIA C3 value is misleading, because the VIA documentation says the
jump takes 12 cycles if mispredicted, yet the VIA branch predictor
produces more random results, so the usual outcome is 20, but it was
5 in one of the 10 test runs.

The good thing about this algorithm is that it can be done in parallel
using MMX, so we can theoretically do abs(X) and abs(Y) simultaneously.

> Do you know better tools to do this stuff? CodeAnalyst ignores asm-ed
> code, doesn't allow me to run some functions several times (don't ask
> for details, 300MB needed for a single call of SearchP is a hint here)
> and so on...

Maybe we should talk to the Bochs people.  They already have a CPU
simulator including MMX and SSE, it should be easy for them to output
some data about pipeline stalls and branch prediction data once one
gives them a cycle profile of the different instructions on the given
CPU.

Felix

--__--__--

Message: 2
Date: Sat, 25 Jan 2003 14:59:54 +1100
From: suxen_drol <suxen_drol@hotmail.com>
To: xvid-devel@xvid.org
Subject: Re: [XviD-devel] Quality optimization
Reply-To: xvid-devel@xvid.org


On Sat, 25 Jan 2003 00:38:19 +1030 Radek Czyz <radoslaw@syskin.cjb.net>
wrote:

> Hi again,
> 
> I'm sorry for making all the fuss about CodeAnalyst, but this is the
> first time I'm using such a tool and I have noone else to ask ;)
> I was able to run optimized code with it.
> 
> >> if (x) { // 50% incorrect prediction
> >>   x = ABS(x) // ~40% incorrect prediction
> >> ...
> >> ... and the same for y.
> 
> > Where the heck in the code is this line???
> 
> Well, it looks like this:
> 
>         if (x) {
>                 x = ABS(x);
>                 x += (1 << (iFcode - 1)) - 1;
>                 x >>= (iFcode - 1);
>                 if (x > 32) x = 32;
>                 xb = mvtab[x] + iFcode;
>         } else xb = 1;
> 
> If I'm correctly reading the output of CodeAnalyst (not that easy,
> because the function is inlined) the prediction is perfect with
> optimized code.
> 
> > I never had problem with CodeAnalyst to run complete XviD (was an
older
> > version, but nevertheless...) Maybe you can switch off some options?
> 
> Could you give me an easy solution to have access to nasm files? I
> really don't know how. No asm files are shown in the program, and when
> I do normal profiling most of cpu time is spent in function "unknown"
> which I guess are asm functions....
> I guess Program Database from VS6 doesn't mention asm files.

nasm has no debug info support, and therefore name function do not
appear within code analyst. this is the *only* disadvantage nasm has
over inlined assembly. 

interesting: http://www.tortall.net/projects/yasm/


-- pete; life is like a box of ammo



--__--__--

Message: 3
Date: Sat, 25 Jan 2003 17:59:04 +1100
From: suxen_drol <suxen_drol@hotmail.com>
To: xvid-devel@xvid.org
Subject: [XviD-devel] Makefile.ia64, Makefile.vc
Reply-To: xvid-devel@xvid.org


On Wed, 22 Jan 2003 21:42:59 +1100 suxen_drol <suxen_drol@hotmail.com>
wrote:

> also, the following has been iritating for me some time.
> Makefile.inc includes a gnu make ifeq() conditional used for ia64.
> this breaks non-gnu makes, such as the sgi make or microsoft nmake.
> 
> ive attached a patch, which moves the conditional into Makefile.ia64.
> could someone please confirm it works. it looks okay to me, but i need
> reassurance.

since no one responded, i have applied the patch and added Makefile.vc 
(for building libxvidcore.a using msvc on the cmd line).
ive added xvidcore/INSTALL which describes how to build
libxvidcore.[a,so] using make or visual studio.

i really do believe we need ./configure now (and a few makefiles for
platforms without sh&friends).

-- pete



--__--__--

Message: 4
From: "Venkata Tumati" <vt35@cornell.edu>
To: <xvid-devel@xvid.org>
Date: Sat, 25 Jan 2003 01:12:20 -0500
Subject: [XviD-devel] SGI: ERROR 33: Unresolved text symbol "sqrt"
Reply-To: xvid-devel@xvid.org

Hey,
When I ran the examples I got the following error. Everything else
seemed to work well as far as compiling. I have gcc 3.0.4 and latest
version of gmake. 



> make
/usr/sbin/gcc -Wall -Os -I ../src -c xvid_stat.c
/usr/sbin/gcc -lc -lm -o xvid_stat xvid_stat.o
../build/generic/libxvidcore.a
ld32: WARNING 84: /usr/lib32/libm.so is not used for resolving any
symbol.
ld32: WARNING 127: Two shared objects with the same soname,
/usr/lib32/mips3/libc.so and /usr/lib32/libc.so, have been been linked.
This is probably due to a missing -L specification. Ignoring the latter.
ld32: ERROR 33: Unresolved text symbol "sqrt" -- 1st referenced by
xvid_stat.o.
        Use linker option -v to see when and which objects, archives and
dsos are loaded.  
ld32: ERROR 33: Unresolved text symbol "log10" -- 1st referenced by
xvid_stat.o.
        Use linker option -v to see when and which objects, archives and
dsos are loaded.  
ld32: INFO 152: Output file removed because of error.
collect2: ld returned 2 exit status
make: *** [xvid_stat] Error 1


Venkata


--__--__--

Message: 5
Date: Sat, 25 Jan 2003 11:39:42 +0100 (CET)
From: Christoph Lampert <chl@math.uni-bonn.de>
To: xvid-devel@xvid.org
Subject: Re: [XviD-devel] "Generic" plugin mechanism
Reply-To: xvid-devel@xvid.org

On Sat, 25 Jan 2003, Marco Al wrote:
> I would prefer versioned libcores come to think of it, with the right
one being
> selected by the frontend (VfW or otherwise). This reminds me though of
the
> problem of configuration ... how do you perform platform independent
> configuration? (A problem for the original scheme too.) Part
textfiles, part GUI
> (in the case of VfW) is a bit ugly ... but too much work to avoid I
guess.

Simple: Let every GUI write a textfile and things are compatible again. 

gruel



--__--__--

Message: 6
From: Stephan Krause <s_kraste@ira.uka.de>
To: xvid-devel@xvid.org
Subject: Re: [XviD-devel] Makefile.ia64, Makefile.vc
Date: Sat, 25 Jan 2003 11:40:23 +0100
Reply-To: xvid-devel@xvid.org

suxen_drol wrote:

> since no one responded, i have applied the patch and added Makefile.vc
> (for building libxvidcore.a using msvc on the cmd line).
> ive added xvidcore/INSTALL which describes how to build
> libxvidcore.[a,so] using make or visual studio.

Sorry for not answering (Yes, there is still someone alive who cares
about 
the ia64 stuff, but not with much time...)

The patch seems ok to me, it's much better that way.

Stephan

-- 
Sig fault. (core dumped)

--__--__--

Message: 7
Date: Sat, 25 Jan 2003 11:41:55 +0100 (CET)
From: Christoph Lampert <chl@math.uni-bonn.de>
To: xvid-devel@xvid.org
Subject: Re: [XviD-devel] Re: Quality optimization
Reply-To: xvid-devel@xvid.org

On Sat, 25 Jan 2003, Felix von Leitner wrote:
> Here is a small piece of code for your consideration:
> 
>   static inline int abs(int x) { return x<0?-x:x; }
> 
>   static inline int newabs(int x) {
>     return (((x>>(sizeof(int)*8-1)) & (x^(-x))) ^ x);
>   }
> 
> newabs calculates the absolute of a signed integer without branches.
> 
> ...
> The good thing about this algorithm is that it can be done in parallel
> using MMX, so we can theoretically do abs(X) and abs(Y)
simultaneously.

Since MMX can subtract with saturation, calcuting several abs with MMX
is very 
simple and fast already. 

gruel 



--__--__--

Message: 8
Date: Sat, 25 Jan 2003 11:43:32 +0100 (CET)
From: Christoph Lampert <chl@math.uni-bonn.de>
To: xvid-devel@xvid.org
Subject: Re: [XviD-devel] SGI: ERROR 33: Unresolved text symbol "sqrt"
Reply-To: xvid-devel@xvid.org

On Sat, 25 Jan 2003, Venkata Tumati wrote:

> Hey,
> When I ran the examples I got the following error. Everything else
> seemed to work well as far as compiling. I have gcc 3.0.4 and latest
> version of gmake. 

You have to compile with math-lib,   gcc -lm ... 

gruel



--__--__--

_______________________________________________
XviD-devel mailing list
XviD-devel@xvid.org
http://list.xvid.org/mailman/listinfo/xvid-devel


End of XviD-devel Digest