Print this page
patch mul-ste
*** 37,53 ****
/*
* Multiplies two normal or subnormal doubles, returns result and exceptions.
*/
double
__mul_set(double x, double y, int *pe) {
! extern void _putmxcsr(), _getmxcsr();
! int csr;
double z;
! _putmxcsr(CSR_DEFAULT);
! z = x * y;
! _getmxcsr(&csr);
if ((csr & 0x3f) == 0) {
*pe = 0;
} else {
/* Result may not be exact. */
*pe = 1;
--- 37,56 ----
/*
* Multiplies two normal or subnormal doubles, returns result and exceptions.
*/
double
__mul_set(double x, double y, int *pe) {
! int csr = CSR_DEFAULT;
double z;
! __asm__ __volatile__(
! "ldmxcsr %4\n"
! "mulsd %2,%3\n"
! "stmxcsr %0\n"
! : "=m" (csr), "=C" (z)
! : "C" (x), "C" (y), "m" (csr));
!
if ((csr & 0x3f) == 0) {
*pe = 0;
} else {
/* Result may not be exact. */
*pe = 1;