LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-12-2012, 08:12 PM   #1
iam_techno
Member
 
Registered: Aug 2006
Location: Oregon
Distribution: Ubuntu 9.04, Windows 7
Posts: 48

Rep: Reputation: 16
Number of XMM registers in multicore processors


Hey evry1,

I have just recently expanded my programming purview by learning, albeit slowly, assembly programming.

I have a Phenom x4 that has four cores.
I know that it supports SSE-SSE4a instructions.
Some of the operations (like SQRTPS) can operate on 4 items at the time.
Becasue it is 64bit capable, it has 16 XMM registers

So my question is this: Does each core of my Phenom have its own registers or are the registers shared? The reason I ask is that the other day I was thinking about this application I'd like to write that would benefit from being able to perform many simultaneous square root operations. So what I was thinking about doing was coding an example that used this algorithm:

Load numbers from source into a vector
Use OpenMP to create 4 threads (one for each core). Each doing:
Load up the 16 XMM registers with packed numbers read from vector
Perform SQRTPS on each XMM register
Write resultant numbers into another vector
Output resultant vector
 
Old 03-13-2012, 01:44 PM   #2
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Quote:
Originally Posted by iam_techno View Post
Hey evry1,

I have just recently expanded my programming purview by learning, albeit slowly, assembly programming.

I have a Phenom x4 that has four cores.
I know that it supports SSE-SSE4a instructions.
Some of the operations (like SQRTPS) can operate on 4 items at the time.
Becasue it is 64bit capable, it has 16 XMM registers

So my question is this: Does each core of my Phenom have its own registers or are the registers shared? The reason I ask is that the other day I was thinking about this application I'd like to write that would benefit from being able to perform many simultaneous square root operations. So what I was thinking about doing was coding an example that used this algorithm:

Load numbers from source into a vector
Use OpenMP to create 4 threads (one for each core). Each doing:
Load up the 16 XMM registers with packed numbers read from vector
Perform SQRTPS on each XMM register
Write resultant numbers into another vector
Output resultant vector
Each core should have all of its own registers, unless AMD is running some kind of quiet scam on all of us. The only alternative would be for them to push register data in and out of memory constantly, which would have a pretty dramatic effect on performance which we all would have noticed by now.

I believe some of the Intel chips have "virtual cores", which means that some of the cores don't actual exist, but I don't think that is the case for a Phenom.
 
  


Reply

Tags
assembly, c++, openmp, registers


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Under moderate load in a multicore system of 13 processors one processor gets 100% us praveen24 Linux - Kernel 7 09-03-2009 04:21 AM
How to find the number of physical processors in a AIX machine shawshank_blr AIX 13 07-17-2009 10:08 PM
LXer: Howto display the number of processors in Linux LXer Syndicated Linux News 0 09-02-2007 07:50 PM
Getting the number of processors spaaarky21 Programming 11 11-20-2005 01:44 PM
problems with gcc inline assembly using xmm registers Y0jiMb0 Programming 3 12-05-2004 02:59 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration