• 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
Tricky "inline-assembly/C++ template" issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tricky "inline-assembly/C++ template" issue


  • Subject: Tricky "inline-assembly/C++ template" issue
  • From: Tim Rogstad <email@hidden>
  • Date: Fri, 31 Aug 2007 11:44:28 -0700

Title: Tricky "inline-assembly/C++ template" issue
I'm porting some CodeWarrior C++ projects over to XCode/gcc, and have run into a problem that I've been unable to solve it despite a lot of effort and time.

The code has some template classes with inlined functions that are declared asm:

template<int sprid>
class SpecialReg
  { 
private:
                SpecialReg( );
          ~SpecialReg( );
                
       
public:
                typedef PPCContext::gpr         t_GPR;
         
typedef PPCContext::spr         t_reg;
         
typedef SpecialReg<sprid>       sprreg;
                enum { id = sprid };
               
                static inline asm  t_GPR get( )
        {      
                        mfspr   r3, id;
                blr;
            }
               

};

The error I get is "error: block assembly operand not recognized", and the offending line is:

"mfspr  r3, id;"

I believe that the operand "id" must be the problem, and I think that the template substitution isn't occuring (i.e. the template arg "sprid" isn't being substituted).  I've tried writing in "sprid" directly:

"mfspr  r3, sprid;"

but that didn't work.

Does anyone have any advice, or know of a solution?

Much appreciation,
Tim
 _______________________________________________
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

  • Prev by Date: Re: Guidelines for talking about Xcode 2.5 on this list
  • Next by Date: default window arrangement for IB?
  • Previous by thread: Re: How do I find a method definition?
  • Next by thread: Re: Tricky "inline-assembly/C++ template" issue
  • Index(es):
    • Date
    • Thread