Re: Tricky "inline-assembly/C++ template" issue
Re: Tricky "inline-assembly/C++ template" issue
- Subject: Re: Tricky "inline-assembly/C++ template" issue
- From: Alastair Houghton <email@hidden>
- Date: Mon, 3 Sep 2007 17:55:05 +0100
On 31 Aug 2007, at 21:13, Tim Rogstad wrote:
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.
If you write your code using the GCC asm syntax, you shouldn't have
any problems, because GCC's asm syntax is based (largely) upon
textual substitution, and doesn't actually require that the compiler
can parse the assembly code. For instance
t_GPR ret;
asm volatile (" mfspr %0, %1;" : "=r"(ret) : "i"(sprid));
return ret;
would do something similar to the get() method you show below.
You should probably file a bug about the CodeWarrior/Microsoft syntax
not working in the template parameter case, but the above should be a
workaround for now.
Caveat: This was typed in Mail, and hasn't been tested, so (for
instance) it's possible that I've got the constraints slightly
wrong. You can find the constraint letters in the GCC manual... if
you have the Developer Tools installed, it's here:
<file:///Developer/ADC Reference Library/documentation/
DeveloperTools/gcc-4.0.1/gcc/Constraints.html>
Otherwise:
<http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/
gcc/Constraints.html>
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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