Use on AVR

Torbjorn Granlund tg at gmplib.org
Sat Jun 9 17:15:33 CEST 2012


bodrato at mail.dm.unipi.it writes:

  IIRC, with avr-gcc, the unsigned long type exists and it is 32 bits long.
  Using them for all operations probably is not the faster way to handle
  long integers, because it forces the compiler to use many registers and a
  lot of code, but it should work.
  
I tried avr-gcc both from FreeBSD's ports and from Debian's apt:

Attempt 1:

  tom$ avr-gcc -I. -O -S mini-gmp.c
  mini-gmp.c: In function 'mpz_out_str':
  mini-gmp.c:3996:9: warning: incompatible implicit declaration of
  built-in function 'fwrite' [enabled by default]
  mini-gmp.c: In function 'mpn_div_qr_preinv':
  mini-gmp.c:1012:1: error: unable to find a register to spill in class
  'POINTER_REGS'
  mini-gmp.c:1012:1: error: this is the insn:
  (insn 238 236 239 10 (set (reg/v:SI 219 [ n0 ])
          (mem:SI (pre_dec:HI (reg:HI 2 r2 [orig:239 ivtmp.626 ] [239]))
          [0 MEM[base: D.7131_301, offset: 0B]+0 S4 A8])) mini-gmp.c:885
          26 {*movsi}
       (expr_list:REG_INC (reg:HI 2 r2 [orig:239 ivtmp.626 ] [239])
          (nil)))
  mini-gmp.c:1012: confused by earlier errors, bailing out


Attempt 2:

  tom$ avr-gcc -mint8 -I. -O -S mini-gmp.c
  <built-in>:0:0: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <http://gcc.gnu.org/bugs.html> for instructions.

Not too encouraging.

-- 
Torbjörn


More information about the gmp-discuss mailing list