Browse Source

* 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.
master
Richard Kreckel 23 years ago
parent
commit
460a165479
  1. 7
      ChangeLog
  2. 5
      include/cln/modules.h
  3. 2
      include/cln/object.h
  4. 12
      src/numtheory/cl_nt_sqrtmodp.cc

7
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.

5
include/cln/modules.h

@ -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
@ -152,6 +152,9 @@
#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 () {} \

2
include/cln/object.h

@ -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__)

12
src/numtheory/cl_nt_sqrtmodp.cc

@ -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);

Loading…
Cancel
Save