Is there any way to compute powers of floating point numbers purely in x86/x87 assembly? I'm not talking about computing integral powers of floating point numbers, but something like x^y where both x and y are floating point numbers.
I have a solution for integral powers (NASM syntax):
compute_integral_powers:
fldl [esp+4] ;load base twice
fld st0
movl ecx, [esp+12] ;load exponent
.loop:
decl ecx ;decrement exponent
cmpl ecx, 0 ;are we done yet?
jz .done
fmul st1 ;multiply by original base
jmp .loop ;keep going
.done:
fstp st1 ;store st0 in st1 and pop (for return value)
ret
Is there something similar to compute powers using floating point exponents, using only x86/x87 assembly instructions?