LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-16-2006, 04:22 AM   #1
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Rep: Reputation: 15
Register operations in AMD-64


Hi ,
I have to enable the alignment-check exception in amd x86_64 machine. I read the AMD manual volume 2 and got something useful..

An #AC exception occurs when an unaligned-memory data
reference is performed while alignment checking is enabled.
After a processor reset, #AC exceptions are disabled. Software
enables the #AC exception by setting the following register bits:
􀂄 CR0.AM=1.
􀂄 RFLAGS.AC=1.
When the above register bits are set, an #AC can occur only
when CPL=3. #AC never occurs when CPL < 3.


It asks me to reset the flags mentioned above. I dont know how to do this and i doubt whether any application is allowed to do so..
i need your help in doing the same..

thanks in advance
gobi
 
Old 06-16-2006, 10:29 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
*Why* do you "have to enable alignment checking"???

Knowing a little of your problem's *context* might help give a better solution.

Your .. PSM
 
Old 06-18-2006, 11:06 PM   #3
gobi_dgm
Member
 
Registered: Feb 2005
Location: Bangalore
Distribution: FC3
Posts: 137

Original Poster
Rep: Reputation: 15
Hi,
we are trying to understand what are the possible changes to be done to a codebase while porting it from 32-bit to 64-bit machine. So i thought it will be better to have a practical knowledge about 64-bit machines before doing that. Since misalignment is the major problem while migrating, i thought of enabling it in our 64-bit server..
Please help me in doing the same..

Thanks in advance
Gobi
 
Old 06-20-2006, 12:01 AM   #4
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

As far as *how* to do it, most C/C++ compilers (including gcc) permit in-line assembly code. The easiest way is to just try it and see if the OS lets you get away with modifying that particular flag. The worst that could happen is you might crash your system and have to reboot ;-)

As far as misalignment being a "major problem", I think it's probably actually among the *least* of your worries. I quote from the AMD Porting FAQ (listed below:
Quote:
What are the memory alignment requirements for code and data in each of these
operating systems?


There are no alignment requirements. x86 architecture has never had any alignment
requirements and the 64-bit extensions have not added any. However, the ABI for
64-bit software has been designed to improve performance by striving for natural
alignment of most memory operands...
The article goes on to say that the biggest impact (if any) would be on performance.

Finally, here are some good references (most from the AMD site itself) that might give you some additional information:
- http://www.devx.com/amd/Article/16520
- http://www.devx.com/amd/Door/21585
- http://www-128.ibm.com/developerwork.../l-port64.html
- http://www.amd.com/us-en/assets/cont...orting_FAQ.pdf

'Hope that helps .. PSM

Last edited by paulsm4; 06-20-2006 at 12:02 AM.
 
  


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
AMD Opteron or AMD 64 dual core difference? GATTACA Linux - Hardware 1 10-22-2005 09:46 PM
C++:Operations with iterators frankie_DJ Programming 12 10-20-2005 03:39 AM
AMD 64 bit vs Dual AMD MP 2400+ GATTACA Linux - Hardware 2 06-02-2004 04:54 PM
Aritmethical operations davi_cabral Linux - Newbie 1 09-26-2003 11:04 AM
Modem operations dbeyes Linux - Newbie 1 04-22-2003 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:54 AM.

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