I posted this Q to TI's 28xx DSP forum but haven't heard a response and figured maybe someone here might know.
I know how to write functions in assembly so that they are C-callable; if the C-callable name is foo()
then the assembly function is named _foo()
.
What if I want to use C++ and optimize a class method in assembly? How do I do that? I assume the only major issues are:
- naming
- accessing the "this" pointer
- accessing class members by somehow knowing offsets
and if I don't want to worry about the last two, then perhaps I would write a static member function and do this:
class MyClass
{
int x;
static int _doSomething(int u); // implement this in assembly
public:
inline void doSomething() { x = _doSomething(x); }
// lightweight C++ wrapper to handle the class member / "this" pointer stuff
};