MMX vs SSE vs 3DNow!

Started by
7 comments, last by Metus 21 years, 8 months ago
I''ll try to optimize my vector and vertex manupulation class with these pretty usual extensions. I know that MMX is for integers only and SSE and 3DNow for floats, so i guess I''ll use the latest. My question is though: If i implement SSE from the INTEL documents; will these SSE "functions" work on the AMD Athlon''s (the ones with SSE support) or do i have to use one implementation for the AMD version and one of the Intel version? The same goes for MMX (AMD Has the Extended MMX though) but will the standard mmx functions work over Cross-CPU''s?
Ethereal
Advertisement
Some do, some don''t; depends on the CPU(s)
AFAIK, none of the Intel''s support 3DNow, but all recent AMDs do MMX. Some do SSE, not sure about SSE2.

There''s an opcode to query the CPU for it''s capibilities.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Every socket based Athlon (Thunderbird & XP) supports
mmx , sse , 3dnow professional . But no sse2 though .
I don''t know for the slot-athlon ''s .
And indeed Magmai is right , 3dNOW/PRO is exclusive
for AMD .

Well, Yes but that''s not my question: is the MMX instructions equal to both the AMD and the Intel version? If I''m using MMX on my computer using an Athlon XP, will the same cod work flawlessly on an Intel CPU?
Ethereal
if you know how extensions work in opengl you know how that works..

some cpus can do mmx, some can do 3dnow, some can do sse, some can do sse2. you have to query what they can do, if it can do the specific ext, you can use it.

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

It''s not too complicated.
You should get the type of the CPU first, and you should create subclasses with inheritance from your Vector class for every case. From the P166 every CPU supports MMX, some AMD processors supporst 3DNow beside it, but nowadays AMD and Intel processors supports MMX and SSE too. And in the P4 there''s SSE2 too.
So you must create different vector classes for every cases, and use virtual functions, with plymorphism to choose the right. In this case you use the ancestor, but with polymorphism the C++ use the correct. So the most important to identify the type of the processor first. Later you know which class should be used.

Jonny

I don''t think you get my dilemma... Is the registers (mm0 .. mm7) named equally in both AMD''s and INTEL''s CPU''s? Is the MOVQ MOVD equal in both cpu''s?
Ethereal
Metus: If an AMD CPU supports MMX, it will run the same kind of MMX code an Intel chip runs. Why would you think otherwise? It wouldn''t be MMX if it couldn''t run Intel MMX code...

The encoding of the instructions are the same.

quote:
From the P166 every CPU supports MMX


Nope. There are non-MMX P166s, P180s, and P200s. When Intel introduced MMX, they had 166MHz and 200MHz versions (not sure about 150 and 180), and from then on everything supported MMX (except for Pentium Pros -- the Pentium IIs had MMX support, though.)

As always, use CPUID to find out if a given CPU supports MMX or not.

---
Bart
----Bart
trzy: Yes, i was pretty sure it was the same; but hey, who knows =)
Ethereal

This topic is closed to new replies.

Advertisement