• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
r31 not available for use in inline asm in xcode?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r31 not available for use in inline asm in xcode?


  • Subject: r31 not available for use in inline asm in xcode?
  • From: Ando Sonenblick <email@hidden>
  • Date: Tue, 2 Aug 2005 17:42:00 -0700

Gang,

We're porting our code from CodeWarrioir to Xcode and are encountering errors when we use r31 (error: PIC register 'r31' clobbered in 'asm')

Two questions:

1) Is there a setting where we can instruct Xcode not to generate an error when we use r31?

2)  And two, it looks like our code (I didnt write it) is assuming that CodeWarrior's asm pre/postamble code is saving/restoring registers r20 through r31.  Is this something we'll have to change?  Perhaps save off registers ourself?  Or do we now have to save off and restore registers ourselves?

I created a simple fn foo 

asm void foo()
{
       li    r5,0
}

which disassembled into this:

    stmw r30,-8(r1)
    stwu r1,-48(r1)
    mr r30,r1

    li r5,0

    lwz r1,0(r1)
    lmw r30,-8(r1)
    blr


I havent studied (yet) PPC asm so I cant say for sure what is happening with r30 and r1, but I assume that if I use the other registers I must save and restore them myself...

So, any feedback from those of you in the know?

Thx,
ando
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: r31 not available for use in inline asm in xcode?
      • From: Damien Bobillot <email@hidden>
  • Prev by Date: decyphering ld's cryptic error messages
  • Next by Date: Default build for 10.2
  • Previous by thread: Re: decyphering ld's cryptic error messages
  • Next by thread: Re: r31 not available for use in inline asm in xcode?
  • Index(es):
    • Date
    • Thread