1*c9945492SAndroid Build Coastguard Worker #include <math.h> 2*c9945492SAndroid Build Coastguard Worker remainder(double x,double y)3*c9945492SAndroid Build Coastguard Workerdouble remainder(double x, double y) 4*c9945492SAndroid Build Coastguard Worker { 5*c9945492SAndroid Build Coastguard Worker unsigned short fpsr; 6*c9945492SAndroid Build Coastguard Worker // fprem1 does not introduce excess precision into x 7*c9945492SAndroid Build Coastguard Worker do __asm__ ("fprem1; fnstsw %%ax" : "+t"(x), "=a"(fpsr) : "u"(y)); 8*c9945492SAndroid Build Coastguard Worker while (fpsr & 0x400); 9*c9945492SAndroid Build Coastguard Worker return x; 10*c9945492SAndroid Build Coastguard Worker } 11*c9945492SAndroid Build Coastguard Worker 12*c9945492SAndroid Build Coastguard Worker weak_alias(remainder, drem); 13