rax : function number int 0x60 : system call Index: 151 - Mathlib - Based on Naoki Shibata's SLEEF http://shibatch.sourceforge.net/ NOTE: math functions operate on single/double precision floats using SSE/SSE2 volatile registers for every math functions are: rax,rbx and xmm0-xmm5 the double precision exp2,exp10,log2,log10,pow are high precision functions you can rely on the facts that a^b = exp(b*log(a)) and log(base a)b = log(b) * 1/log(a) application example mathlib.asm at download area Packed double In : rbx - 00 - cosine packed double xmm0 - x Out: xmm0 - cos(x) In : rbx - 01 - sine packed double xmm0 - x Out: xmm0 - sin(x) In : rbx - 02 - sincos packed double xmm0 - x Out: xmm0 - sin(x) xmm1 - cos(x) In : rbx - 03 - tangent packed double xmm0 - x Out: xmm0 - tan(x) In : rbx - 04 - arc tangent packed double xmm0 - x Out: xmm0 - atan(x) In : rbx - 05 - arc tangent of y/x packed double xmm0 - y xmm1 - x Out: xmm0 - atan2(y,x) In : rbx - 06 - arc cosine packed double xmm0 - x Out: xmm0 - acos(x) In : rbx - 07 - arc sine packed double xmm0 - x Out: xmm0 - asin(x) In : rbx - 08 - power packed double xmm0 - x xmm1 - y Out: xmm0 - pow(x,y) In : rbx - 09 - cube root packed double xmm0 - x Out: xmm0 - cbrt(x) In : rbx - 10 - exponent base e packed double xmm0 - x Out: xmm0 - exp(x) In : rbx - 11 - exponent base 2 packed double xmm0 - x Out: xmm0 - exp2(x) In : rbx - 12 - exponent base 10 packed double xmm0 - x Out: xmm0 - exp10(x) In : rbx - 13 - logarithm base e packed double xmm0 - x Out: xmm0 - log(x) In : rbx - 14 - logarithm base 2 packed double xmm0 - x Out: xmm0 - log2(x) In : rbx - 15 - logarithm base 10 packed double xmm0 - x Out: xmm0 - log10(x) In : rbx - 16 - exponent base e minus 1 packed double xmm0 - x Out: xmm0 - exp(x)-1 NOTE: exp(x)-1 is not truly implemented In : rbx - 17 - logarithm base e x plus 1 packed double xmm0 - x Out: xmm0 - log(1+x) NOTE: log(1+x) is not truly implemented In : rbx - 18 - ldexp packed double xmm0 - x xmm1 - q Out: xmm0 - x * 2^q NOTE: q is a packed dword integer In : rbx - 19 - ilogb (extract exponent) packed double xmm0 - x Out: xmm0 - (int)logb(x) NOTE: return value is a packed dword integer Scalar double In : rbx - 20 - cosine scalar double xmm0 - x Out: xmm0 - cos(x) In : rbx - 21 - sine scalar double xmm0 - x Out: xmm0 - sin(x) In : rbx - 22 - sincos scalar double xmm0 - x Out: xmm0 - sin(x) xmm1 - cos(x) In : rbx - 23 - tangent scalar double xmm0 - x Out: xmm0 - tan(x) In : rbx - 24 - arc tangent scalar double xmm0 - x Out: xmm0 - atan(x) In : rbx - 25 - arc tangent of y/x scalar double xmm0 - y xmm1 - x Out: xmm0 - atan2(y,x) In : rbx - 26 - arc cosine scalar double xmm0 - x Out: xmm0 - acos(x) In : rbx - 27 - arc sine scalar double xmm0 - x Out: xmm0 - asin(x) In : rbx - 28 - power scalar double xmm0 - x xmm1 - y Out: xmm0 - pow(x,y) In : rbx - 29 - cube root scalar double xmm0 - x Out: xmm0 - cbrt(x) In : rbx - 30 - exponent base e scalar double xmm0 - x Out: xmm0 - exp(x) In : rbx - 31 - exponent base 2 scalar double xmm0 - x Out: xmm0 - exp2(x) In : rbx - 32 - exponent base 10 scalar double xmm0 - x Out: xmm0 - exp10(x) In : rbx - 33 - logarithm base e scalar double xmm0 - x Out: xmm0 - log(x) In : rbx - 34 - logarithm base 2 scalar double xmm0 - x Out: xmm0 - log2(x) In : rbx - 35 - logarithm base 10 scalar double xmm0 - x Out: xmm0 - log10(x) In : rbx - 36 - exponent base e minus 1 scalar double xmm0 - x Out: xmm0 - exp(x)-1 NOTE: exp(x)-1 is not truly implemented In : rbx - 37 - logarithm base e x plus 1 scalar double xmm0 - x Out: xmm0 - log(1+x) NOTE: log(1+x) is not truly implemented In : rbx - 38 - ldexp scalar double xmm0 - x xmm1 - q Out: xmm0 - x * 2^q NOTE: q is a scalar dword integer In : rbx - 39 - ilogb (extract exponent) scalar double xmm0 - x Out: xmm0 - (int)logb(x) NOTE: return value is a scalar dword integer Packed single In : rbx - 40 - cosine packed single xmm0 - x Out: xmm0 - cos(x) In : rbx - 41 - sine packed single xmm0 - x Out: xmm0 - sin(x) In : rbx - 42 - sincos packed single xmm0 - x Out: xmm0 - sin(x) xmm1 - cos(x) In : rbx - 43 - tangent packed single xmm0 - x Out: xmm0 - tan(x) In : rbx - 44 - arc tangent packed single xmm0 - x Out: xmm0 - atan(x) In : rbx - 45 - arc tangent of y/x packed single xmm0 - y xmm1 - x Out: xmm0 - atan2(y,x) In : rbx - 46 - arc cosine packed single xmm0 - x Out: xmm0 - acos(x) In : rbx - 47 - arc sine packed single xmm0 - x Out: xmm0 - asin(x) In : rbx - 48 - power packed single xmm0 - x xmm1 - y Out: xmm0 - pow(x,y) In : rbx - 49 - cube root packed single xmm0 - x Out: xmm0 - cbrt(x) In : rbx - 50 - exponent base e packed single xmm0 - x Out: xmm0 - exp(x) In : rbx - 51 - exponent base 2 packed single xmm0 - x Out: xmm0 - exp2(x) In : rbx - 52 - exponent base 10 packed single xmm0 - x Out: xmm0 - exp10(x) In : rbx - 53 - logarithm base e packed single xmm0 - x Out: xmm0 - log(x) In : rbx - 54 - logarithm base 2 packed single xmm0 - x Out: xmm0 - log2(x) In : rbx - 55 - logarithm base 10 packed single xmm0 - x Out: xmm0 - log10(x) In : rbx - 56 - exponent base e minus 1 packed single xmm0 - x Out: xmm0 - exp(x)-1 NOTE: exp(x)-1 is not truly implemented In : rbx - 57 - logarithm base e x plus 1 packed single xmm0 - x Out: xmm0 - log(1+x) NOTE: log(1+x) is not truly implemented In : rbx - 58 - ldexp packed single xmm0 - x xmm1 - q Out: xmm0 - x * 2^q NOTE: q is a packed dword integer In : rbx - 59 - ilogb (extract exponent) packed single xmm0 - x Out: xmm0 - (int)logb(x) NOTE: return value is a packed dword integer Scalar single In : rbx - 60 - cosine scalar single xmm0 - x Out: xmm0 - cos(x) In : rbx - 61 - sine scalar single xmm0 - x Out: xmm0 - sin(x) In : rbx - 62 - sincos scalar single xmm0 - x Out: xmm0 - sin(x) xmm1 - cos(x) In : rbx - 63 - tangent scalar single xmm0 - x Out: xmm0 - tan(x) In : rbx - 64 - arc tangent scalar single xmm0 - x Out: xmm0 - atan(x) In : rbx - 65 - arc tangent of y/x scalar single xmm0 - y xmm1 - x Out: xmm0 - atan2(y,x) In : rbx - 66 - arc cosine scalar single xmm0 - x Out: xmm0 - acos(x) In : rbx - 67 - arc sine scalar single xmm0 - x Out: xmm0 - asin(x) In : rbx - 68 - power scalar single xmm0 - x xmm1 - y Out: xmm0 - pow(x,y) In : rbx - 69 - cube root scalar single xmm0 - x Out: xmm0 - cbrt(x) In : rbx - 70 - exponent base e scalar single xmm0 - x Out: xmm0 - exp(x) In : rbx - 71 - exponent base 2 scalar single xmm0 - x Out: xmm0 - exp2(x) In : rbx - 72 - exponent base 10 scalar single xmm0 - x Out: xmm0 - exp10(x) In : rbx - 73 - logarithm base e scalar single xmm0 - x Out: xmm0 - log(x) In : rbx - 74 - logarithm base 2 scalar single xmm0 - x Out: xmm0 - log2(x) In : rbx - 75 - logarithm base 10 scalar single xmm0 - x Out: xmm0 - log10(x) In : rbx - 76 - exponent base e minus 1 scalar single xmm0 - x Out: xmm0 - exp(x)-1 NOTE: exp(x)-1 is not truly implemented In : rbx - 77 - logarithm base e x plus 1 scalar single xmm0 - x Out: xmm0 - log(1+x) NOTE: log(1+x) is not truly implemented In : rbx - 78 - ldexp scalar single xmm0 - x xmm1 - q Out: xmm0 - x * 2^q NOTE: q is a scalar dword integer In : rbx - 79 - ilogb (extract exponent) scalar single xmm0 - x Out: xmm0 - (int)logb(x) NOTE: return value is a scalar dword integer