working on it

This commit is contained in:
Dawid Sobczak 2025-04-05 10:55:40 +01:00
parent 56a6e78765
commit 35a88970c2
1094 changed files with 51093 additions and 51 deletions

View file

@ -0,0 +1,36 @@
.global expf
expf:
mov 4(%esp),%eax
flds 4(%esp)
shr $23,%eax
inc %al
jz 1f
jmp 0f
.global exp
exp:
mov 8(%esp),%eax
fldl 4(%esp)
shl %eax
cmp $0xffe00000,%eax
jae 1f
0: fldl2e
fmulp
fst %st(1)
frndint
fst %st(2)
fsubrp
f2xm1
fld1
faddp
fscale
fstp %st(1)
ret
1: fsts 4(%esp)
cmpl $0xff800000,4(%esp)
jnz 1f
fstp %st(0)
fldz
1: ret

View file

@ -0,0 +1 @@

View file

@ -0,0 +1,6 @@
.global log
log:
fldln2
fldl 4(%esp)
fyl2x
ret

View file

@ -0,0 +1,6 @@
.global log10
log10:
fldlg2
fldl 4(%esp)
fyl2x
ret

View file

@ -0,0 +1,6 @@
.global log10f
log10f:
fldlg2
flds 4(%esp)
fyl2x
ret

View file

@ -0,0 +1,6 @@
.global logf
logf:
fldln2
flds 4(%esp)
fyl2x
ret

View file

@ -0,0 +1,16 @@
.global remainderf
remainderf:
flds 8(%esp)
flds 4(%esp)
jmp 1f
.global remainder
remainder:
fldl 12(%esp)
fldl 4(%esp)
1: fprem1
fstsw %ax
sahf
jp 1b
fstp %st(1)
ret

View file

@ -0,0 +1,4 @@
.global sqrt
sqrt: fldl 4(%esp)
fsqrt
ret

View file

@ -0,0 +1,4 @@
.global sqrtf
sqrtf: flds 4(%esp)
fsqrt
ret

View file

View file

View file

@ -0,0 +1,5 @@
.global fabs
fabs:
fldl 4(%esp)
fabs
ret

View file

@ -0,0 +1,5 @@
.global fabsf
fabsf:
flds 4(%esp)
fabs
ret

View file

View file

View file

View file

View file

@ -0,0 +1,5 @@
.global rint
rint:
fldl 4(%esp)
frndint
ret

View file

@ -0,0 +1,5 @@
.global rintf
rintf:
flds 4(%esp)
frndint
ret

View file

@ -0,0 +1,11 @@
.global ldexp
.global scalbn
.global scalbln
ldexp:
scalbn:
scalbln:
fildl 12(%esp)
fldl 4(%esp)
fscale
fstp %st(1)
ret

View file

@ -0,0 +1,11 @@
.global ldexpf
.global scalbnf
.global scalblnf
ldexpf:
scalbnf:
scalblnf:
fildl 8(%esp)
flds 4(%esp)
fscale
fstp %st(1)
ret

View file

@ -0,0 +1,36 @@
.global ceilf
ceilf: flds 4(%esp)
jmp 1f
.global ceil
ceil: fldl 4(%esp)
1: mov $0x08fb,%edx
jmp 0f
.global floorf
floorf: flds 4(%esp)
jmp 1f
.global floor
floor: fldl 4(%esp)
1: mov $0x04f7,%edx
jmp 0f
.global truncf
truncf: flds 4(%esp)
jmp 1f
.global trunc
trunc: fldl 4(%esp)
1: mov $0x0cff,%edx
0: fstcw 4(%esp)
mov 5(%esp),%ah
or %dh,%ah
and %dl,%ah
xchg %ah,5(%esp)
fldcw 4(%esp)
frndint
mov %ah,5(%esp)
fldcw 4(%esp)
ret

View file