[polyml] 02/09: Add support for SuperH

James Clarke jrtc27-guest at moszumanska.debian.org
Thu Apr 7 10:52:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

jrtc27-guest pushed a commit to branch master
in repository polyml.

commit d4063e045edfead1333d9782f28debb53b4ea18c
Author: James Clarke <jrtc27 at jrtc27.com>
Date:   Tue Mar 29 22:18:15 2016 +0100

    Add support for SuperH
---
 debian/changelog       |  1 +
 debian/patches/series  |  1 +
 debian/patches/sh.diff | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 4698e73..9a9eaa6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ polyml (5.6-4) UNRELEASED; urgency=low
 
   * New patches:
     - maxhostnamelen.diff: Remove all use of MAXHOSTNAMELEN
+    - sh.diff: Add support for sh4
     - sparc64.diff: Add support for sparc64
 
  -- James Clarke <jrtc27 at jrtc27.com>  Mon, 14 Mar 2016 18:39:58 +0000
diff --git a/debian/patches/series b/debian/patches/series
index 3ed8198..63b8a0e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -21,3 +21,4 @@ bss-ioarea.diff
 noflsh-unsigned.diff
 maxhostnamelen.diff
 sparc64.diff
+sh.diff
diff --git a/debian/patches/sh.diff b/debian/patches/sh.diff
new file mode 100644
index 0000000..ee394b8
--- /dev/null
+++ b/debian/patches/sh.diff
@@ -0,0 +1,79 @@
+Description: Add support for SuperH
+Author: James Clarke <jrtc27 at jrtc27.com>
+Forwarded: https://github.com/polyml/polyml/pull/46
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/config.h.in
++++ b/config.h.in
+@@ -590,6 +590,9 @@
+ /* Define if the host is an S/390 (64-bit) */
+ #undef HOSTARCHITECTURE_S390X
+ 
++/* Define if the host is a SuperH (32-bit) */
++#undef HOSTARCHITECTURE_SH
++
+ /* Define if the host is a Sparc (32-bit) */
+ #undef HOSTARCHITECTURE_SPARC
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -483,6 +483,10 @@
+             AC_DEFINE([HOSTARCHITECTURE_S390], [1], [Define if the host is an S/390 (32-bit)])
+             polyarch=interpret
+             ;;
++      sh*)
++            AC_DEFINE([HOSTARCHITECTURE_SH], [1], [Define if the host is a SuperH (32-bit)])
++            polyarch=interpret
++            ;;
+       alpha*)
+             AC_DEFINE([HOSTARCHITECTURE_ALPHA], [1], [Define if the host is an Alpha (64-bit)])
+             polyarch=interpret
+--- a/libpolyml/elfexport.cpp
++++ b/libpolyml/elfexport.cpp
+@@ -390,6 +390,10 @@
+     fhdr.e_machine = EM_S390;
+     directReloc = R_390_64;
+     useRela = true;
++#elif defined(HOSTARCHITECTURE_SH)
++    fhdr.e_machine = EM_SH;
++    directReloc = R_SH_DIR32;
++    useRela = true;
+ #elif defined(HOSTARCHITECTURE_SPARC)
+     fhdr.e_machine = EM_SPARC;
+     directReloc = R_SPARC_32;
+--- a/libpolyml/reals.cpp
++++ b/libpolyml/reals.cpp
+@@ -393,16 +393,18 @@
+ // but they are frequently inlined 
+ #elif defined(HAVE_FENV_H)
+ // C99 version.  This is becoming the most common.
+-static int getrounding(TaskData *)
++static int getrounding(TaskData *taskData)
+ {
+     switch (fegetround())
+     {
+     case FE_TONEAREST: return POLY_ROUND_TONEAREST;
++#ifndef HOSTARCHITECTURE_SH
+     case FE_DOWNWARD: return POLY_ROUND_DOWNWARD;
+     case FE_UPWARD: return POLY_ROUND_UPWARD;
++#endif
+     case FE_TOWARDZERO: return POLY_ROUND_TOZERO;
+     }
+-    return 0; // Keep the compiler happy
++    raise_exception_string(taskData, EXC_Fail, "Set to an unknown rounding mode");
+ }
+ 
+ static void setrounding(TaskData *taskData, Handle args)
+@@ -410,9 +412,12 @@
+     switch (get_C_long(taskData, DEREFWORDHANDLE(args)))
+     {
+     case POLY_ROUND_TONEAREST: fesetround(FE_TONEAREST); break; // Choose nearest
++#ifndef HOSTARCHITECTURE_SH
+     case POLY_ROUND_DOWNWARD: fesetround(FE_DOWNWARD); break; // Towards negative infinity
+     case POLY_ROUND_UPWARD: fesetround(FE_UPWARD); break; // Towards positive infinity
++#endif
+     case POLY_ROUND_TOZERO: fesetround(FE_TOWARDZERO); break; // Truncate towards zero
++    default: raise_exception_string(taskData, EXC_Fail, "Unsupported rounding mode");
+     }
+ }
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/polyml.git



More information about the debian-science-commits mailing list