Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: kishor Newsgroups: comp.arch.embedded Subject: Re: Floating point vs fixed arithmetics (signed 64-bit) Date: Tue, 27 Mar 2012 04:59:22 -0700 (PDT) Organization: http://groups.google.com Lines: 29 Message-ID: <19155336.803.1332849562889.JavaMail.geo-discussion-forums@pbcto7> References: <4f704f85$0$6987$e4fe514c@news2.news.xs4all.nl> <12630696.3178.1332764668757.JavaMail.geo-discussion-forums@pbbpx3> <4f70706e$0$6950$e4fe514c@news2.news.xs4all.nl> <4f70b34c$0$6846$e4fe514c@news2.news.xs4all.nl> <6ot1n7pvjbktv3q8hbc1vvolvm14o8nmhb@4ax.com> NNTP-Posting-Host: 114.143.4.97 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1332849563 31560 127.0.0.1 (27 Mar 2012 11:59:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 27 Mar 2012 11:59:23 +0000 (UTC) In-Reply-To: <6ot1n7pvjbktv3q8hbc1vvolvm14o8nmhb@4ax.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=114.143.4.97; posting-account=gKQb6AoAAACZKJEYmLW5LYCpReGiyTX6 User-Agent: G2/1.0 Xref: csiph.com comp.arch.embedded:7791 Sorry for late reply, I have experimented few things, 1. Signed 32-bit divide by constant of 2^n Compiler uses 2 ASR (Arithmetic shift right) & 1 ADD instruction instead of SDIV instruction 2. Signed 32-bit divide by constant other than 2^n It uses SMLAL (signed multiply & accumulate long) & other instructions 3. Unsigned 64-bit divide by constant of 2^n It uses 2 LSR & 1 ORR instruction. 4. Unsigned 64-bit divide by constant other than 2^n 5. Signed 64-bit divide by constant of 2^n 6. Signed 64-bit divide by constant other than 2^n It calls __aeabi_ldivmod, __aeabi_uldivmod functions I have two queries, 1. Is hardware DIV / SDIV instructions are slower than shift logic? 2. Is it possible to generate shift based logic to case 5 mentioned above? (Signed 64-bit divide by constant of 2^n) Thanks, Kishore.