Inline assembler problem

Peter Naulls peter at erble.freeserve.co.uk
Sun Jun 10 11:45:14 PDT 2001


I'm trying to compile libgmp2.

It uses assembler in places, for speed:

   #define umul_ppmm(xh, xl, a, b) \
     __asm__ ("%@ Inlined umul_ppmm
   	mov	%|r0, %2, lsr #16
   	mov	%0, %3, lsr #16
   	bic	%|r1, %2, %|r0, lsl #16
   	bic	%|r2, %3, %0, lsl #16
   	mul	%1, %|r1, %|r2
   ...


However, this fails when it assembles:

; Generated by gcc 2.95.2 19991024 (release) for ARM/RISC OS
__r0	RN	0
__a1	RN	0
__a2	RN	1
__a3	RN	2
__a4	RN	3
...


__r0 is defined, but not __r1 and __r2 which the assembler also uses.
I can work around it, but it's just a bit of a hassle :-|

Peter


-- 
------------------------------------------------------------------------
 Peter Naulls - peter at erble.freeserve.co.uk
 RISC OS Projects Initiative  -  http://chocky.mine.nu/initiative/
 Java for RISC OS and ARM     -  http://www.java.riscos.org.uk/
 Debian Linux on RiscPCs      -  http://chocky.mine.nu/debian/
------------------------------------------------------------------------



More information about the gcc mailing list