This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM ASM %c0 output operand doesn't seem to output correctassembly code


Found a way to fix the problem:

add this piece of code to arm.c in the switch case of function
arm_print_operand.

    case 'c':
      if (GET_CODE (x) == CONST_DOUBLE)
	fprintf (stream, "%s", fp_immediate_constant (x));
      else if (GET_CODE (x) == NEG)
	abort (); /* This should never happen now.  */
      else
	output_addr_const (stream, x);
      return;

ain't very clean but works...

cheers



On Tue, 2005-04-05 at 15:40 +0200, Claudio Favi wrote:
> Hi,
> I wanted to substitute an operand that is a constant value without the
> syntax that normally indicates an immediate operand. For that reading
> the manual i saw that %cn is what i need. But it does seem to work:
> 
> sample program:
> 
> int main() {
>  asm ("cdp %c0, 0, cr15, cr%c1, cr2, 0": : "n"(3), "n"(5) );
> }
> 
> when i compile it i get:
> 
> cdp #6,0,cr15,cr#5,cr2,0
> 
> note that this is for the ARM architecture
> I tried to compile the same code with i386 and it works as expected:
> 
> cdp 6,0,cr15,cr5,cr2,0
> 
> (well except that cdp is not a i386 instruction ...)
> 
> is there a reason for this ?
> 
> Thanks
> 
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]