s390.
* src/numtheory/cl_nt_sqrtmodp.cc: workaround for GCC2.x compiler-bug
on s390, provided by Gerhard Tonn.
+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.
#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 () {} \
#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__)
}
}
+#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,
// 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:
// 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);