Commit 771c0562 by Uros Bizjak Committed by Uros Bizjak

fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.

	* config/fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.
	Change cw and cw_sse variables to unsigned.
	(SSE): New definition.
	(has_sse): Use it.

From-SVN: r105402
parent 76f5f441
2005-10-14 Uros Bizjak <uros@kss-loka.si>
* config/fpu-387.h (set_fpu): Remove extra ":" in stmxcsr.
Change cw and cw_sse variables to unsigned.
(SSE): New definition.
(has_sse): Use it.
2005-10-13 Thomas Koenig <Thomas.Koenig@online.de> 2005-10-13 Thomas Koenig <Thomas.Koenig@online.de>
* io/unix.c(fd_alloc_r_at): Use read() instead of do_read() * io/unix.c(fd_alloc_r_at): Use read() instead of do_read()
only in case of special files (e.g. terminals). only in case of special files (e.g. terminals).
2005-20-13 Uros Bizjak <uros@kss-loka.si> 2005-10-13 Uros Bizjak <uros@kss-loka.si>
* config/fpu-387.h (set_fpu): Add "=m" for stmxcsr. * config/fpu-387.h (set_fpu): Add "=m" for stmxcsr.
......
...@@ -28,6 +28,7 @@ License along with libgfortran; see the file COPYING. If not, ...@@ -28,6 +28,7 @@ License along with libgfortran; see the file COPYING. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */ Boston, MA 02110-1301, USA. */
#define SSE (1 << 25)
static int static int
has_sse (void) has_sse (void)
...@@ -58,7 +59,7 @@ has_sse (void) ...@@ -58,7 +59,7 @@ has_sse (void)
: "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx) : "=a" (eax), "=r" (ebx), "=c" (ecx), "=d" (edx)
: "0" (1)); : "0" (1));
if (edx & (1 << 25)) if (edx & SSE)
return 1; return 1;
return 0; return 0;
...@@ -67,8 +68,8 @@ has_sse (void) ...@@ -67,8 +68,8 @@ has_sse (void)
void set_fpu (void) void set_fpu (void)
{ {
short cw; unsigned short cw;
int cw_sse; unsigned int cw_sse;
/* i387 -- see linux <fpu_control.h> header file for details. */ /* i387 -- see linux <fpu_control.h> header file for details. */
#define _FPU_MASK_IM 0x01 #define _FPU_MASK_IM 0x01
...@@ -90,7 +91,7 @@ void set_fpu (void) ...@@ -90,7 +91,7 @@ void set_fpu (void)
if (has_sse()) if (has_sse())
{ {
/* SSE */ /* SSE */
asm volatile ("stmxcsr %0" : : "=m" (cw_sse)); asm volatile ("stmxcsr %0" : "=m" (cw_sse));
cw_sse &= 0xFFFF0000; cw_sse &= 0xFFFF0000;
if (options.fpe & GFC_FPE_INVALID) cw_sse |= 1 << 7; if (options.fpe & GFC_FPE_INVALID) cw_sse |= 1 << 7;
if (options.fpe & GFC_FPE_DENORMAL) cw_sse |= 1 << 8; if (options.fpe & GFC_FPE_DENORMAL) cw_sse |= 1 << 8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment