Fix bugs and have emulator emulate itself

This commit is contained in:
Justine Tunney 2020-08-31 05:17:31 -07:00
parent 5aabacb361
commit bd29223891
111 changed files with 1283 additions and 2073 deletions

View file

@ -20,21 +20,26 @@
#include "libc/macros.h"
.source __FILE__
/ Returns 𝑥 × 2ʸ.
/
/ @param 𝑥 is double passed in %xmm0
/ @param 𝑦 is exponent via %edi
/ @return double in %xmm0
tinymath_ldexp:
push %rbp
mov %rsp,%rbp
.profilable
push %rax
movsd %xmm0,-8(%rbp)
fldl -8(%rbp)
mov %edi,-8(%rbp)
fildl -8(%rbp)
fxch %st(1)
push %rdi
fildl (%rsp)
movsd %xmm0,(%rsp)
fldl (%rsp)
fscale
fstp %st(1)
fstpl -8(%rbp)
movsd -8(%rbp),%xmm0
fstpl (%rsp)
movsd (%rsp),%xmm0
leave
ret
.endfn tinymath_ldexp,globl
.alias tinymath_ldexp,ldexp
.alias tinymath_ldexp,scalbn
.alias tinymath_ldexp,scalbln