Fix strtol

This commit is contained in:
Justine Tunney 2020-12-29 21:39:43 -08:00
parent 1df136323b
commit 5eddadafbd
17 changed files with 83 additions and 105 deletions

View file

@ -19,15 +19,14 @@
#include "libc/macros.h"
.source __FILE__
/ Returns absolute value of double.
/ Returns absolute value of 𝑥.
/
/ @param xmm0 has double in lower half
/ @return xmm0 has result in lower half
/ @param 𝑥 is double passed in lower half on %xmm0
/ @return absolute value in %xmm0
fabs: .leafprologue
.profilable
mov $0x7fffffffffffffff,%rax
movq %xmm0,%rdx
and %rax,%rdx
movq %rdx,%xmm0
movq %rax,%xmm1
pand %xmm1,%xmm0
.leafepilogue
.endfn fabs,globl

View file

@ -19,6 +19,10 @@
#include "libc/macros.h"
.source __FILE__
/ Returns absolute value of 𝑥.
/
/ @param 𝑥 is float passed in lower quarter on %xmm0
/ @return absolute value in %xmm0
fabsf: .leafprologue
.profilable
movd %xmm0,%eax

View file

@ -19,6 +19,10 @@
#include "libc/macros.h"
.source __FILE__
/ Returns absolute value of 𝑥.
/
/ @param 𝑥 long double passed on stack
/ @return absolute value in %st
fabsl: push %rbp
mov %rsp,%rbp
.profilable