"tmp-divrem_2.s", line 116 : Syntax error ???

Dennis Clarke dclarke at blastwave.org
Tue Jun 2 22:32:00 CEST 2009


By now, on this maillist, people are about ready to just filter my email
out altogether. Call me the last of the die hard types that simply wants
to do things a certain way.

Here is the story.

I knew that Sun Studio 11, at least on x86, would need to make use of the
.asm files in the source tree. That means it would fail of course. For one
reason or another.

I tried a build with GCC 4.3.3 and binutils and every test passed,
everything works.

I went back and tried with Studio 11 and saw this :

 /opt/studio/SOS11/SUNWspro/bin/cc -c -DHAVE_CONFIG_H -I.
-I../../../gmp-4.3.1/mpn -I.. -D__GMP_WITHIN_GMP -I../../../gmp-4.3.1
-DOPERATION_divrem_2 -I/opt/csw/include -xstrconst -xildoff -xarch=386
-xnolibmil -Xa -Kpic -xregs=no%frameptr -xlibmieee -g -Qy
-xdebugformat=dwarf -xs -D_TS_ERRNO tmp-divrem_2.s -KPIC -DPIC -o
.libs/divrem_2.o
Assembler:
        "tmp-divrem_2.s", line 116 : Syntax error
        Near line: "    or      %dl, %al"
        "tmp-divrem_2.s", line 211 : Syntax error
        Near line: "    or      %dl, %al"
cc: assembler failed for tmp-divrem_2.s
make[2]: *** [divrem_2.lo] Error 1
make[2]: Leaving directory
`/export/medusa/dclarke/build/libgmp/i386/gmp-4.3.1-i386_SunOS5.8_i386_Studio/mpn'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/export/medusa/dclarke/build/libgmp/i386/gmp-4.3.1-i386_SunOS5.8_i386_Studio'
make: *** [all] Error 2


I don't see anything wrong with that assembly line which is a simple
logical or of two registers. Nothing fancy at all.

I go and look at the source :

$ cat -n ../../gmp-4.3.1/mpn/x86/divrem_2.asm
     1  dnl  x86 mpn_divrem_2 -- Divide an mpn number by a normalized
2-limb number.
     2
     3  dnl  Copyright 2007, 2008 Free Software Foundation, Inc.
     4
     5  dnl  This file is part of the GNU MP Library.
     6
  <snip>
    56
    57  ASM_START()
    58          TEXT
    59          ALIGN(16)
    60  PROLOGUE(mpn_divrem_2)
    61          push    %ebp
    62          push    %edi
    63          push    %esi
    64          push    %ebx
    65          sub     $36, %esp
    66          mov     68(%esp), %ecx          C un
    67          mov     72(%esp), %esi          C dp
    68          movl    $0, 32(%esp)
    69          lea     0(,%ecx,4), %edi
    70          add     64(%esp), %edi          C up
    71          mov     (%esi), %ebx
    72          mov     4(%esi), %eax
    73          mov     %ebx, 20(%esp)
    74          sub     $12, %edi
    75          mov     %eax, 24(%esp)
    76          mov     %edi, 12(%esp)
    77          mov     8(%edi), %ebx
    78          mov     4(%edi), %ebp
    79          cmp     %eax, %ebx
    80          jb      L(8)
    81          seta    %dl
    82          cmp     20(%esp), %ebp
    83          setae   %al

      here comes the "syntax error" :-\

    84          or      %dl, %al

      did you see it ?  no?  I don't either.

    85          jne     L(35)
    86  L(8):
    87          mov     60(%esp), %esi          C fn
    88          lea     -3(%esi,%ecx), %edi

  <snip>

   174  L(fix): seta    %dl
   175          cmp     20(%esp), %ebp
   176          setae   %al
   177          or      %dl, %al

    line 177 is another syntax error.

   178          je      L(bck)
   179          inc     %edi
   180          sub     20(%esp), %ebp
   181          sbb     24(%esp), %ebx
   182          jmp     L(bck)
   183
   184  L(35):  sub     20(%esp), %ebp
   185          sbb     24(%esp), %ebx
   186          movl    $1, 32(%esp)
   187          jmp     L(8)
   188  EPILOGUE()


Not too sure what to do at this point.

Any thoughts ?


Dennis




More information about the gmp-bugs mailing list