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

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

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