[tremor] Tremor's use of 64-bit math

Chris Gilbert chris at dokein.co.uk
Fri Sep 13 02:51:14 PDT 2002



----- Original Message -----
From: "Owen G. Emry" <oemry at patriot.net>
To: <tremor at xiph.org>
Sent: Friday, September 13, 2002 7:33 AM
Subject: Re: [tremor] Tremor's use of 64-bit math

<p>> Monty <xiphmont at xiph.org> said:
>
> >
> >
> >
> > On Fri, Sep 13, 2002 at 02:02:54AM -0000, Owen G. Emry wrote:
> > > Hi, all.
> > >
> > > I'd appreciate it if someone who understands the decoder better than I
> could
> > > briefly explain how Tremor uses 64-bit math.  My problem is this:
> >
> > Before going too much farther, are you only referring to position
> > tracking code (eg granulepos) which uses 64 bit integers, or also the
> > 32x32 -> 32,32 multiplications that occur in a number of places, such
> > as the mdct?
>
> I'm referring to everything that requires me to link against libgcc.a.
I'm
> targeting ARM, and defining _ARM_ASSEM_ which I _think_ is what does the
> 32x32 -> 32,32 multiplications, right?  However, gcc's still generating
> references to these:
>
> __divdi3 (in ov_bitrate, ov_bitrate_instant, ov_time_total, etc.)
> __divsi3 (in _book_maptype1_quantvals, _book_unquantize,
> vorbis_book_decodevs_add, floor0_look, etc.)
> __modsi3 (in _book_unquantize)

Those are the divide and modular operations (I can't remember the diff
between divdi3 and divsi3):
x/y
x%y

ARM doesn't have a built-in divide/modular asm instruction, so gcc has to
provide them.

Note that if the compiler normally attempts to do shifts if it can, eg:
x/16
becomes:
x>>4

But the code in question appears to need to do those calls

Note I'd not worry, profiling shows that most time is spent in other places:
Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 29.39     22.09    22.09    30960   713.50   714.15  mdct_backward
 19.80     36.97    14.88    30928   481.12   481.12  vorbis_lsp_to_curve
  9.99     44.48     7.51   611549    12.28    19.28
vorbis_book_decodevs_add
  8.79     51.09     6.61    30928   213.72   213.72  _vorbis_apply_window
  8.61     57.56     6.47    15480   417.96   417.96
vorbis_synthesis_blockin
  5.99     62.06     4.50                             write
  3.34     64.57     2.51 11075976     0.23     0.23  oggpack_look
  2.73     66.62     2.05    15480   132.43  4362.20  ov_read
  1.86     68.02     1.40                             _memcpy
  1.80     69.37     1.35  7928961     0.17     0.17  oggpack_adv
  1.25     70.31     0.94                             memset
  1.09     71.13     0.82    15464    53.03   852.83  _01inverse
  1.05     71.92     0.79  3091974     0.26     0.26  bitreverse
  0.67     72.42     0.50   286103     1.75     2.21
vorbis_book_decodev_set
  0.45     72.76     0.34   357658     0.95     1.61  vorbis_book_decode
  0.45     73.10     0.34    15480    21.96  3755.39  mapping0_inverse
  0.43     73.42     0.32                             read
  0.39     73.71     0.29     1300   223.08   223.08  ogg_page_checksum_set
  0.24     74.10     0.18                             __divsi3

(I don't seem to have calls to modsi or divdi3, however I do need to tweak
my profiling tool a bit, I think I'm linking libgcc instead of libgcc_p..

Chris

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list