Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IA32 FPU exponentiation

27 views
Skip to first unread message

T.M. Sommers

unread,
Feb 23, 2013, 8:38:46 AM2/23/13
to
I have been trying to find an exponentiation instruction in the IA32
FPU, but I have had no success. Am I missing something, or is the FPU
missing the operation? Thanks.

--
T.M. Sommers -- ab2sb

Rod Pemberton

unread,
Feb 23, 2013, 9:25:31 AM2/23/13
to
"T.M. Sommers" <tmsom...@gmail.com> wrote in message
news:kgagok$e2t$1...@news.albasani.net...

> I have been trying to find an exponentiation instruction in the
> IA32 FPU, but I have had no success. Am I missing something,
> or is the FPU missing the operation? Thanks.
>


I'm not familiar with x87 programming, but it appears that your
options are to use combinations of these instructions or others:

F2XM1
FSCALE
FXTRACT
FYL2X
FYL2XP1

From an online description for an Intel IA-32 manual, the
description of F2XM1 says to use FYL2X with F2XM1 for general
exponentiation. Intel and AMD provide current instruction manuals
on their websites for free.


These may be worth a read:
http://jheriko-rtw.blogspot.com/2009/04/why-do-we-have-f2xm1.html
http://stackoverflow.com/questions/4638473/how-to-powreal-real-in-x86
http://www.asmcommunity.net/board/index.php?topic=9853.0


You might also want to post to comp.lang.asm.x86. There might be
a few guys familiar with programming x87 instructions there. CLAX
is moderated, so expect a delay before your post appears.


You may also wish to find an online copy of the "INTEL 80287
PROGRAMMER'S REFERENCE MANUAL", or perhaps one for
80387 or 8087 etc. The 80287 manual describes the instructions
and how to use them.


Some other online x87 FPU references:
http://www.website.masmforum.com/tutorials/fptute/fpuchap11.htm
http://www.textfiles.com/computers/DOCUMENTATION/a07.txt
http://www.drdobbs.com/embedded-systems/assembly-language-programming-for-the-80/184408726?pgno=2

HTH,


Rod Pemberton



T.M. Sommers

unread,
Feb 23, 2013, 8:37:00 PM2/23/13
to
On 2/23/2013 9:25 AM, Rod Pemberton wrote:
> "T.M. Sommers" <tmsom...@gmail.com> wrote in message
> news:kgagok$e2t$1...@news.albasani.net...
>
>> I have been trying to find an exponentiation instruction in the
>> IA32 FPU, but I have had no success. Am I missing something,
>> or is the FPU missing the operation? Thanks.
>
> I'm not familiar with x87 programming, but it appears that your
> options are to use combinations of these instructions or others:
>
> F2XM1
> FSCALE
> FXTRACT
> FYL2X
> FYL2XP1
>
> From an online description for an Intel IA-32 manual, the
> description of F2XM1 says to use FYL2X with F2XM1 for general
> exponentiation.

D'oh! I saw those instructions, but didn't see that in the
descriptions, and didn't see it myself. Thanks, and sorry for the trouble.

> Intel and AMD provide current instruction manuals
> on their websites for free.

Yeah, I have them; I just don't know how to read.

jondane

unread,
Mar 24, 2013, 3:54:44 AM3/24/13
to
Rod Pemberton wrote:

> I'm not familiar with x87 programming,

Why not? What do we pay you for? What company do you work for? I will be
sure to dock your pay.


0 new messages