How many instructions are there on x86 today? [closed]
Asked Answered
R

1

29

I am trying to learn up to date x86 assembly all from old 386 base instructions through all the sse additions up until now.

I read some things like SSE5 counts 170 new instructions - and I became urged to know how many of them there are presently in total.

Some may say that it's hard to count (because some of them are close, but work on different type arguments), but I think they can be counted with some reasonable assumptions on how to count multiples as one. So could anybody provide an answer to that?

The best answer would be the table of how many instructions in each processor extension it was.

Reproval answered 10/4, 2013 at 10:0 Comment(10)
Check the manualAlatea
it will be a lot hours of work :c and some mistakes involved :C maybe someone did this already ? I would like to recount it when learning assembly and then make sure i saw it all ;-)Reproval
and then make sure i saw it all - I do not think that this is a reasonable approach when learning assembly. Pick a book like Assembly Language Step-by-Step: Programming with Linux, get started and over time you will learn the necessary instructionsFlatus
Is it even unambiguous? For example, are vpaddd xmm0, xmm0, xmm0 and vpaddd ymm0, ymm0, ymm0 different instructions or not? They aren't even in the same instruction set (AVX vs AVX2), but they're the same mnemonic and the only difference in the encoding is the length bit. If you just want to work through all of them, that's easier than trying to count them..Ataman
movsd is also a case of one mnemonic, but two different instructions (other 386+ instruction, other SSE2 instruction). And many instructions have multiple mnemonics. And are rep/repe/repz and repne/repnz instructions? Intel® 64 and IA-32 Architectures Developer's Manual also presents mov as 3 different instructions: 1. Move, 2. Move to/from Control Registers, 3. Move to/from Debug Registers. And why you expect others to count the instructions for you?Ulises
I do not expect them to count them for me_ Thay maybe counted it for some other purposes and will tell me ;-) As to way of counting use just some reasonable or two or thre of them - I would distinguish by the results and other specyfic also for example adding 64 bits to 64 bits differs form adding 8 bits to 8 bits, same with jumps for me jnz and jge arre different instructionsReproval
As of Sep 6 2014, my very sloppy attempt to count the number of mnemonics at en.wikipedia.org/wiki/X86_instruction_listings yields a count of 678 mnemonics.Allo
@user2214913: Then you really want to count the number of opcodes, if you want to count every form of every instruction differently. (e.g. add r32, r32 vs. add r32, imm32 vs. add r32, imm8(sign-extended). And movzx r32, r8 vs. movzx r16, r8. Actually, then you have to count different prefixes, since operand-size and REX modify things.Samuelson
But Andreas's comment is correct: when I'm looking for a way to save a uop in a loop, I'll sometimes flip through the instruction manual, or search. x86 has too much weird stuff and non-orthogonalities esp. in the vector instructions to try to memorize which version of what is available, and which isn't. And the best choice evolves with time, as microarchitectures change.Samuelson
Oh man... overzealous SO users closed the question for no got reason again -_-... here is a really good answer (between 981 and 3683 instructions, depending on how you count): stefanheule.com/blog/…Sift
J
5

Have a look here, this listing should give you an idea on how many instructions were added to each x86 architecture.

In any case there is no better reference than the official Intel® 64 and IA-32 Architectures Software Developer’s Manual.

Janssen answered 10/4, 2013 at 15:16 Comment(1)
ye I know, but counting myself is tiresome - wil do that eventuallyReproval

© 2022 - 2024 — McMap. All rights reserved.