提交 c24a9923 编写于 作者: A Alexander Monakov 提交者: Rich Felker

math: move x87-family fabs functions to C with inline asm

上级 87026f68
#include <math.h>
double fabs(double x)
{
__asm__ ("fabs" : "+t"(x));
return x;
}
.global fabs
.type fabs,@function
fabs:
fldl 4(%esp)
fabs
ret
#include <math.h>
float fabsf(float x)
{
__asm__ ("fabs" : "+t"(x));
return x;
}
.global fabsf
.type fabsf,@function
fabsf:
flds 4(%esp)
fabs
ret
#include <math.h>
long double fabsl(long double x)
{
__asm__ ("fabs" : "+t"(x));
return x;
}
.global fabsl
.type fabsl,@function
fabsl:
fldt 4(%esp)
fabs
ret
#include <math.h>
long double fabsl(long double x)
{
__asm__ ("fabs" : "+t"(x));
return x;
}
.global fabsl
.type fabsl,@function
fabsl:
fldt 8(%rsp)
fabs
ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册