27

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.

alex
  • 6,818
  • 9
  • 52
  • 103
user2214913
  • 1,441
  • 2
  • 19
  • 29
  • 2
    Check [the manual](http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-2a-manual.html) – Michael Apr 10 '13 at 10:02
  • 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 ;-) – user2214913 Apr 10 '13 at 10:06
  • 1
    `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](http://www.amazon.com/Assembly-Language-Step---Step-Programming/dp/0470497025/ref=sr_1_2?ie=UTF8&qid=1365588823&sr=8-2&keywords=Assembly+Language+Step+by+Step), get started and over time you will learn the necessary instructions – Andreas Fester Apr 10 '13 at 10:15
  • 3
    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.. – harold Apr 10 '13 at 15:28
  • 2
    `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](http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-manual-325462.html) 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? – nrz Apr 10 '13 at 18:29
  • 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 instructions – user2214913 Apr 12 '13 at 11:20
  • 4
    As of Sep 6 2014, my very sloppy attempt to count the number of mnemonics at https://en.wikipedia.org/wiki/X86_instruction_listings yields a count of 678 mnemonics. – bshanks Sep 07 '14 at 01:14
  • 1
    @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. – Peter Cordes Dec 06 '15 at 20:51
  • 1
    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. – Peter Cordes Dec 06 '15 at 20:56
  • 1
    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): https://stefanheule.com/blog/how-many-x86-64-instructions-are-there-anyway/ – Wolf Aug 03 '18 at 17:03

1 Answers1

3

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.

Kiloreux
  • 2,220
  • 1
  • 17
  • 24
redblackbit
  • 816
  • 8
  • 12