Ilya Zakharevich on Mon, 1 Apr 2002 16:54:45 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

GP/PARI 2.1.3: ix86 assembler for divll


Try compiling this (e.g., append it to src/gp/gp.c)

  void
  ddummyy(ulong a)
  {
    (void)divll(a, 1000000000);
  }

On ix86, this produces the following assembler:

          .align 2
  .globl _ddummyy
  _ddummyy:
          movl 4(%esp),%eax
          movl _hiremainder,%edx
  /APP
          divl $1000000000
  /NO_APP
          movl %edx,_hiremainder
          ret

which results in the following message from gas:

  {stdin}: Assembler messages:
  {stdin}:9343: Error: operands given don't match any known 386 instruction

In fact, this particular call to divll() may be a result of inlining
divis() into convi() (see src/kernel/none/mp.c).  Such an inlining is
observed in Math::Pari on one particular flavor of Linux with one
particular version of gcc with one particular build of Perl ;-).
Recall that Math::Pari compiles PARI with the same flags as perl was
compiled.

Obviously, the flags restricting the arguments of the assembler for
divll() are not restrictive enough.  Can somebody improve the
situation?

Yours,
Ilya