[NDS32] Fix incorrect settings in sfp-machine.h and t-nds32-newlib for hard fp.
authorChung-Ju Wu <jasonwucj@gmail.com>
Wed, 25 Apr 2018 12:08:14 +0000 (12:08 +0000)
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>
Wed, 25 Apr 2018 12:08:14 +0000 (12:08 +0000)
libgcc/
* config/nds32/sfp-machine.h: Fix settings for NDS32_ABI_2FP_PLUS.
* config/nds32/t-nds32-newlib (HOST_LIBGCC2_CFLAGS): Use -fwrapv.

From-SVN: r259645

libgcc/ChangeLog
libgcc/config/nds32/sfp-machine.h
libgcc/config/nds32/t-nds32-newlib

index 8d413b5efb64a15420c67f10fa1966394527a756..e5f44b346aa5b9b2e862ea9a6edc751881d962db 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-25  Chung-Ju Wu  <jasonwucj@gmail.com>
+
+       * config/nds32/sfp-machine.h: Fix settings for NDS32_ABI_2FP_PLUS.
+       * config/nds32/t-nds32-newlib (HOST_LIBGCC2_CFLAGS): Use -fwrapv.
+
 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/linux-unwind.h: Add (__CET__ & 2) != 0 check
index 499bdad7423ad64c5cc0a5fdf6b5ed76ab6afcf6..bfbdaf9c3bf2b5495dea4c71b950a873c424c6d0 100644 (file)
@@ -76,6 +76,25 @@ typedef int __gcc_CMPtype __attribute__ ((mode (__libgcc_cmp_return__)));
     R##_c = FP_CLS_NAN;                                                \
   } while (0)
 
+#ifdef NDS32_ABI_2FP_PLUS
+#define FP_RND_NEAREST         0x0
+#define FP_RND_PINF            0x1
+#define FP_RND_MINF            0x2
+#define FP_RND_ZERO            0x3
+#define FP_RND_MASK            0x3
+
+#define _FP_DECL_EX \
+  unsigned long int _fcsr __attribute__ ((unused)) = FP_RND_NEAREST
+
+#define FP_INIT_ROUNDMODE                      \
+  do {                                         \
+    _fcsr = __builtin_nds32_fmfcsr ();         \
+  } while (0)
+
+#define FP_ROUNDMODE (_fcsr & FP_RND_MASK)
+
+#endif
+
 /* Not checked.  */
 #define _FP_TININESS_AFTER_ROUNDING 0
 
index 1ea2bc3216367e76d2ab6654a5e2f7f19eb0d616..a59646fcff5ab4176127acff6cb80cc9c2927220 100644 (file)
@@ -19,7 +19,7 @@
 # <http://www.gnu.org/licenses/>.
 
 # Compiler flags to use when compiling 'libgcc2.c'
-HOST_LIBGCC2_CFLAGS = -O2
+HOST_LIBGCC2_CFLAGS = -O2 -fwrapv
 
 
 #LIB1ASMSRC   = nds32/lib1asmsrc-newlib.S