Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sheeva_

Logarithm lookup tables

This topic is 5542 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m currently implementing a fixedpoint library for use in a 3D engine and I need a _really_ fast routine for computing logarithms. I think I can use lookup tables for that. Can anybody throw in an idea how to do it? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Some handy x86 CPU instructions that might help:

FYL2X, FYL2X, FYL2XP1, F2XM1, FLDL2T, FLDL2E, FLDLG2, FLDLN2

There are also a few IEEE floating point tricks you can use to approximate it too (check out Jim Blinn''s Notation, Notation, Notation book and the Sony presentations from GDC 2001)

which of course do imply that a lookup table might not be the way to go (depending on whether you can get the LUT without too much cache overhead)

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
quote:
Original post by Sheeva_
I''m currently implementing a fixedpoint library for use in a 3D engine and I need a _really_ fast routine for computing logarithms. I think I can use lookup tables for that. Can anybody throw in an idea how to do it? Thanks!

Is your engine completed? Don''t optimize until you''ve profiled it. It''s very unlikely that your logarithm function will be a bottleneck.

Cédric

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!