1 #include <math.h> 2 lrint(double x)3 long lrint(double x) 4 { 5 long n; 6 __asm__ ( 7 "frintx %d1, %d1\n" 8 "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x)); 9 return n; 10 } 11