c++ inline assembler and oop
- From: Frank Heckel <spamtrap@xxxxxxxxxx>
- Date: Wed, 28 Sep 2005 19:14:16 +0000 (UTC)
Hi,
I have a problem when using inline assembler in Visual C++ .NET:
I have a vector-class and try to implement the vector operations with SSE. My problem is, that I don't exactly know, how to access class-members within an asm-block.
Here's how I try to do it - and I don't know if it's correct:
class Vec3 {
public:
... //some member-functions
float x, y, z;
};class SomeClassUsingVec3 {
public:
...
void calcSomething() {
...
__asm {
;load v1 in xmm0
mov ebx, this
lea eax, [ebx].v1
movaps xmm0, eax
;load v2 in xmm1
lea eax, [ebx].v2
movaps xmm0, eax
...
;write xmm0 back to v1
movaps eax, xmm0
...
}
...
}__declspec(align(16)) Vec3 v1, v2; };
Thanks in advance!
Frank
.
- Follow-Ups:
- Re: c++ inline assembler and oop
- From: WahJava
- Re: c++ inline assembler and oop
- Prev by Date: Fiddling with the Instruction Pointer
- Next by Date: Re: Figuring out table based encryption in assembly
- Previous by thread: Fiddling with the Instruction Pointer
- Next by thread: Re: c++ inline assembler and oop
- Index(es):
Relevant Pages
|