[tremor] [PATCH] support for non 64bit multiply capable CPUs/compilers
Nicolas Pitre
nico at cam.org
Wed Oct 2 10:47:18 PDT 2002
The attached patch provides 32bit only multiply support to Tremor. It
should be applied to current CVS. MULT30() was also removed since it's not
used anymore.
This should be useful on architectures which can't perform 32x32=64bits
multiplications or if their implementation is too slow. Might be useful if
the compiler doesn't suport them either, but in this case some inline
assembly should be considered as well.
This produce faster code but with an accuracy cost. The audio quality
remains quite good nevertheless and some people might find it more than
acceptable.
To enable this support you must define _NO_64BIT_MUL_.
If this patch is accepted I'll provide another one that will preshift values
in the lookup tables when _NO_64BIT_MUL_ is defined to obtain yet more
execution speed and further reduce text size.
Any comments?
<p>Nicolas
-------------- next part --------------
SW5kZXg6IG1pc2MuaA0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PQ0KUkNTIGZpbGU6IC91c3IvbG9jYWwvY3Zzcm9vdC9U
cmVtb3IvbWlzYy5oLHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS4zDQpkaWZmIC11IC1yMS4zIG1p
c2MuaA0KLS0tIG1pc2MuaAkyMCBTZXAgMjAwMiAwMDoxMDozMSAtMDAwMAkxLjMNCisrKyBtaXNj
LmgJMiBPY3QgMjAwMiAxNjozMTo0MCAtMDAwMA0KQEAgLTMwLDYgKzMwLDkgQEANCiAjaWZuZGVm
IF9WX1dJREVfTUFUSA0KICNkZWZpbmUgX1ZfV0lERV9NQVRIDQogDQorI2lmbmRlZiBfTk9fNjRC
SVRfTVVMXw0KKy8qIDY0IGJpdCBtdWx0aXBseSAqLw0KKw0KICNpbmNsdWRlIDxlbmRpYW4uaD4N
CiANCiAjaWYgQllURV9PUkRFUj09TElUVExFX0VORElBTg0KQEAgLTYyLDE2ICs2NSwzNSBAQA0K
ICAgcmV0dXJuIE1VTFQzMih4LHkpPDwxOw0KIH0NCiANCi1zdGF0aWMgaW5saW5lIG9nZ19pbnQz
Ml90IE1VTF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c2hpZnQpOw0KIA0KLSAgICAgICAgICAgICAgcjAgICAgID0geDFbMV0gIC0geDBbMV07DQot
ICAgICAgICAgICAgICByMSAgICAgPSB4MFswXSAgKyB4MVswXTsNCisgICAgICAgICAgICAgIHIw
ICAgICA9IHgwWzBdICArIHgxWzBdOw0KKyAgICAgICAgICAgICAgcjEgICAgID0geDFbMV0gIC0g
eDBbMV07DQogDQotCSAgICAgIFhQUk9EMzIoIFRbMF0sIFRbMV0sIHIwLCByMSwgJnIyLCAmcjMg
KTsgVCs9c3RlcDsNCisJICAgICAgWFBST0QzMiggcjAsIHIxLCBUWzFdLCBUWzBdLCAmcjIsICZy
MyApOyBUKz1zdGVwOw0KIA0KICAgICAgICAgICAgICAgcjAgICAgID0gKHgwWzFdICsgeDFbMV0p
Pj4xOw0KICAgICAgICAgICAgICAgcjEgICAgID0gKHgwWzBdIC0geDFbMF0pPj4xOw0K
--- >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