]> www.ginac.de Git - cln.git/commitdiff
* include/cln/modules.h, include/cln/object.h: add support for
authorRichard Kreckel <kreckel@ginac.de>
Fri, 14 Dec 2001 18:49:11 +0000 (18:49 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Fri, 14 Dec 2001 18:49:11 +0000 (18:49 +0000)
          s390.
        * src/numtheory/cl_nt_sqrtmodp.cc: workaround for GCC2.x compiler-bug
          on s390, provided by Gerhard Tonn.

ChangeLog
include/cln/modules.h
include/cln/object.h
src/numtheory/cl_nt_sqrtmodp.cc

index e3dccf7ff24899fdde5e588f93508719950f5881..694af2a342027380a6c048ee0cd4f2ef8f970415 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-12-14  Richard Kreckel  <kreckel@ginac.de>
+
+        * include/cln/modules.h, include/cln/object.h: add support for
+          s390.
+        * src/numtheory/cl_nt_sqrtmodp.cc: workaround for GCC2.x compiler-bug
+          on s390, provided by Gerhard Tonn.
+
 2001-11-05  Richard Kreckel  <kreckel@ginac.de>
 
         * autoconf/ltmain.sh: Upgrade to libtool-1.4.2.
index ff0589460725bc713990ab0adc274de2b690a00f..22f7c19f426d089fdfad975ae7b747d69d4d647d 100644 (file)
@@ -64,7 +64,7 @@
   #endif
   // Globalize a label defined in the same translation unit.
   // See macro ASM_GLOBALIZE_LABEL in the gcc sources.
-  #if defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__mips64__) || defined(__alpha__) || defined(__rs6000__)
+  #if defined(__i386__) || defined(__m68k__) || defined(__mips__) || defined(__mips64__) || defined(__alpha__) || defined(__rs6000__) || defined(__s390__)
     // Some m68k systems use "xdef" or "global" or ".global"...
     #define CL_GLOBALIZE_LABEL(label)  __asm__("\t.globl " label);
   #endif
   #if defined(__ia64__)
     #define CL_JUMP_TO(addr)  ASM_VOLATILE("br " #addr)
   #endif
+  #if defined(__s390__)
+    #define CL_JUMP_TO(addr)  ASM_VOLATILE("br %0" : : "a" ((void*)(addr)))
+  #endif
   #ifdef CL_GLOBAL_DESTRUCTOR_PREFIX
     #define CL_PROVIDE(module)  \
       extern "C" void cl_module__##module##__firstglobalfun () {}      \
index 02dd64ec52ed96df5a516587ea87f4ed1b5d71c9..b22e78f9ca0aaafa67e5def68a8c7f4baea856aa 100644 (file)
@@ -22,7 +22,7 @@ namespace cln {
 #if defined(__m68k__)
   #define cl_word_alignment  2
 #endif
-#if defined(__i386__) || defined(__mips__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__)
+#if defined(__i386__) || defined(__mips__) || defined(__sparc__) || defined(__hppa__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__) || defined(__s390__)
   #define cl_word_alignment  4
 #endif
 #if defined(__alpha__) || defined(__mips64__) || defined(__sparc64__) || defined(__ia64__)
index 6a74c5f26805af6bcb4dd89f11004cf453120816..098c4065e0803c1146fe63d473dd43f4b6076ffe 100644 (file)
@@ -173,6 +173,16 @@ static const sqrt_mod_p_t cantor_zassenhaus_sqrt (const cl_modint_ring& R, const
        }
 }
 
+#if defined(__GNUC__) && defined(__s390__) && (__GNUC__ == 2)  // Workaround GCC-bug (see below)
+               struct cl_sylow2gen_property : public cl_property {
+                       SUBCLASS_cl_property();
+               public:
+                       cl_I h_rep;
+                       // Constructor.
+                       cl_sylow2gen_property (const cl_symbol& k, const cl_MI& h) : cl_property (k), h_rep (h.rep) {}
+               };
+#endif
+
 // Algorithm 3 (for p > 2 only):
 // Tonelli-Shanks.
 // [Cohen, A Course in Computational Algebraic Number Theory,
@@ -213,6 +223,7 @@ static const sqrt_mod_p_t tonelli_shanks_sqrt (const cl_modint_ring& R, const cl
                // Since this computation is a bit costly, we cache its result
                // on the ring's property list.
                static const cl_symbol key = (cl_symbol)(cl_string)"generator of 2-Sylow subgroup of (Z/pZ)^*";
+#if !(defined(__GNUC__) && defined(__s390__) && (__GNUC__ == 2))  // Workaround GCC-bug (see above)
                struct cl_sylow2gen_property : public cl_property {
                        SUBCLASS_cl_property();
                public:
@@ -220,6 +231,7 @@ static const sqrt_mod_p_t tonelli_shanks_sqrt (const cl_modint_ring& R, const cl
                        // Constructor.
                        cl_sylow2gen_property (const cl_symbol& k, const cl_MI& h) : cl_property (k), h_rep (h.rep) {}
                };
+#endif
                var cl_sylow2gen_property* prop = (cl_sylow2gen_property*) R->get_property(key);
                if (prop)
                        h = cl_MI(R,prop->h_rep);