Skip to content

Commit

Permalink
Check __SSE_MATH__ in x86_64 feraiseexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
H.J. Lu committed Jun 6, 2012
1 parent 6e230d1 commit a728a38
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2012-06-06 H.J. Lu <hongjiu.lu@intel.com>

[BZ #14117]
* sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
__SSE_MATH__.

2012-06-06 Siddhesh Poyarekar <siddhesh@redhat.com>

[BZ #14134]
Expand Down
12 changes: 11 additions & 1 deletion sysdeps/x86_64/fpu/bits/fenv.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1997-2001,2004,2011,2012 Free Software Foundation, Inc.
/* Copyright (C) 1997-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
Expand Down Expand Up @@ -109,15 +109,25 @@ __NTH (feraiseexcept (int __excepts))
/* One example of a invalid operation is 0.0 / 0.0. */
float __f = 0.0;

# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
# else
__asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
: "=t" (__f) : "0" (__f));
# endif
(void) &__f;
}
if ((FE_DIVBYZERO & __excepts) != 0)
{
float __f = 1.0;
float __g = 0.0;

# ifdef __SSE_MATH__
__asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
# else
__asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
: "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
# endif
(void) &__f;
}

Expand Down

0 comments on commit a728a38

Please sign in to comment.