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 float passed in %xmm0
/ @param 𝑦 is exponent via %edi
/ @return float in %xmm0
tinymath_ldexpf:
push %rbp
mov %rsp,%rbp
.profilable
push %rax
movss %xmm0,-4(%rbp)
flds -4(%rbp)
movl %edi,-4(%rbp)
fildl -4(%rbp)
fxch %st(1)
push %rdi
fildl (%rsp)
movss %xmm0,(%rsp)
flds (%rsp)
fscale
fstp %st(1)
fstps -4(%rbp)
movss -4(%rbp),%xmm0
fstps (%rsp)
movss (%rsp),%xmm0
leave
ret
.endfn tinymath_ldexpf,globl
.alias tinymath_ldexpf,ldexpf
.alias tinymath_ldexpf,scalbnf
.alias tinymath_ldexpf,scalblnf