3 ms·
> but we actually cannot count how many instructions there are in x86/amd64 Sorry for being pedantic, but we can, if everyone agrees on what is actually being
by jsjohnst 4y ago
> but we actually cannot count how many instructions there are in x86/amd64
Sorry for being pedantic, but we can, if everyone agrees on what is actually being counted, aka what the definition of an “instruction” is.
You already made the case supporting that POV yourself, then oddly flipped back to implying there was something preventing it besides that at the end. We definitely “can” agree on a definition of an “instruction”, but yes, we probably won’t.
- innocenat 4y agoThat's a big "if". We can't even get a single assembly syntax, and Intel vs GNU/AT&T syntax war is almost as bad as vi/emac.
- jsjohnst 4y agoCompletely agree, but the point in question wasn’t if it was likely, but if it was possible at all.
- adrian_b 4y agoYou are right that when using a clear definition of what distinct instructions are it is always possible to count how many instructions an ISA contains. The only problem is that many people are careless when counting so they do not apply consistent rules, thus obtaining different results. The most widely used traditional rule is that 2 instructions are not distinct when they perform the same operation on operands of a specified data type, so that the only difference between them is where the operands are. The operands may be in various kinds of registers, in the instruction stream (immediate operands) or in data memory, and their addresses may be computed in various ways, but the operation performed by the instruction is the same. The distinct kinds of instructions obtained by this definition can be further grouped in a smaller number of generic instruction types, which perform the same kind of operation, for example a multiplication or a comparison, but on different data types, e.g. on 8-bit/16-bit/32-bit/64-bit integers, signed or unsigned or signed with saturation or unsigned with saturation, fixed-point numbers or floating-point numbers, polynomials with binary coefficients, bit strings or character strings, short vectors or matrices, and so on.