LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-05-2009, 05:35 AM   #1
arienashwani
LQ Newbie
 
Registered: Mar 2009
Posts: 1

Rep: Reputation: 0
porting an inline Intel assembly code with MMX technology into linux


Dear All,

I am running the code in UBUNTU Operating System.

I am porting a c code which contains inline Intel Assembly for MMX/SSE technology. Since I am new to Linux and not fully aware of the features of gcc as well as GAS assembler. I have two querries?
1. Is there any converter which will automatically convert inline assembly code written for INTEL architecture to extended inline asm for gcc?

2. While I was running a small piece of code containing extended inline assembly for MMX instructions in gcc, I got the following errors?
unknown register name ‘%xmm0’ in ‘asm if I am using xmm0 registers and
unknown register name ‘%mm0’ in ‘asm if I am using mm0 register.
Can anyone tell me whether I need to include any header file to solve this error?
The code is given below:
char X[8] = {0, 1, 2, 3, 4, 5, 6, 7};
char Y[8] = {8, 9, 10, 11, 12, 13, 14, 15}, R[8] = {0};

__asm__("movq (%[a]), %%mm0\n\t"
"movq (%[b]), %%mm1\n\t"
"pavgb %%mm0, %%mm1\n\t"
"movq %%mm1, (%[R])\n\t"
: [R] "=m" (*R)
: [a] "r" (X), [b] "r" (Y)
:"%mm0", "%mm1"
);

Thanks in advance

Last edited by arienashwani; 03-05-2009 at 10:11 PM. Reason: Forgot to mention the name of OS on which I am running the code
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax converter for inline assembly? maxreason Programming 12 06-07-2008 10:23 AM
Inline assembly from C: mmx.h Tischbein Programming 1 03-06-2008 10:37 PM
inserting inline assembly in c andystanfordjason Programming 2 01-11-2007 07:28 PM
inline assembly in gcc gursev Programming 2 03-04-2005 02:17 AM
Inline Assembly Question tjt Programming 3 08-08-2004 04:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration