aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/sh
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-06-09 18:46:01 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-06-09 18:46:01 +0200
commit99ff6e5c49c10bb1827e102c7a8eb6b504f0886f (patch)
treeb4b46c4f707a57b5a4c73f6fa6238774784f8a4b /sysdeps/sh
parent366af02c96eea0a03ccd2fa187819d866ac49ba2 (diff)
downloadglibc-99ff6e5c49c10bb1827e102c7a8eb6b504f0886f.zip
glibc-99ff6e5c49c10bb1827e102c7a8eb6b504f0886f.tar.gz
glibc-99ff6e5c49c10bb1827e102c7a8eb6b504f0886f.tar.bz2
SH: No FE_UPWARD, FE_DOWNWARD.
Diffstat (limited to 'sysdeps/sh')
-rw-r--r--sysdeps/sh/sh4/fpu/bits/fenv.h14
-rw-r--r--sysdeps/sh/sh4/fpu/fegetround.c2
-rw-r--r--sysdeps/sh/sh4/fpu/fesetround.c4
3 files changed, 9 insertions, 11 deletions
diff --git a/sysdeps/sh/sh4/fpu/bits/fenv.h b/sysdeps/sh/sh4/fpu/bits/fenv.h
index 38c303f..9315949 100644
--- a/sysdeps/sh/sh4/fpu/bits/fenv.h
+++ b/sysdeps/sh/sh4/fpu/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999-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
@@ -39,19 +39,17 @@ enum
#define FE_ALL_EXCEPT \
(FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
-/* The SH FPU supports all of the four defined rounding modes. We
- use again the bit positions in the FPU control word as the values
- for the appropriate macros. */
+/* The SH FPU supports two of the four defined rounding modes: round to nearest
+ and round to zero. We use again the bit positions in the FPU control word
+ as the values for the appropriate macros. */
enum
{
+ __FE_UNDEFINED = -1,
+
FE_TONEAREST = 0x0,
#define FE_TONEAREST FE_TONEAREST
FE_TOWARDZERO = 0x1,
#define FE_TOWARDZERO FE_TOWARDZERO
- FE_UPWARD = 0x2,
-#define FE_UPWARD FE_UPWARD
- FE_DOWNWARD = 0x3
-#define FE_DOWNWARD FE_DOWNWARD
};
diff --git a/sysdeps/sh/sh4/fpu/fegetround.c b/sysdeps/sh/sh4/fpu/fegetround.c
index 7368383..adaeb8a 100644
--- a/sysdeps/sh/sh4/fpu/fegetround.c
+++ b/sysdeps/sh/sh4/fpu/fegetround.c
@@ -28,5 +28,5 @@ fegetround (void)
/* Get control word. */
_FPU_GETCW (cw);
- return cw & 0x3;
+ return cw & 0x1;
}
diff --git a/sysdeps/sh/sh4/fpu/fesetround.c b/sysdeps/sh/sh4/fpu/fesetround.c
index 82e13b6..91c159b 100644
--- a/sysdeps/sh/sh4/fpu/fesetround.c
+++ b/sysdeps/sh/sh4/fpu/fesetround.c
@@ -25,7 +25,7 @@ fesetround (int round)
{
fpu_control_t cw;
- if ((round & ~0x3) != 0)
+ if ((round & ~0x1) != 0)
/* ROUND is no valid rounding mode. */
return 1;
@@ -33,7 +33,7 @@ fesetround (int round)
_FPU_GETCW (cw);
/* Set rounding bits. */
- cw &= ~0x3;
+ cw &= ~0x1;
cw |= round;
/* Set new state. */
_FPU_SETCW (cw);