flat assembler
Message board for the users of flat assembler.

Index > Main > Exponentiation in Fasm X64 Windows

Author
Thread Post new topic Reply to topic
Aditya J



Joined: 17 Feb 2024
Posts: 6
Location: home
Aditya J 11 May 2024, 07:44
How can i do float exponentiation in windows fasm?

I want to exponentiate XMM registers...

Tried F2XM1 but it is working for x86 not x64
Also another method was to use LN and EXP but unsure how to do that
Can i use the powf in the C standard library???


Plz help...
Post 11 May 2024, 07:44
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3974
Location: vpcmipstrm
bitRAKE 11 May 2024, 12:04
The FPU instructions work in 64-bit.

Alternately, you'll need to code SSE functions for e^x and log b; or use a library of math functions.

Another option is OleAut32.VarPow or OleAut32.VarR8Pow.
Code:
        vmovq xmm0, [d2.0]
        vmovq xmm1, [d3.0]
        lea r8, [result]
        call [VarR8Pow]

d2.0    dq 2.0
d3.0    dq 3.0
result  dq ?    
... lazy mode. Smile

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 11 May 2024, 12:04
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.