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

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


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

Thanks for the reply. This was a place I looked at, but there is no mention of how asm works in the context of C++ templates.

Tim



Take a look at GCC's assembly syntax:
http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html

--Kyle Sluder

On 8/31/07, Tim Rogstad <email@hidden> wrote:


 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


_______________________________________________ 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
References: 
 >Re: Tricky "inline-assembly/C++ template" issue (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: Tricky "inline-assembly/C++ template" issue
  • Next by Date: Re: Xcode 2.4.1 locking build directories after build
  • Previous by thread: Re: Tricky "inline-assembly/C++ template" issue
  • Next by thread: default window arrangement for IB?
  • Index(es):
    • Date
    • Thread