5.1.2 assembler error on Solaris 10 with CC='cc -xtarget=opteron -xarch=amd64'

Torbjorn Granlund tg at gmplib.org
Thu Oct 10 00:02:29 CEST 2013


"Daniel Richard G." <skunk at iSKUNK.ORG> writes:

  >   It seems like fbe is only accepting more specific forms of various
  >   mnemonics.
  >
  > That makes no recent GMP version usable with these tools.
  
  Are you aware of what the distinction is between e.g. shr and shrl/shrq?
  
Using the l/q forms of the instruction is redundant when using register
operands.  (For memory operands, the operation size needs to deduced
from the mnemonic.)

So "shr $17,%rax" = "shrq $17,%rax" and "shr $17,%eax" = "shrl $17,%eax".

  >   Alternately, is there a way to have GMP assemble these source files
  >   using $(AS), without going through the C frontend?
  >
  > Not easily.  You could write a script "mycc" which DTRT.
  
  I see that the C compiler is actually invoked as $(CCAS) when compiling
  assembly, and if one sets this at configure time, it will use that
  instead of $(CC). So I could specify CCAS=as. But CFLAGS et al. are
  passed in as arguments, and as(1) here does not like -O or -xO3.
  
Good luck.

I don't think we can reasonably do more from the GMP side.

The assembly problems are clearly due to a severely broken assembler
which arbitrarily fails with some standard mnemonics.

You still haven't told us what fails with the -m64 flag; we might be
able to put that old compiler in 64-bit mode.  Not sure how useful
that'd be, though.

-- 
Torbjörn


More information about the gmp-bugs mailing list