AMD and new pentiums

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
elias

AMD and new pentiums

Post by elias »

are both of these compatible? i knwo AMD has a really different architecture
Tom

Re:AMD and new pentiums

Post by Tom »

Not all that really...example: the syscall instruction.

They work differently on those different processors.

But mostly, the are compatible.
Curufir

Re:AMD and new pentiums

Post by Curufir »

AFAIK instructions that were contained within the original 586 set are compatible between the two (Note that 586 contains instructions that weren't on 486, 486 has instructions that weren't on 386 but these are made clear in the documentation). After the early basic 586 (Not pentium pro) you start getting manufacturer specific instructions like 3DNow, MMX etc. Implementation, and existence, of these instructions varies between AMD and Intel.

Best advice would be that if you're using an instruction that's outside the basic pentium set then look at both AMD and Intel processor manuals to see if a) The instruction exists b) The instruction is implemented the same way. If it isn't and you really need it then you'll have to find a way of handling the presence/absence within your code.

Personally I use the 386 instruction set as a base and work from there. Even that has problems since some of the early cpus have broken behaviour with a few instructions eg Division.

Curufir
Tom

Re:AMD and new pentiums

Post by Tom »

I really only use simple asm code...since i'm doing mostly C code...and for keeping simplicity...anyway, another example is the loadall instruction...works differently on different processors.
elias

Re:AMD and new pentiums

Post by elias »

well i dont know advanced assembly, and onyl use the instructions nasm, supports which isnt all of them. it dosnt even support exch, but i dont care. also, wats up with new AMD XP processors? theyre supposed to work really well with windows XP, but i see this is a major problem. dosnt anyone else? i also have foudn out amd and intel both use windows xp now to test out their newest processors.
Curufir

Re:AMD and new pentiums

Post by Curufir »

NASM has a fairly complete instruction set actually, make sure you have the latest version though. Problem is that the documentation tends not to keep up with the program...why break with open source programming tradition :)

Are you sure you don't mean XCHG, which exchanges the contents of 2 things. Took a quick look around for the EXCH instruction, because my memory just drew a blank trying to remember it, and all I came up with was that the old PDP-10 has one. I apologise if it's just an instruction on one the new processors, haven't looked at them yet.

Curufir
K.J.

Re:AMD and new pentiums

Post by K.J. »

AMD's CPUs do not currently support things like Hyper Threading. P4s and AMD's Athlons/Durons are basically 586 compatable, and then they both support some things that aren't exactly standards such as MMX and SSE. Both CPUs though have stuff in them that the other doesn't have and that aren't official standards.

K.J.
elias

Re:AMD and new pentiums

Post by elias »

hyperthreading?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:AMD and new pentiums

Post by Pype.Clicker »

HyperThreading is a new feature in P4 (Xeon) processors: it gives the processor not one but K cpu contexts (registers, etc) which allow the one 'virtual processor' (hyperthread) to continue its execution while another one is stalled (waiting for memory cycle to continue, etc.)

this allow one single chip to act as a multiprocessor system
Berserk

Re:AMD and new pentiums

Post by Berserk »

That's right, HyperThreading is already in some of the new Xeon processors, But it will be in a New P4 3Ghz.

But HyperThreading depends on software and hardware, the software must be programmed to support it, and also the hardware must support it.

But it can only be used on the new Windows & Linux systems, that support Dual Processors.

And now i got a question:

You mean if i make a OS for an Intel Processor, it could not be used by AMD processors?? (NOT that i use AMD and it doesn't really matter to me, i just want to know.)

Ciao ;)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:AMD and new pentiums

Post by Pype.Clicker »

well, if you hard-code your OS so that it requires Intel-specific extensions ... yes.

Now, it's always possible to have __INTEL_TARGET__ and __AMD_TARGET__ or __GENERIC_X86__ to tune the generated code or have a CPUID function (#ifdef __PENTIUM__) that will change CPU.model and to perform some if (CPU.model == INTEL_CPU) { init_some_intel_stuff() ...}

If your code is properly written, this can be done :-)
grey wolf

Re:AMD and new pentiums

Post by grey wolf »

to clarify:

AMD, Intel, Cyrix, Transmeta, and other "x86-class" processors are fundamentally compatible. they will all behave as x86 processors and will execute the same x86 instructions.

HOWEVER: current AMD processors support the i586 instruction set, MMX, SSE, 3D Now!, and 3D Now!+. current pentium 4 processors will support the i686 instruction set (which has only a few extensions but is 100% compatible with i586), SSE, SSE2, and MMX.

the most recent AMD processors will now support SSE2, but i'm not entirely sure which ones. the newest Pentium 4s now support Hyperthreading (which was previously only in P4 Xeon), which simulates a dual-CPU platform.

my recommendation for a modern target platform (if you don't plan on being bound by legacy support) is a kernel compiled for i586 with dynamic MMX and SSE extensions. (by dynamic, i mean conditionally executing optimized code when appropriate.)

all of this information can be found at http://www.sandpile.org with descriptions of each CPU implementation, a full list of opcodes and registers, as well as extra information useful for porting to x86-64 (AMD's Hammer processor extensions).
Post Reply