comp.lang.ada
 help / color / mirror / Atom feed
From: rakusu_klein@fastmail.jp
Subject: Re: GNAT for AVR - Mathematical Functions
Date: Mon, 17 Sep 2018 18:16:59 -0700 (PDT)
Date: 2018-09-17T18:16:59-07:00	[thread overview]
Message-ID: <b5e9d46e-6287-4964-879a-a0ccd5cc94d1@googlegroups.com> (raw)
In-Reply-To: <ed6bc2e2-a2e1-4a0b-b253-8142d47518c9@googlegroups.com>

It is always be bottleneck — doing math on slow integer 8-bit CPU with tiny amount of memory and instructions only for addition and subtraction, — because it produce a huge pieces of slow machine code. So all math there are doing in integers by a table calculations, adds and shifts. Therefore in future it's better to go away from AVR for you with math, I think.
Btw, there is a quite old C-runtime library for AVR at http://savannah.nongnu.org/projects/avr-libc/ — it might be helpful for you, especially its handwritten libm. It can also be useful to look at CORDIC algorithm, frex http://www.dcs.gla.ac.uk/~jhw/cordic/index.html

  parent reply	other threads:[~2018-09-18  1:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17  2:22 GNAT for AVR - Mathematical Functions ada.newcomer
2018-09-17  7:18 ` Dmitry A. Kazakov
2018-09-17 22:41   ` Aurele Vitali
2018-09-17 12:22 ` Simon Wright
2018-09-17 17:28 ` Bill Findlay
2018-09-17 22:35 ` Aurele Vitali
2018-09-18  1:16 ` rakusu_klein [this message]
2018-09-25  7:14 ` R R
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox