mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Improve signal handling and math
- Polyfill ucontext_t on FreeBSD/OpenBSD/NetBSD - Add tests confirming signals can edit CPU state - Work towards supporting ZIP filesystem on bare metal - Add more tinymath unit tests for POSIX conformance - Add X87 and SSE status flags to crash report - Fix some bugs in blinkenlights - Fix llvm build breakage
This commit is contained in:
parent
cdc54ea1fd
commit
40291c9db3
109 changed files with 2316 additions and 520 deletions
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/macros.h"
|
||||
.source __FILE__
|
||||
|
||||
// Returns 𝑒^x.
|
||||
//
|
||||
|
@ -27,6 +26,12 @@ expl: push %rbp
|
|||
mov %rsp,%rbp
|
||||
.profilable
|
||||
fldt 16(%rbp)
|
||||
fxam # isinf(x)
|
||||
fstsw %ax
|
||||
mov %ah,%al
|
||||
and $0x45,%ah
|
||||
cmp $5,%ah
|
||||
je 1f
|
||||
fldl2e
|
||||
fmulp %st,%st(1)
|
||||
fld %st
|
||||
|
@ -38,6 +43,11 @@ expl: push %rbp
|
|||
faddp
|
||||
fscale
|
||||
fstp %st(1)
|
||||
pop %rbp
|
||||
0: pop %rbp
|
||||
ret
|
||||
1: test $2,%al # signbit(x)
|
||||
jz 0b
|
||||
fstp %st
|
||||
fldz
|
||||
jmp 0b
|
||||
.endfn expl,globl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue