PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

using inline assembler in c++

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
soyke



Joined: 24 May 2006
Posts: 2

PostPosted: Wed May 24, 2006 7:59 am    Post subject: using inline assembler in c++ Reply with quote

I am trying to get inline assembler to work using the pgi compilers on the xt3.
It works fine if I use pgcc, but I need to compile c++ code, and pgCC chokes on it.
Here is my asm section:
asm
(
"movupd (%0), %%xmm1\n\t"\
"addpd %%xmm1, %%xmm1\n\n"\
"movupd %%xmm1, (%0)"
:: "r" (&d)
: "%xmm1"
);
and here is pgCC's output:
hello.c:
"hello.c", line 17: error: unknown register name "%xmm1"
: "%xmm1"
^

1 error detected in the compilation of "hello.c".

I would really appreciate it if someone could tell me what I'm doing wrong, or how to get this to work with c++.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Wed May 24, 2006 3:06 pm    Post subject: Reply with quote

Hi soyke,

Unfortunately, we only support basic or extended asm in C but not C++. Is it possible to write these routines in C, and then link in the C objects with the rest of your C++ code?

- Mat
Back to top
View user's profile
soyke



Joined: 24 May 2006
Posts: 2

PostPosted: Wed May 24, 2006 6:17 pm    Post subject: Reply with quote

The only problem with that, is that my c++ function needs to call other c++ functions. I supposed I could isolate the assembler, and declare the c function as inline.

-Jordan
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group